Cerere plugin cadouri de craciun pe server de zm

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
bogdy2015
Membru, skill 0
Membru, skill 0
Posts: 37
Joined: 20 Dec 2013, 00:37
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Contact:

21 Dec 2013, 16:43

Vreau si eu pluginul de craciun, acela care daca omori un zombie e sansa sa pice cadou din el, iar din cadou sa pice ammo, armura...cum e pe aproape toate serverele zp
Rapidserver
User avatar
Rony
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 967
Joined: 11 Mar 2013, 11:43
Detinator Steam: Da
CS Status: CO-FOUNDER BETANO
Detinator server CS: CS1.6 , CS:GO
SteamID: 31r1
Reputatie: Membru Club eXtreamCS (1 luna)
Membru Club eXtreamCs (28 Feb)
Utilizator neserios (tepar)
Location: NAPOLI
Has thanked: 172 times
Been thanked: 66 times
Contact:

21 Dec 2013, 17:30

uite unul,fara ammo iti da speed,teleport,he,fb etc.
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <fakemeta_util>
#include <fun>
#include <hamsandwich>

#define PLUGIN "Bonus Box"
#define VERSION "1.0"
#define AUTHOR "Laur"

new CvarFurienSpeed, CvarAntiFurienSpeed;
new bool:HasSpeed[33], bool:HasTeleport[33];
new const ClassName[] = "BonusBox"
new Model[2][] = {
	"models/bonusbox5.mdl",
	"models/bonusbox5.mdl"
}

new Sprite, Sprite2
new Teleport_Cooldown[33]
new CvarTeleportCooldown, CvarTeleportRange, CvarFadeTime, CvarColor
new const SOUND_BLINK[] = { "weapons/flashbang-1.wav" }
const UNIT_SEC = 0x1000
const FFADE = 0x0000

#define FFADE_IN		0x0000		// Just here so we don't pass 0 into the function
#define FFADE_OUT		0x0001		// Fade out (not in)
#define FFADE_MODULATE		0x0002		// Modulate (don't blend)
#define FFADE_STAYOUT		0x0004		// ignores the duration, stays faded out until new ScreenFade message received
enum {
	Red,
	Green,
	Blue
};

public plugin_init()
{	
	register_plugin( PLUGIN, VERSION, AUTHOR );
	register_event("HLTV", "RoundStart", "a", "1=0", "2=0")
	register_event("CurWeapon", "event_cur_weapon", "be", "1=1");
	register_event("DeathMsg", "Death", "a")
	RegisterHam(Ham_Spawn, "player", "Spawn", 1);
	register_forward(FM_CmdStart, "CmdStart")
	register_forward(FM_Touch, "Touch")
	CvarFurienSpeed = register_cvar("amx_bonusbox_furien_speed", "800");
	CvarAntiFurienSpeed = register_cvar("amx_bonusbox_anitfurien_speed", "400");
	CvarTeleportCooldown = register_cvar("bh_teleport_cooldown", "10")
	CvarTeleportRange = register_cvar("bh_bonusbox_teleport_range", "123456789")
	CvarFadeTime = register_cvar("amx_bonusbox_teleport_fadetime", "1.5")
	CvarColor = register_cvar("amx_bonusbox_teleport_color", "255255255")
	register_clcmd("power2", "CmdTeleport");
	set_task( 60.0, "CheckTime", _, _, _, "b", 0 );
}

public plugin_precache() {
	for (new i = 0; i < sizeof Model; i++)
		precache_model(Model)
	
	Sprite = precache_model( "sprites/shockwave.spr")
	Sprite2 = precache_model( "sprites/blueflare2.spr")
}

public RoundStart()
{
	new ent = FM_NULLENT
	static string_class[] = "classname"
	while ((ent = engfunc(EngFunc_FindEntityByString, ent, string_class, ClassName))) 
		set_pev(ent, pev_flags, FL_KILLME)
	
	for(new id = 1; id < get_maxplayers();id++) {
		HasSpeed[id] = false
		HasTeleport[id] = false	
	}
	
}

