Tell me how to Automatically deny a knife in General,the special Forces, that he would be with the new Spawn hasn't even shown up?Here in this Code, the Knife can only be manually thrown and it starts when you spawn.
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "Knife Drop"
#define AUTHOR "Alucard"
#define VERSION "1.0"
new p_Type
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("knife_drop", VERSION,FCVAR_SERVER|FCVAR_SPONLY)
RegisterHam(Ham_CS_Item_CanDrop, "weapon_knife", "KnifeDrop")
register_clcmd("drop", "HookCmdDrop")
p_Type = register_cvar("kd_type", "1")
}
public KnifeDrop(ent)
{
if(get_pcvar_num(p_Type) == 1)
SetHamReturnInteger(1)
return HAM_SUPERCEDE
}
public HookCmdDrop(id)
{
if(get_user_team(id) == 2 && get_user_weapon(id) == CSW_KNIFE)
{
if(get_pcvar_num(p_Type) == 1)
{
ham_strip_weapon(id, "weapon_knife")
return PLUGIN_HANDLED
}
}
return PLUGIN_CONTINUE
}
stock ham_strip_weapon(id,weapon[])
{
if(!equal(weapon,"weapon_",7) ) return 0
new wId = get_weaponid(weapon)
if(!wId) return 0
new wEnt
while( (wEnt = engfunc(EngFunc_FindEntityByString,wEnt,"classname",weapon) ) && pev(wEnt,pev_owner) != id) {}
if(!wEnt) return 0
if(get_user_weapon(id) == wId) ExecuteHamB(Ham_Weapon_RetireWeapon,wEnt)
if(!ExecuteHamB(Ham_RemovePlayerItem,id,wEnt) ) return 0
ExecuteHamB(Ham_Item_Kill,wEnt)
set_pev(id,pev_weapons,pev(id,pev_weapons) & ~(1<<wId) )
return 1
}