30.12.2010, 13:27
Hello, I have this piece of code:
And if my server has been on for 10.5 seconds, i get 10500 when i type the command. (I know its milliseconds.)
And if i do this instead:
format(timestr, sizeof(timestr), "%d", uptimeex/1000);
I get 105.
Wich i want to change to 10.5, any idea how to do this?
pawn Код:
//Above GameModeInit
new Uptime:
//OnGameModeInit:
Uptime = GetTickCount();
//In a command
{
new timestr[20], uptimeex;
uptimeex = GetTickCount() - Uptime;
format(timestr, sizeof(timestr), "%d", uptimeex);
SendClientMessage(playerid, 0xFFFFFFFF, timestr);
return 1;
}
And if i do this instead:
format(timestr, sizeof(timestr), "%d", uptimeex/1000);
I get 105.
Wich i want to change to 10.5, any idea how to do this?