public Spawn(id) {
	HasSpeed[id] = false
	HasTeleport[id] = false	
}

public Death()
{
	new victim = read_data(2);
		AddBonusBox(victim)
	return HAM_IGNORED
}

public CmdStart(id, uc_handle, seed) {
	new ent = fm_find_ent_by_class(id, ClassName)
	if(is_valid_ent(ent)) {
		new classname[32]	
		pev(ent, pev_classname, classname, 31)
		if (equal(classname, ClassName)) {
			
			if (pev(ent, pev_frame) >= 120)
				set_pev(ent, pev_frame, 0.0)
			else
				set_pev(ent, pev_frame, pev(ent, pev_frame) + 1.0)
			
			switch(pev(ent, pev_team))
			{
				case 1: 
				{ 	
				}	
				case 2: 
				{ 
				}
			}
		}
	}
}

public AddBonusBox(id)
{
	if(is_user_connected(id) && cs_get_user_team(id) != CS_TEAM_SPECTATOR) {
		new ent = fm_create_entity("info_target")
		new origin[3]
		get_user_origin(id, origin, 0)
		set_pev(ent,pev_classname, ClassName)
		switch(cs_get_user_team(id))
		{
			case CS_TEAM_T: { 
				engfunc(EngFunc_SetModel,ent, Model[1])
				set_pev(ent,pev_team, 2)
			}
			
			case CS_TEAM_CT: {
				engfunc(EngFunc_SetModel,ent, Model[0])	
				set_pev(ent,pev_team, 1)
			}
		}
		set_pev(ent,pev_mins,Float:{-10.0,-10.0,0.0})
		set_pev(ent,pev_maxs,Float:{10.0,10.0,25.0})
		set_pev(ent,pev_size,Float:{-10.0,-10.0,0.0,10.0,10.0,25.0})
		engfunc(EngFunc_SetSize,ent,Float:{-10.0,-10.0,0.0},Float:{10.0,10.0,25.0})
		
		set_pev(ent,pev_solid,SOLID_BBOX)
		set_pev(ent,pev_movetype,MOVETYPE_TOSS)
		
		new Float:fOrigin[3]
		IVecFVec(origin, fOrigin)
		set_pev(ent, pev_origin, fOrigin)
	}
}

public Touch(toucher, touched)
{
	if (!is_user_alive(toucher) || !pev_valid(touched))
		return FMRES_IGNORED
	
	new classname[32]	
	pev(touched, pev_classname, classname, 31)
	if (!equal(classname, ClassName))
		return FMRES_IGNORED
	
	if(get_user_team(toucher) == pev(touched, pev_team))
	{
		GiveBonus(toucher)
		set_pev(touched, pev_effects, EF_NODRAW)
		set_pev(touched, pev_solid, SOLID_NOT)
		remove_entity(touched);
	}
	return FMRES_IGNORED
}

public event_cur_weapon(id) {
	if(HasSpeed[id] && cs_get_user_team(id) == CS_TEAM_T && get_user_maxspeed(id) < get_pcvar_float(CvarFurienSpeed)) {
		set_user_maxspeed(id, get_pcvar_float(CvarFurienSpeed));
	}
	if(HasSpeed[id] && cs_get_user_team(id) == CS_TEAM_CT && get_user_maxspeed(id) < get_pcvar_float(CvarAntiFurienSpeed)) {
		set_user_maxspeed(id, get_pcvar_float(CvarAntiFurienSpeed));
	}
}

