[HELP] Score = Money?
#1

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
Reply
#2

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

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

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).
Reply
#5

@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)
Reply
#6

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:
Reply
#7

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
Reply
#8

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

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


Forum Jump:


Users browsing this thread: 2 Guest(s)