Offline player help
#1

Hello all
I have this system to check if player is AFK(that clock symbol above his head)
If he is AFK(...) PlayerInfo[i][AFK] = 0;
When he is back PlayerInfo[i][AFK] = 1;
Why it doesn't work ?

Problem is that it doesn't shift from 0 to 1 or from 1 to 0
My timer for " UpdatePlayerStatus " is 1 second
PHP код:

new PlayerTick[MAX_PLAYERS];
function 
UpdatePlayerStatus(playerid)
{
CheckAFK();
//MY OTHER STUFF
//MY OTHER STUFF
//MY OTHER STUFF
//MY OTHER STUFF....
return 1;
}
function 
CheckAFK()
{
foreach(new 
Player)
{
new 
Tick;
Tick GetTickCount();
if((
Tick PlayerTick[i]) > 750)
{
if(
PlayerInfo[i][AFK] == 0)
{
PlayerInfo[i][AFK] = 1;
}
}
else
{
if(
PlayerInfo[i][AFK] == 1)
{
PlayerInfo[i][AFK] = 0;
}
}
}
return 
1;

Reply


Messages In This Thread
Offline player help - by kalanerik99 - 14.07.2015, 09:29
Re: Offline player help - by HarrisonC - 14.07.2015, 09:39
Re: Offline player help - by kalanerik99 - 14.07.2015, 12:35
Re: Offline player help - by Virtual1ty - 14.07.2015, 15:13
Re: Offline player help - by kalanerik99 - 14.07.2015, 17:16
Re: Offline player help - by Virtual1ty - 14.07.2015, 17:23

Forum Jump:


Users browsing this thread: 4 Guest(s)