public GiveBonus(id)
{	
	if(cs_get_user_team(id) == CS_TEAM_T) 
	{
		switch (random_num(1,7)) 
		{
			case 1: 
			{
				new Health = 25
				fm_set_user_health(id, get_user_health(id) + Health)
				ColorChat(id, "!t[Furien]!g Ai primit!t viata!g.")
			}
			case 2:
			{
				if(!user_has_weapon(id, CSW_HEGRENADE)) {
					fm_give_item(id, "weapon_hegrenade")
				}
				else {
					cs_set_user_bpammo(id, CSW_HEGRENADE, cs_get_user_bpammo(id, CSW_HEGRENADE) + 1);
				}
				ColorChat(id, "!t[Furien]!g Ai primit o!t grenada HE!g.")
			}
			case 3:
			{
				if(!user_has_weapon(id, CSW_FLASHBANG)) {
					fm_give_item(id, "weapon_flashbang")
				}
				else {
					cs_set_user_bpammo(id, CSW_FLASHBANG, cs_get_user_bpammo(id, CSW_FLASHBANG) + 1);
				}
				ColorChat(id, "!t[Furien]!g Ai primit o!t grenada FB!g.")
			}
			case 4:
			{
				if(!user_has_weapon(id, CSW_SMOKEGRENADE)) {
					fm_give_item(id, "weapon_smokegrenade")
				}
				else {
					cs_set_user_bpammo(id, CSW_SMOKEGRENADE, cs_get_user_bpammo(id, CSW_SMOKEGRENADE) + 1);
				}
				ColorChat(id, "!t[Furien]!g Ai primit o!t grenada SG!g.")
			}
			case 5:
			{
				HasSpeed[id] = true;
				client_cmd(id, "cl_sidespeed %d",get_pcvar_float(CvarFurienSpeed))
				client_cmd(id, "cl_forwardspeed %d",get_pcvar_float(CvarFurienSpeed))
				client_cmd(id, "cl_backspeed %d",get_pcvar_float(CvarFurienSpeed))
				set_user_maxspeed(id, get_pcvar_float(CvarFurienSpeed));
				ColorChat(id, "!t[Furien]!g Ai primit!t viteza!g.")
				
			}
			case 6:
			{
				if(!is_user_admin(id)) {
				HasTeleport[id] = true;
				client_cmd(id, "bind alt power2");
				ColorChat(id, "!t[Furien]!g Ai primit!t puterea de a te putea teleporta.!g.")
				}
				else GiveBonus(id)
			}	
			case 7:
			{
				new Money = 3000
				cs_set_user_money(id, cs_get_user_money(id) + Money)
				ColorChat(id, "!t[Furien]!g Ai primit!t $!g.")
			}
		}
	}
	else
	{
		switch (random_num(1,6)) 
		{
			
			case 1: 
			{
				new Health = 50
				fm_set_user_health(id, get_user_health(id) + Health)
				ColorChat(id, "!t[Furien]!g Ai primit!t viata!g.")
			}
			case 2:
			{
				if(!user_has_weapon(id, CSW_HEGRENADE)) {
					fm_give_item(id, "weapon_hegrenade")
				}
				else {
					cs_set_user_bpammo(id, CSW_HEGRENADE, cs_get_user_bpammo(id, CSW_HEGRENADE) + 1);
				}
				ColorChat(id, "!t[Furien]!g Ai primit o!t grenada HE!g.")
			}
			case 3:
			{
				if(!user_has_weapon(id, CSW_FLASHBANG)) {
					fm_give_item(id, "weapon_flashbang")
				}
				else {
					cs_set_user_bpammo(id, CSW_FLASHBANG, cs_get_user_bpammo(id, CSW_FLASHBANG) + 1);
				}
				ColorChat(id, "!t[Furien]!g Ai primit o!t grenada FB!g.")
			}
			case 4:
			{
				if(!user_has_weapon(id, CSW_SMOKEGRENADE)) {
					fm_give_item(id, "weapon_smokegrenade")
				}
				else {
					cs_set_user_bpammo(id, CSW_SMOKEGRENADE, cs_get_user_bpammo(id, CSW_SMOKEGRENADE) + 1);
				}
				ColorChat(id, "!t[Furien]!g Ai primit o!t grenada SG!g.")
			}
			case 5:
			{
				HasSpeed[id] = true;
				client_cmd(id, "cl_sidespeed %d",get_pcvar_float(CvarAntiFurienSpeed))
				client_cmd(id, "cl_forwardspeed %d",get_pcvar_float(CvarAntiFurienSpeed))
				client_cmd(id, "cl_backspeed %d",get_pcvar_float(CvarAntiFurienSpeed))
				set_user_maxspeed(id, get_pcvar_float(CvarAntiFurienSpeed));
				ColorChat(id, "!t[Furien]!g Ai primit!t viteza!g.")
				
			}
			case 6:
			{
				new Money = 3000
				cs_set_user_money(id, cs_get_user_money(id) + Money)
				ColorChat(id, "!t[Furien]!g Ai primit!t $!g.")
			}
		}
		
	}
	
}


