[NEED HELP] Need Realistic Money System
#2

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)
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;
}
Reply


Messages In This Thread
[NEED HELP] Need Realistic Money System - by DiamondGold - 21.01.2015, 10:18
Re: [NEED HELP] Need Realistic Money System - by Lynn - 21.01.2015, 10:29
Re: [NEED HELP] Need Realistic Money System - by DiamondGold - 21.01.2015, 11:09
Re: [NEED HELP] Need Realistic Money System - by DiamondGold - 22.01.2015, 09:24
Re: [NEED HELP] Need Realistic Money System - by S4MSUNG - 22.01.2015, 09:57

Forum Jump:


Users browsing this thread: 1 Guest(s)