afk time - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: afk time (
/showthread.php?tid=621937)
afk time -
StR_MaRy - 16.11.2016
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 ?
Re: afk time -
DTV - 16.11.2016
Did you test it?
Re: afk time -
StR_MaRy - 16.11.2016
yes and it gives me the hour played and i changed the labels but still same
Re: afk time -
DTV - 16.11.2016
Did you test it under an admin account that's over level 3?
Re: afk time -
StR_MaRy - 16.11.2016
yes man
Re: afk time -
DTV - 16.11.2016
And you're saying the hours played still doesn't change even though your admin level is over 3?
Re: afk time -
StR_MaRy - 16.11.2016
yes man .....
Re: afk time -
Konstantinos - 16.11.2016
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.
Re: afk time -
StR_MaRy - 16.11.2016
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?