17.10.2015, 04:12
How would I give a player 1 Score per x amount of $, For example. 1000$ = 1 Score.
CMD:trademoney(playerid,params[])
{
if(GetPlayerMoney(playerid) >= 1000)
{
new score = GetPlayerScore(playerid);
GivePlayerMoney(playerid,-1000);
SetPlayerScore(playerid,score + 1);
SendClientMessage(playerid,-1, "You have traded $1000 for 1 score");
return 1;
}
SendClientMessage(playerid,-1, "{FF0000}[ERROR]:{FFFFFF} You don't have enough money to trade for score");
return 1;
}
SetPlayerScore
GivePlayerScore
public OnPlayerUpdate(playerid)
{
if(GetPlayerMoney(playerid) == 1000)
{
new score = GetPlayerScore(playerid);
GivePlayerMoney(playerid,-1000);
SetPlayerScore(playerid,score + 1);
}
return 1;
}