Scores for stunting
#3

WTF? why do you get the player name? Why do you use MAX_PLAYERS in your loop?

why do you bother making the oldcashscore variable?

Theres no real reason to do this or even use the CashScoreOld variable. I suggest doing this.

pawn Код:
//ongamemodeinit
SetTimer("ScoreUpdate", 10000, 1); //10000 is a nice round number. update every 10 seconds.

forward ScoreUpdate();
public ScoreUpdate()
{
  for(new i=0; i<=GetMaxPlayers(); i++)
  {
    if(IsPlayerConnected(i))
    {
      new CashScore = GetPlayerMoney(i);
      SetPlayerScore(i, CashScore);
    }
  }
}
That is MUCH better.
Reply


Messages In This Thread
Scores for stunting - by CAMERON_BANFIELD - 23.03.2009, 08:00
Re: Scores for stunting - by watkijkje - 23.03.2009, 08:21
Re: Scores for stunting - by Kinetic - 23.03.2009, 08:47
Re: Scores for stunting - by Dujma - 23.03.2009, 08:50
Re: Scores for stunting - by Kinetic - 23.03.2009, 08:51
Re: Scores for stunting - by watkijkje - 23.03.2009, 08:55
Re: Scores for stunting - by Kinetic - 23.03.2009, 08:59
Re: Scores for stunting - by Donny_k - 23.03.2009, 09:01
Re: Scores for stunting - by watkijkje - 23.03.2009, 09:02
Re: Scores for stunting - by Dujma - 23.03.2009, 09:06

Forum Jump:


Users browsing this thread: 1 Guest(s)