How to?
#1

I'm always confused and don't know where to start
on how to get the players total connect time :/
Reply
#2

There's no native function for it, you must script it yourself.

The only way I can think of is to use a timer which adds +1 onto the time each second :\
Reply
#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
#4

I have an idea, whenever a minute passes there score on the leaderboard goes up.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)