Score
#5

Quote:
Originally Posted by ekeleke
new playermoney

playermoney = GetPlayerMoney(playerid)

OnPlayerConnect

SetPlayerScore(playerid, playermoney);
This will work, but in a very limited way. During the course of the game the player is likely to gain/lose money, and this will not compensate for that. You need to use a timer that goes off at regular intervals.

pawn Код:
#include <a_samp>

forward MoneyCheck();
#define PERIOD 5000 //Time in ms between each score update. Low = laggy, High = bigger waits between updates

public OnGameModeInit()
{
    SetTimer("MoneyCheck", PERIOD, 1);
    return 1;
}

public MoneyCheck()
{
    for(new i; i<MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i))
      {
        SetPlayerScore(i,GetPlayerMoney(i));
      }
    }
}
Reply


Messages In This Thread
Score - by sggassasin - 19.07.2009, 04:55
Re: Score - by Mr_Finnigan - 19.07.2009, 05:33
Re: Score - by sggassasin - 19.07.2009, 06:51
Re: Score - by Pawno_Master - 19.07.2009, 11:37
Re: Score - by Weirdosport - 19.07.2009, 11:46
Re: Score - by Pawno_Master - 19.07.2009, 11:50
Re: Score - by Weirdosport - 19.07.2009, 11:57
Re: Score - by Pawno_Master - 19.07.2009, 12:04
Re: Score - by Mr_Finnigan - 19.07.2009, 13:29

Forum Jump:


Users browsing this thread: 3 Guest(s)