How can i stop players from using or picking up weapons off the ground? I want to create a plugin that will force players to knife their last kill on my deathmatch server.
EDIT: I found this script which blocks players from picking up weapons, im just struggling to find out how to strip all weapons except knife on every spawn. Code below
PHP Code:
public OnClientPutInServer(client)
{
SDKHook(client, SDKHook_WeaponEquip, OnWeaponEquip)
}
public OnClientDisconnect(client)
{
if ( IsClientInGame(client) )
{
SDKUnhook(client, SDKHook_WeaponEquip, OnWeaponEquip)
}
}
public Action:OnWeaponEquip(client, weapon)
{
decl String:sWeapon[32];
GetEdictClassname(weapon, sWeapon, sizeof(sWeapon));
if( !StrEqual(sWeapon, "weapon_knife") )
{
if( Player_Team[client] == CS_TEAM_T )
{
return Plugin_Handled;
}
}
return Plugin_Continue;
}
Is this the right code for blocking weapon pickup?
__________________