okay...
This will remove all weapons from map and players. Then give them knives.
Edit code how you like it.
PHP Code:
#include <sdktools>
public OnPluginStart()
{
HookEventEx("round_start", event, EventHookMode_PostNoCopy);
}
public event(Handle:event, const String:event_name[], bool:dontBroadcast)
{
CreateTimer(0.1, delay, _, TIMER_FLAG_NO_MAPCHANGE);
}
public Action:delay(Handle:timer)
{
new ent = MaxClients+1;
new iState, owner;
while( (ent = FindEntityByClassname(ent, "weapon_*")) != -1 )
{
if( (iState = GetEntProp(ent, Prop_Send, "m_iState")) == 0) // Weapons that no one carry.
{
AcceptEntityInput(ent, "kill");
}
else if(iState == 1) // Weapons that players carry in their pockets
{
AcceptEntityInput(ent, "kill");
}
else if(iState == 2) // Weapons that players equip in their Hands
{
owner = GetEntPropEnt(ent, Prop_Send, "m_hOwner");
AcceptEntityInput(ent, "kill");
if(0 < owner <= MaxClients)
{
CreateTimer(0.1, givesomething, GetClientUserId(owner), TIMER_FLAG_NO_MAPCHANGE);
}
}
}
}
public Action:givesomething(Handle:timer, any:userid)
{
new client = GetClientOfUserId(userid);
if(client != 0 && IsClientInGame(client) && GetClientTeam(client) >= 2 && IsPlayerAlive(client))
{
GivePlayerItem(client, "weapon_knife");
}
}
__________________