public CmdTeleport(id) {
	if (!is_user_alive(id) || !HasTeleport[id]) return PLUGIN_CONTINUE
	
	if (Teleport_Cooldown[id]) {
		ColorChat(id,"!t[Furien]!g Puterea de a te putea teleporta iti va reveni in!t %d secunde!g.",Teleport_Cooldown[id]);
		return PLUGIN_CONTINUE
	}
	else if (teleport(id)) {
		emit_sound(id, CHAN_STATIC, SOUND_BLINK, 1.0, ATTN_NORM, 0, PITCH_NORM)
		remove_task(id)
		Teleport_Cooldown[id] = get_pcvar_num(CvarTeleportCooldown);
		set_task(1.0, "ShowHUD", id, _, _, "b");
		set_hudmessage(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11);
		if(get_pcvar_num(CvarTeleportCooldown) != 1) {
			show_hudmessage(id, "Puterea de a te putea teleporta iti va reveni in %d secunde.",get_pcvar_num(CvarTeleportCooldown));
		}
		if(get_pcvar_num(CvarTeleportCooldown) == 1) {
			show_hudmessage(id, "Puterea de a te putea teleporta iti va reveni in %d secunda.",get_pcvar_num(CvarTeleportCooldown));
		}
	}
	else {
		ColorChat(id, "!t[Furien]!g Nu te poti teleporta acolo.")
	}
	return PLUGIN_CONTINUE
}

public ShowHUD(id) {
	if (!is_user_alive(id) || !HasTeleport[id]) {
		remove_task(id);
		Teleport_Cooldown[id] = 0;
		return PLUGIN_HANDLED;
	}
	set_hudmessage(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11);
	if(is_user_alive(id) && Teleport_Cooldown[id] == 1) {
		Teleport_Cooldown[id] --;
		show_hudmessage(id, "Puterea de a te putea teleporta iti va reveni in %d secunda.",Teleport_Cooldown[id]);
	}
	if(is_user_alive(id) && Teleport_Cooldown[id] > 1) {
		Teleport_Cooldown[id] --;
		show_hudmessage(id, "Puterea de a te putea teleporta iti va reveni in %d secunde.",Teleport_Cooldown[id]);
	}
	if(Teleport_Cooldown[id] <= 0) {
		show_hudmessage(id, "Ti-a revenit puterea");
		ColorChat(id,"!t[Furien]!g Poti folosii din nou puterea de a te putea teleporta.");
		remove_task(id);
		Teleport_Cooldown[id] = 0;
	}
	return PLUGIN_HANDLED;
}


