PlayedTime format
#1

Hello everybody, im trying to create PlayedTime format.
Already i have array PlayerInfo[playerid][pMinutes], and here i count played time on minutes.
And now im trying to format, example.

2 minutes 1 hours
or
59 minutes 0 hours

Any ideas how do that?
Reply
#2

Quote:
Originally Posted by pziemczyk
Hello everybody, im trying to create PlayedTime format.
Already i have array PlayerInfo[playerid][pMinutes], and here i count played time on minutes.
And now im trying to format, example.

2 minutes 1 hours
or
59 minutes 0 hours

Any ideas how do that?
I do this in my script:

pawn Код:
new OnlineTimer[MAX_PLAYERS];

//OnPlayerConnect
OnlineTimer[playerid] = SetTimerEx("OnlineTimeUpdate",1,60000);

//OnPlayerDisconnect
KillTimer(OnlineTimer[playerid]);

forward OnlineTimeUpdate(playerid);
public OnlineTimeUpdate(playerid)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_SPAWNED) return 1;
  pMins[playerid] ++;
  if(pMins[playerid] == 10 || pMins[playerid] == 20 || pMins[playerid] == 30 || pMins[playerid] == 40 || pMins[playerid] == 50 || pMins[playerid] == 60)
  {
    }
  if(pMins[playerid] >= 60)
  {
    pMins[playerid] = 0;
    pHours[playerid] ++;
    }
    return 1;
}
Reply
#3

ehm, but i need without add ,,Hours" array
Reply
#4

Then just make a timer on 1 minute that repeat itself that adds:

Код:
PlayerInfo[playerid][pMinutes] ++;
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)