21.01.2015, 10:29
Nothing fancy, but this is the basic concept.
Assuming you're leaving the last two 0's open. I.E 100.00 (10,000$ = $100.00)
Assuming you're leaving the last two 0's open. I.E 100.00 (10,000$ = $100.00)
pawn Код:
CMD:pay(playerid, params[])
{
new id, amount, cash;
if(sscanf(params,"ud",id, amount)) return SendClientMessage(playerid, -1,"USAGE: /pay [playerid][amount]");
else
{
cash = GetPlayerMoney(playerid)*100;
if(amount >= cash) {
GivePlayerMoney(id, amount*100); // This will keep the other 2 0's at a 0 value. i.e 10$ = 10.00
GivePlayerMoney(playerid, -amount*100);// This will do the same thing as above but removing instead.
}
else return SendClientMessage(playerid, -1, "You do not have that much!");
}
return 1;
}