bool:teleport(id) {
	new Float:vOrigin[3], Float:vNewOrigin[3],
	Float:vNormal[3], Float:vTraceDirection[3],
	Float:vTraceEnd[3];
	
	pev(id, pev_origin, vOrigin);
	
	velocity_by_aim(id, get_pcvar_num(CvarTeleportRange), vTraceDirection);
	xs_vec_add(vTraceDirection, vOrigin, vTraceEnd);
	
	engfunc(EngFunc_TraceLine, vOrigin, vTraceEnd, DONT_IGNORE_MONSTERS, id, 0);
	
	new Float:flFraction;
	get_tr2(0, TR_flFraction, flFraction);
	if (flFraction < 1.0) {
		get_tr2(0, TR_vecEndPos, vTraceEnd);
		get_tr2(0, TR_vecPlaneNormal, vNormal);
	}
	
	xs_vec_mul_scalar(vNormal, 40.0, vNormal); // do not decrease the 40.0
	xs_vec_add(vTraceEnd, vNormal, vNewOrigin);
	
	if (is_player_stuck(id, vNewOrigin))
		return false;
	
	emit_sound(id, CHAN_STATIC, SOUND_BLINK, 1.0, ATTN_NORM, 0, PITCH_NORM);
	tele_effect(vOrigin);
	
	engfunc(EngFunc_SetOrigin, id, vNewOrigin);
	
	tele_effect2(vNewOrigin);
	
	if(is_user_connected(id)) {
		UTIL_ScreenFade(id, get_color(CvarColor), get_pcvar_float(CvarFadeTime), get_pcvar_float(CvarFadeTime), 75)
	}
	return true;
}

stock is_player_stuck(id, Float:originF[3]) {
	engfunc(EngFunc_TraceHull, originF, originF, 0, (pev(id, pev_flags) & FL_DUCKING) ? HULL_HEAD : HULL_HUMAN, id, 0);
	
	if (get_tr2(0, TR_StartSolid) || get_tr2(0, TR_AllSolid) || !get_tr2(0, TR_InOpen))
		return true;
	
	return false;
}

stock tele_effect(const Float:torigin[3]) {
	new origin[3];
	origin[0] = floatround(torigin[0]);
	origin[1] = floatround(torigin[1]);
	origin[2] = floatround(torigin[2]);
	
	message_begin(MSG_PAS, SVC_TEMPENTITY, origin);
	write_byte(TE_BEAMCYLINDER);
	write_coord(origin[0]);
	write_coord(origin[1]);
	write_coord(origin[2]+10);
	write_coord(origin[0]);
	write_coord(origin[1]);
	write_coord(origin[2]+60);
	write_short(Sprite);
	write_byte(0);
	write_byte(0);
	write_byte(3);
	write_byte(60);
	write_byte(0);
	write_byte(255);
	write_byte(255);
	write_byte(255);
	write_byte(255);
	write_byte(0);
	message_end();
}

stock tele_effect2(const Float:torigin[3]) {
	new origin[3];
	origin[0] = floatround(torigin[0]);
	origin[1] = floatround(torigin[1]);
	origin[2] = floatround(torigin[2]);
	
	message_begin(MSG_PAS, SVC_TEMPENTITY, origin);
	write_byte(TE_BEAMCYLINDER);
	write_coord(origin[0]);
	write_coord(origin[1]);
	write_coord(origin[2]+10);
	write_coord(origin[0]);
	write_coord(origin[1]);
	write_coord(origin[2]+60);
	write_short(Sprite);
	write_byte(0);
	write_byte(0);
	write_byte(3);
	write_byte(60);
	write_byte(0);
	write_byte(255);
	write_byte(255);
	write_byte(255);
	write_byte(255);
	write_byte(0);
	message_end();
	
	message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
	write_byte(TE_SPRITETRAIL);
	write_coord(origin[0]);
	write_coord(origin[1]);
	write_coord(origin[2]+40);
	write_coord(origin[0]);
	write_coord(origin[1]);
	write_coord(origin[2]);
	write_short(Sprite2);
	write_byte(30);
	write_byte(10);
	write_byte(1);
	write_byte(50);
	write_byte(10);
	message_end();
}	

