Automatic function depending on the connected people.
#1

Hi people! I'm trying to create a function (called by a timer) which "scan" if some user with X variable is connected and if it is make an action and if it is not, make another action. I think I haven't meant properly... I did something like this but it didn't work, can you help me?? Sorry for my bad English :S

Код:
new PlayerCount;
function ActivarAntiAFK()
{
 		for (new i = 0; i < GetMaxPlayers(); i++)
        {
            if(IsPlayerConnected(i))
            {
                #if defined ADMINSONLNE
            	if(PlayerInfo[i][AdminMC] == 0))
            	{
					SendRconCommand("loadfs antiafk");
            	}
            	else if(PlayerInfo[i][AdminMC] !=0)
            	{
					SendRconCommand("unloadfs antiafk");
            	}
            	#endif
            	PlayerCount++;
            }
        }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)