21.02.2010, 19:31
How do I Change score to how many minutes that a player has played for?
/* 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;
}
Originally Posted by DarK TeaM PT
Correli btw can you tell me what the foreach does because i dont understand what ****** topic says...
|