diff --git a/Spectate/scripting/Spectate.sp b/Spectate/scripting/Spectate.sp index 6c51462..0ef1323 100644 --- a/Spectate/scripting/Spectate.sp +++ b/Spectate/scripting/Spectate.sp @@ -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"); } } } \ No newline at end of file