Change Score
#4

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;
}
You'll need ******'s foreach function or you could just use the normal loop.
Reply


Messages In This Thread
Change Score - by Biggs - 21.02.2010, 19:31
Re: Change Score - by Correlli - 21.02.2010, 19:45
Re: Change Score - by Biggs - 21.02.2010, 19:49
Re: Change Score - by Correlli - 21.02.2010, 19:53
Re: Change Score - by SlashPT - 21.02.2010, 19:57
Re: Change Score - by Correlli - 21.02.2010, 20:00
Re: Change Score - by SlashPT - 21.02.2010, 20:10
Re: Change Score - by Correlli - 21.02.2010, 20:11

Forum Jump:


Users browsing this thread: 1 Guest(s)