21.02.2010, 19:53
pawn Код:
/* this script isn't saving player's time, you can use dini/dudb or DJson or any other system to save player's time. */
forward myTimer();
new
playerOnlineTime[MAX_PLAYERS];
public myTimer()
{
foreach(Player, u)
{
playerOnlineTime[u]++;
SetPlayerScore(u, floatround(playerOnlineTime[u] / 60));
}
return true;
}
/* under OnGameModeInit/OnFilterScriptInit*/
SetTimer("myTimer", 1000, true);
public OnPlayerDisconnect(playerid, reason)
{
playerOnlineTime[playerid] = 0; // reset the time.
return true;
}