Spectate: Only strip knifes
After further testing, other weapons seem to be dropped.
This commit is contained in:
parent
0c4fa9bc67
commit
723471ff6f
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user