Hello
Why it doesn't work?
Code:
public LastRequest_PlayerDisconnect(Handle:event, const String:name[], bool:dontBroadcast)
{
new iArraySize = GetArraySize(gH_DArray_LR_Partners);
if(iArraySize > 0)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
for(new idx = 0; idx < GetArraySize(gH_DArray_LR_Partners); idx++)
{
new LR_Player_Prisoner = GetArrayCell(gH_DArray_LR_Partners, idx, _:Block_Prisoner);
new LR_Player_Guard = GetArrayCell(gH_DArray_LR_Partners, idx, _:Block_Guard);
if(client == LR_Player_Prisoner || client == LR_Player_Guard)
{
CleanupLastRequest(client, idx);
RemoveFromArray(gH_DArray_LR_Partners, idx);
PrintToChatAll(CHAT_BANNER, "LR Player Disconnect", client);
}
}
}
new Ts, CTs, NumCTsAvailable;
UpdatePlayerCounts(Ts, CTs, NumCTsAvailable);
if(gShadow_LR_AutoDisplay && gShadow_LR_Enable && (Ts > 0) && (NumCTsAvailable > 0) && (Ts <= gShadow_MaxPrisonersToLR))
{
for(new idx = 1; idx <= MaxClients; idx++)
{
if(IsClientInGame(idx) && IsPlayerAlive(idx) && GetClientTeam(idx) == CS_TEAM_T && !g_bIsARebel[idx])
{
FakeClientCommand(idx, "sm_lr");
}
}
}
if(gShadow_LR_Enable)
{
if(!g_bAnnouncedThisRound)
{
if((Ts == gShadow_MaxPrisonersToLR) && (NumCTsAvailable > 0) && (Ts > 0) && GameRules_GetProp("m_bWarmupPeriod") == 0)
{
Call_StartForward(gH_Frwd_LR_Available);
Call_PushCell(gShadow_Announce_LR);
new ignore;
Call_Finish(_:ignore);
if(gShadow_Announce_LR)
{
PrintToChatAll(CHAT_BANNER, "LR Available");
if((strlen(gShadow_LR_Sound) > 0) && !StrEqual(gShadow_LR_Sound, "-1"))
{
EmitSoundToAllAny(gShadow_LR_Sound);
}
}
}
g_bAnnouncedThisRound = true;
}
}
}
It should check players when somebody disconnected..
__________________