23.03.2009, 08:47
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.
That is MUCH better.
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);
}
}
}