27.12.2016, 17:09
PHP код:
format(string, sizeof(string), ""SERVERBLUE"[ AFK ]\n"WHITE"Time: %d:%d:%d", hours, minutes, seconds);
AFKLabel[i] = CreateDynamic3DTextLabel(string, 0x1D9F00AA, X, Y, Z+1, 10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 20.0);
Here is the func
PHP код:
forward AFKtimer();
public AFKtimer()
{
foreach(new i: Player)
{
new Float:X, Float:Y, Float:Z, string[90], hours = 0, minutes = 0, seconds = 0;
GetPlayerPos(i, X, Y, Z);
seconds++;
if(seconds == 60)
{
minutes ++;
seconds = 0;
}
else if(minutes == 60)
{
hours ++;
minutes = 0;
seconds = 0;
}
format(string, sizeof(string), ""SERVERBLUE"[ AFK ]\n"WHITE"Time: %d", seconds);
AFKLabel[i] = CreateDynamic3DTextLabel(string, 0x1D9F00AA, X, Y, Z+1, 10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 20.0);
return 1;
}
return 1;
}