•  
     

ajude nesta sma



me ajude nesta sma eu uso ela como csdm so pra renascer o jogador para mapas awp_india o ruim e que ela nao remove as armas que cai no cão e fica cheio de arma no chao quero remover arma depois de 3 segundos

Código: Selecionar todos

#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <engine>
#include <fakemeta>

new cvar_enabled, cvar_hp, cvar_hp_hs, cvar_gamename, amx_gamename

public plugin_init()
{
	register_plugin("ClaN Brasilia DeathMatch", "1.1", "Lucky")
	
	register_event("DeathMsg", "on_Death", "a")
	register_event("CurWeapon", "knife", "b")
	
	cvar_enabled = register_cvar("amx_knifedm", "1")
	cvar_hp = register_cvar("amx_knifedm_hp", "10")
	cvar_hp_hs = register_cvar("amx_knifedm_hp_hs", "25")
	cvar_gamename = register_cvar("amx_knifedm_gamename", "0")

	if(get_pcvar_num(cvar_gamename) == 1)
	{
		amx_gamename = register_cvar("amx_gamename", "Knife DM" )
		register_forward(FM_GetGameDescription, "GameDesc")
	}
	
	if(get_pcvar_num(cvar_enabled) == 0)
	{
		remove_entity_name("func_bomb_target")
		remove_entity_name("info_bomb_target")
		remove_entity_name("hostage_entity")
		remove_entity_name("func_hostage_rescue")
		remove_entity_name("info_hostage_rescue")
		remove_entity_name("info_vip_start")
		remove_entity_name("func_vip_safetyzone")
		remove_entity_name("func_escapezone")
		
		removeweapons()
		
		server_cmd("sv_restart 2")
	}
}

public knife(id)
{
	if(get_pcvar_float(cvar_enabled) == 0)
	{
        new clip, ammo
        new usersweapon = get_user_weapon(id, clip, ammo)

        if(usersweapon == CSW_KNIFE)
		{
			return PLUGIN_CONTINUE
		}
		else
		{
			new origin[3]
			get_user_origin (id, origin)
			origin[2] -= 500
			set_user_origin (id, origin)
			new iwpn, iwpns[32], nwpn[32]
			get_user_weapons (id, iwpns, iwpn)
			for (new a = 0; a < iwpn; ++a)
			{
				get_weaponname (iwpns[a], nwpn, 31)
				engclient_cmd (id, "drop", nwpn)
			}
			origin[2] += 500
			set_user_origin (id, origin)

			client_cmd (id, "weapon_knife")
        }
    }
	return PLUGIN_CONTINUE
}

public on_Death()
{
	if(get_pcvar_float(cvar_enabled) == 1)
	{
		new id = read_data(2)
		set_task(1.0, "spawn_user", id)
	}
}

public spawn_user(id)
{
	if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
	{
		return PLUGIN_HANDLED
	}
	
	ExecuteHamB(Ham_CS_RoundRespawn, id)
	return PLUGIN_HANDLED
}

public client_death(killer, victim, wpnindex, hitplace, TK)
{
	if(get_pcvar_float(cvar_enabled) == 1)
	{
		if(hitplace == HIT_HEAD)
		{
			set_user_health(killer, get_user_health(killer) + get_pcvar_num(cvar_hp_hs))
			
			set_hudmessage(255, 0, 0, 0.1, -1.0, 0, 6.0, 10.0)
			show_hudmessage(killer, "HeadShot")
		}
		else
		{
			set_user_health(killer, get_user_health(killer) + get_pcvar_num(cvar_hp))
		}
	}
}

public client_connect(id)
{
	if(get_pcvar_num(cvar_enabled) == 1)
	{
		set_task(20.0, "connect_ads", id)
	}
}

public connect_ads(id)
{
	client_print(id, print_chat, "ClaN Brasilia modo DeathMatch!")
	client_print(id, print_chat, "")
}

public GameDesc()
{
	static gamename[32]
	get_pcvar_string(amx_gamename, gamename, 31)
	forward_return(FMV_STRING, gamename)
	return FMRES_SUPERCEDE
}

removeweapons()
{
	new weapon, nnumr
	
	while ((weapon = find_ent_by_class(-1,"armoury_entity")))
	{
		remove_entity(weapon)
		nnumr++
	}
}
Página inicial