get_color(pcvar) {
	new iColor[3], szColor[10]
	get_pcvar_string(pcvar, szColor, charsmax(szColor))
	new c = str_to_num(szColor)
	
	iColor[Red] = c / 1000000
	c %= 1000000
	iColor[Green] = c / 1000
	iColor[Blue] = c % 1000
	
	return iColor
}

stock FixedUnsigned16(Float:flValue, iScale) {
	new iOutput;
	
	iOutput = floatround(flValue * iScale);
	if ( iOutput < 0 )
		iOutput = 0;
	
	if ( iOutput > 0xFFFF )
		iOutput = 0xFFFF;
	return iOutput;
}

stock UTIL_ScreenFade(id=0,iColor[3]={0,0,0},Float:flFxTime=-1.0,Float:flHoldTime=0.0,iAlpha=0,iFlags=FFADE_IN,bool:bReliable=false,bool:bExternal=false) {
	if( id && !is_user_connected(id))
		return;
	
	new iFadeTime;
	if( flFxTime == -1.0 ) {
		iFadeTime = 4;
	}
	else {
		iFadeTime = FixedUnsigned16( flFxTime , 1<<12 );
	}
	
	static gmsgScreenFade;
	if( !gmsgScreenFade ) {
		gmsgScreenFade = get_user_msgid("ScreenFade");
	}
	
	new MSG_DEST;
	if( bReliable ) {
		MSG_DEST = id ? MSG_ONE : MSG_ALL;
	}
	else {
		MSG_DEST = id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST;
	}
	
	if( bExternal ) {
		emessage_begin( MSG_DEST, gmsgScreenFade, _, id );
		ewrite_short( iFadeTime );
		ewrite_short( FixedUnsigned16( flHoldTime , 1<<12 ) );
		ewrite_short( iFlags );
		ewrite_byte( iColor[Red] );
		ewrite_byte( iColor[Green] );
		ewrite_byte( iColor[Blue] );
		ewrite_byte( iAlpha );
		emessage_end();
	}
	else {
		message_begin( MSG_DEST, gmsgScreenFade, _, id );
		write_short( iFadeTime );
		write_short( FixedUnsigned16( flHoldTime , 1<<12 ) );
		write_short( iFlags );
		write_byte( iColor[Red] );
		write_byte( iColor[Green] );
		write_byte( iColor[Blue] );
		write_byte( iAlpha );
		message_end();
	}
}

stock UTIL_FadeToBlack(id,Float:fxtime=3.0,bool:bReliable=false,bool:bExternal=false) {
	UTIL_ScreenFade(id, _, fxtime, fxtime, 255, FFADE_OUT|FFADE_STAYOUT,bReliable,bExternal);
}

public Light(entity, red, green, blue)
{	
	if(is_valid_ent(entity)) {
		static Float:origin[3]
		pev(entity, pev_origin, origin)
		
		message_begin(MSG_BROADCAST, SVC_TEMPENTITY, _, entity);
		write_byte(TE_DLIGHT) // TE id
		engfunc(EngFunc_WriteCoord, origin[0])
		engfunc(EngFunc_WriteCoord, origin[1])
		engfunc(EngFunc_WriteCoord, origin[2])
		write_byte(7) 
		write_byte(red)
		write_byte(green)
		write_byte(blue)
		write_byte(2)
		write_byte(0)
		message_end();
	}
}

stock ColorChat(const id, const input[], any:...) {
	new count = 1, players[32];
	static msg[191];
	vformat(msg, 190, input, 3);
	
	replace_all(msg, 190, "!g", "^4");
	replace_all(msg, 190, "!y", "^1");
	replace_all(msg, 190, "!t", "^3");
	
	if(id) players[0] = id;
	else get_players(players, count, "ch"); {
		for(new i = 0; i < count; i++) {
			if(is_user_connected(players)) {
				message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players);
				write_byte(players);
				write_string(msg);
				message_end();
			}
		}
	} 
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
Post Reply

Return to “Cereri”

  • Information