money=score
#1

Might this is a stupid question but i couldn't found it somewere, how i can set the player money as score?
Reply
#2

pawn Код:
// On top
forward ScoreUpdate();

// OnGameModeInit/FilterScriptInit
SetTimer("ScoreUpdate", 1000, 1);

// Outside of any callbacks/functions
public ScoreUpdate()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            SetPlayerScore(playerid, GetPlayerMoney(playerid));
        }
    }
}
Reply
#3

Quote:
Originally Posted by SpiderPork
pawn Код:
// On top
forward ScoreUpdate();

// OnGameModeInit/FilterScriptInit
SetTimer("ScoreUpdate", 1000, 1);

// Outside of any callbacks/functions
public ScoreUpdate()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            SetPlayerScore(playerid, GetPlayerMoney(playerid));
        }
    }
}
Should be
pawn Код:
SetPlayerScore(i, GetPlayerMoney(i));
Reply
#4

True. My mistake, just a typo.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)