PremyslTalich / TeamGames

Sourcemod plugin providing team based games for prisoners and some useful things for wardens.
17 stars 13 forks source link

Client 17 is not in game -- IsPlayerAlive -- Command_BindAction #38

Open SHAREN opened 8 years ago

SHAREN commented 8 years ago
[SM] Exception reported: Client 17 is not in game
[SM] Blaming: TeamGames/TeamGames.smx
[SM] Call stack trace:
[SM]   [0] IsPlayerAlive
[SM]   [1] Line 5, Commands.sp::Command_BindAction
SHAREN commented 8 years ago

from smlib

stock bool:Client_IsValid(client, bool:checkConnected=true)
{
    if (client > 4096) 
        client = EntRefToEntIndex(client);
    if (client < 1 || client > MaxClients) 
        return false;
    if (checkConnected && !IsClientConnected(client)) 
        return false;
    return true;
}

from Commands.sp::Command_BindAction

    if (!Client_IsValid(iClient, true) || !IsPlayerAlive(iClient) || GetClientTeam(iClient) != CS_TEAM_CT) {
        return Plugin_Continue;
    }

I think need || !IsClientInGame(iClient)