19.11.2017, 14:12
I'm using Emmet callbacks include so I can get function for player being paused and count his time.
Now I'm trying to convert miliseconds to seconds and later to minutes and hours but I keep getting same ammount of miliseconds ingame.
Now I'm trying to convert miliseconds to seconds and later to minutes and hours but I keep getting same ammount of miliseconds ingame.
PHP код:
public OnPlayerPause(playerid)
{
new ps, pms;
pms = GetPlayerPausedTime(playerid);
ps = pms / 1000;
new Text3D:label = Create3DTextLabel("PAUSED", 0x888888FF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
format(string, 100, "* %s was afk (%dseconds).", GetName(playerid), ps);
SendClientMessageToAll(COLOR_DEBUGMSG, string);
return 1;
}
public OnPlayerResume(playerid, time)
{
new ps, pms;
pms = GetPlayerPausedTime(playerid);
ps = pms / 1000;
if(!IsPlayerPaused(playerid))
Delete3DTextLabel(pausedlabel[playerid]);
new string[100];
format(string, 100, "* %s was afk (%dseconds).", GetName(playerid), ps);
SendClientMessageToAll(COLOR_DEBUGMSG, string);
return 1;
}