SA-MP Forums Archive
[HELP] Score = Money? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Score = Money? (/showthread.php?tid=127675)



[HELP] Score = Money? - FreddeN - 14.02.2010

Hello Again, you know when you hit TAB and you can see your score, default it's on 0, but I want it to count how much money you got in your pocket.

I hope you understand, thanks


Re: [HELP] Score = Money? - Calgon - 14.02.2010

Run a timer to SetPlayerScore(), if their money changes.


Re: [HELP] Score = Money? - Zeromanster - 14.02.2010

It's not a good idea to put money in the score because the score has a limit of 60k and something. :P


Re: [HELP] Score = Money? - Calgon - 14.02.2010

Quote:
Originally Posted by zєяσмαиѕтєя
It's not a good idea to put money in the score because the score has a limit of 60k an something. :P
Ah yes, and that. The score limit is 65k (I think).


Re: [HELP] Score = Money? - Hiitch - 14.02.2010

@above: The score limit is > 65k.

@topicAuthor: Look at this, you will learn from it.

pawn Код:
forward MoneyTimer(playerid, amount); //this can go anywhere

public MoneyTimer(playerid) //this can go anywhere, as long as it isnt in a callback
{
    SetPlayerScore(playerid, GetPlayerMoney(playerid));
}

//under OnGameModeInit

    SetTimer("MoneyTimer", 10000, true); //this sets a timer for the mentioned public function to set the score to the players money amount
Enjoy, if you have any questions, feel free to ask again (the above is untested)


Re: [HELP] Score = Money? - Jeffry - 17.02.2010

Quote:
Originally Posted by zєяσмαиѕтєя
It's not a good idea to put money in the score because the score has a limit of 60k and something. :P
Wrong.
I tried it with 1 000 000 000 and it worked fine.

On PING is the max: 65535.

Check:


Re: [HELP] Score = Money? - Niixie - 17.02.2010

you dont have to
Код:
forward MoneyTimer(playerid, amount);
you dont use amount.

just
Код:
forward MoneyTimer(playerid);
because playerid is used when setting the player score and getting the player money


Re: [HELP] Score = Money? - MenaceX^ - 17.02.2010

pawn Код:
public OnPlayerUpdate(playerid)
{
  if(GetPlayerScore(playerid)!=GetPlayerMoney(playerid))
    SetPlayerScore(playerid,GetPlayerMoney(playerid));
  return 1;
}



Re: [HELP] Score = Money? - fma965 - 09.08.2010

hi i was wondering how to do this just figured it out from this thanks