How to?
#3

GetTickcount when the player connects and save it
GetTickcount when the player disconnects and save it
(disconect time) - (Connect time) = time online
then just convert ticks into seconds

pawn Код:
stock PlayerConnectTime(playerid) {
    PlayerTime[playerid][tConnect] = GetTickCount();
}

stock PlayerDisconnectTime(playerid) {
  PlayerTime[playerid][tDisconnect] = GetTickCount();
  PlayerTime[playerid][tOnline] = floatdiv((PlayerTime[playerid][tDisconnect] - PlayerTime[playerid][tConnect]),6000);
  PlayerTime[playerid][tTotal] += PlayerTime[playerid][tOnline];
}
this is how i do it
Reply


Messages In This Thread
How to? - by ViruZZzZ_ChiLLL - 12.06.2010, 02:06
Re: How to? - by TheInnocentOne - 12.06.2010, 02:59
Re: How to? - by (SF)Noobanatior - 12.06.2010, 06:49
Re: How to? - by NiiRV4N4 - 12.06.2010, 06:51

Forum Jump:


Users browsing this thread: 1 Guest(s)