Spectate: Only strip knifes

After further testing, other weapons seem to be dropped.
This commit is contained in:
zaCade 2019-07-28 11:59:57 +02:00
parent 0c4fa9bc67
commit 723471ff6f

View File

@ -107,7 +107,7 @@ public Action Command_Spectate(int client, int argc)
Call_PushCell(client);
Call_Finish();
StripPlayerWeapons(client);
StripPlayerKnifes(client);
ForcePlayerSuicide(client);
ChangeClientTeam(client, CS_TEAM_SPECTATOR);
}
@ -137,7 +137,7 @@ public Action Command_Spectate(int client, int argc)
Call_PushCell(client);
Call_Finish();
StripPlayerWeapons(client);
StripPlayerKnifes(client);
ForcePlayerSuicide(client);
ChangeClientTeam(client, CS_TEAM_SPECTATOR);
}
@ -206,19 +206,16 @@ stock int GetTeamAliveClientCount(int iTeam)
return ret;
}
stock void StripPlayerWeapons(int client)
stock void StripPlayerKnifes(int client)
{
for(int i = 0; i < 5; i++)
{
int w = -1;
int w = -1;
while ((w = GetPlayerWeaponSlot(client, i)) != -1)
while ((w = GetPlayerWeaponSlot(client, CS_SLOT_KNIFE)) != -1)
{
if(IsValidEntity(w) && IsValidEdict(w))
{
if(IsValidEntity(w) && IsValidEdict(w))
{
RemovePlayerItem(client, w);
AcceptEntityInput(w, "Kill");
}
RemovePlayerItem(client, w);
AcceptEntityInput(w, "Kill");
}
}
}