diff --git a/addons/sourcemod/scripting/autopause.sp b/addons/sourcemod/scripting/autopause.sp index fbd289908..55a31ac9d 100644 --- a/addons/sourcemod/scripting/autopause.sp +++ b/addons/sourcemod/scripting/autopause.sp @@ -242,7 +242,7 @@ void Event_PlayerDisconnect(Event hEvent, char[] sEventName, bool dontBroadcast) if (!teamPlayers.ContainsKey(sAuthId)) return; - if (GetClientTeam(client) == L4D_TEAM_SURVIVOR && !IsPlayerAlive(client)) + if (IsClientInGame(client) && GetClientTeam(client) == L4D_TEAM_SURVIVOR && !IsPlayerAlive(client)) { if (convarDebug.BoolValue) { diff --git a/addons/sourcemod/scripting/bequiet.sp b/addons/sourcemod/scripting/bequiet.sp index befeb6dc5..f48840287 100644 --- a/addons/sourcemod/scripting/bequiet.sp +++ b/addons/sourcemod/scripting/bequiet.sp @@ -68,7 +68,7 @@ Action TeamSay_Callback(int client, char[] command, int args) return Plugin_Handled; } - if (bSpecSeeChat && GetClientTeam(client) != 1) + if (bSpecSeeChat && IsValidClient(client) && GetClientTeam(client) != 1) { char sChat[256]; GetCmdArgString(sChat, 256); diff --git a/addons/sourcemod/scripting/l4d2_ghost_warp.sp b/addons/sourcemod/scripting/l4d2_ghost_warp.sp index b300f9eed..00d6070dc 100644 --- a/addons/sourcemod/scripting/l4d2_ghost_warp.sp +++ b/addons/sourcemod/scripting/l4d2_ghost_warp.sp @@ -112,7 +112,8 @@ Action Cmd_WarpToSurvivor(int iClient, int iArgs) return Plugin_Handled; } - if (GetClientTeam(iClient) != L4D2Team_Infected + if (!IsClientInGame(iClient) + || GetClientTeam(iClient) != L4D2Team_Infected || GetEntProp(iClient, Prop_Send, "m_isGhost", 1) < 1 || !IsPlayerAlive(iClient) ) { @@ -225,7 +226,8 @@ void Hook_OnPostThinkPost(int iClient) return; } - if (GetClientTeam(iClient) != L4D2Team_Infected + if (!IsClientInGame(iClient) + || GetClientTeam(iClient) != L4D2Team_Infected || GetEntProp(iClient, Prop_Send, "m_isGhost", 1) < 1 || !IsPlayerAlive(iClient) ) { diff --git a/addons/sourcemod/scripting/playermanagement.sp b/addons/sourcemod/scripting/playermanagement.sp index c2b147996..2ac428bb7 100644 --- a/addons/sourcemod/scripting/playermanagement.sp +++ b/addons/sourcemod/scripting/playermanagement.sp @@ -560,6 +560,10 @@ stock int GetPummelQueueAttacker(int client) stock L4D2Team GetClientTeamEx(int client) { + if (!IsClientInGame(client)) + { + return L4D2Team_None; + } return view_as(GetClientTeam(client)); } diff --git a/addons/sourcemod/scripting/readyup/player.inc b/addons/sourcemod/scripting/readyup/player.inc index 1af0de784..a21fc661f 100644 --- a/addons/sourcemod/scripting/readyup/player.inc +++ b/addons/sourcemod/scripting/readyup/player.inc @@ -98,8 +98,8 @@ void SetClientFrozen(int client, bool freeze) bool IsPlayer(int client) { - int team = GetClientTeam(client); - return (team == L4D2Team_Survivor || team == L4D2Team_Infected); + return IsClientInGame(client) && IsClientConnected(client) + && (GetClientTeam(client) == L4D2Team_Survivor || GetClientTeam(client) == L4D2Team_Infected); } void ReturnPlayerToSaferoom(int client, bool flagsSet = true)