Time(hours,minutes,seconds)
#1

I'm using some saved variables that save the player's hours,minutes and seconds while playing in server
and i made it in /stats so players can see their playing time.
but the playing time appears like numbers.
Example: 2:3:40 [2 Hours,3 Minutes and 40 Seconds]
I want it to appear like 02:03:40.

I use for example
Код:
format(string,sizeof(string),"Playing Time: %d:%d:%d",hours[playerid],mins[playerid],secs[playerid]);
SendClientMessage(playerid,-1,string);
Reply
#2

PHP код:
format(string,sizeof(string),"Playing Time: %02d:%02d:%02d",hours[playerid],mins[playerid],secs[playerid]); 
Reply
#3

Thanks, and another question I save the date the player joined how to make it like the example i wrote up.
The Example:
Код:
format(string,sizeof(string),"Date Joined: %d"datejoined[playerid]);
SendClientMessage(playerid,-1,string);
like it should show any date like 21/05/2016.
Reply
#4

Quote:
Originally Posted by Problems
Посмотреть сообщение
Thanks, and another question I save the date the player joined how to make it like the example i wrote up.
The Example:
Код:
format(string,sizeof(string),"Date Joined: %d"datejoined[playerid]);
SendClientMessage(playerid,-1,string);
like it should show any date like 21/05/2016.
Save it with string or another integer for day/month/year . And will be like this:
PHP код:
format(string,sizeof(string),"Date Joined: %d/%d/%d",datejoinedday[playerid], datejoinedmonth[playerid], datejoinedyear[playerid]); 
Or like this:

PHP код:
format(string,sizeof(string),"Date Joined: %s",datejoined[playerid]); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)