11.08.2012, 12:03
I run this on a 10 second timer
And this is my OnPlayerUpdate
When I go AFK, the 3D label isn't shown :/
pawn Код:
AFK[playerid] += 1;
if(AFK[playerid] > 1)
{
if(AFK[playerid] > 2)
{
new str[25];format(str, 25, "AFK (%d seconds)", AFK[playerid]*10);
Update3DTextLabelText(AFKlabel[playerid], 0xFF000000, str);
return 1;
}
if(AFK[playerid] >= 120)
{
KickPlayer(playerid,"SYSTEM","AFK");
return 1;
}
else
{
AFKlabel[playerid] = Create3DTextLabel("AFK (20 seconds)", 0xFF000000, 30.0, 40.0, 50.0, 40.0, 0, 0);
Attach3DTextLabelToPlayer(AFKlabel[playerid], playerid, 0.0, 0.0, 0.5);
}
}
pawn Код:
public OnPlayerUpdate(playerid)
{
if(AFK[playerid] > 1)
{
Delete3DTextLabel(AFKlabel[playerid]);
}
AFK[playerid] = 0;
}