I started writing a JailBreak mod code. But I have a problem in the second round my knife on foot. I want to be deleted, I mention that in the first round everything works correctly
Sorry for bad English.
PHP Code:
// ON PLAYER SPAWN
public Action Event_PlayerSpawn(Event event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(GetEventInt(event, "userid"));
int weapon;
for(int i = 0; i < 5; i++)
{
if((weapon = GetPlayerWeaponSlot(client, i)) != -1)
{
SDKHooks_DropWeapon(client, weapon, NULL_VECTOR, NULL_VECTOR);
AcceptEntityInput(weapon, "Kill");
}
}
if(GetClientTeam(client) == 2)
{
iMelee = GivePlayerItem(client, "weapon_fists");
EquipPlayerWeapon(client, iMelee);
}
if(GetClientTeam(client) == 3)
{
iMelee = GivePlayerItem(client, "weapon_knife_m9_bayonet");
EquipPlayerWeapon(client, iMelee);
}
}