14.09.2014, 23:49
Hi I want the score is the money the player has
SetTimerEx("ScoreMoney", 1000, 1, "i", playerid);
forward ScoreMoney(playerid);
public ScoreMoney(playerid)
{
SetPlayerScore(playerid,GetPlayerMoney(playerid));
return 1;
}
public OnPlayerSpawn(playerid)// Maybe your script will give money to player after spawning.
{
SetTimerEx("ScoreMoney", 500, true, "i", playerid);
return true;
}
public ScoreMoney(playerid)
{
SetPlayerScore(playerid, GetPlayerMoney(playerid)); // This will get the player's money and will assing it to his/her score.
return true;
}
You can also do it in other ways though :
pawn Код:
|
stock GiveMoney(playerid,amount)
{
GivePlayerMoney(playerid,amount);
SetPlayerScore(playerid,GetPlayerMoney(playerid));
return true;
}
//later usage should be GiveMoney instead of GivePlayerMoney. for example:
public OnPlayerSpawn(playerid)
{
GiveMoney(playerid,100);
return 1;
}