afk time
#1

hey guys i have a afk system but on payday i want to give them if they are afk only respect and not hoursplayed

Код HTML:
if(IsAfk[i] == 1 && AFK[i] != 1 && PlayerInfo[i][pAdmin] < 3)
			{
				PlayerInfo[i][pRespect] += 1;
				Update(i,pRespectx);
			}
			else
			{
			    PlayerInfo[i][pRespect] += 1;
				Update(i,pRespectx);
			    PlayerInfo[i][pHoursPlayed] += 1;
				Update(i,pHoursPlayedx);
			}
this is ok ?
Reply
#2

Did you test it?
Reply
#3

yes and it gives me the hour played and i changed the labels but still same
Reply
#4

Did you test it under an admin account that's over level 3?
Reply
#5

yes man
Reply
#6

And you're saying the hours played still doesn't change even though your admin level is over 3?
Reply
#7

yes man .....
Reply
#8

Debugging always helps you figure out why the code didn't work as expected. Print the values of IsAfk[i], AFK[i] and PlayerInfo[i][pAdmin] and see for yourself where the mistake lies.
Reply
#9

but here is working ... and is the same script

Код HTML:
function IdleKick()
{
    new nr = 0;
	foreach(new i : Player) nr ++;

 	foreach(new i : Player)
	{
		if(IsAfk[i] == 1 && AFK[i] != 1 && PlayerInfo[i][pLevel] > 1 && PlayerInfo[i][pJailed] == 0 && PlayerInfo[i][pAdmin] < 4)
		{
			AFKMins[i]++;
			if( AFKMins[i] >= AFKTime )
   			{
				format(gString, sizeof(gString), "%s a primit kick de la AdmBot, motiv: AFK fara sleep mai mult de %d minute.", GetName(i), AFKTime);
				SendClientMessageToAll(COLOR_LIGHTRED, gString);
				Kick(i);
			}
		}
	}
	return 1;
}
i get that message when
Код HTML:
if( AFKMins[i] >= AFKTime )
but over there isn't working on payday ... why?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)