SA-MP Forums Archive
GetPlayerMoney - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: GetPlayerMoney (/showthread.php?tid=173304)



GetPlayerMoney - Quest123 - 02.09.2010

We'll im making this command, and its going good so far, i just need to find out how to check if the player has enough cash to buy the thing, so it will check him, and if he has enough cash, it will proceed onto buying.

Command:
pawn Код:
}
    if(strcmp(cmd, "/weaponpack", true) == 0) {
    GivePlayerMoney(playerid,-125000);
    SendClientMessage(playerid, COLOR_GREEN,"You Bought A Weapon Pack!");
    GivePlayerWeapon ect ect
    return 1;
    }
So can you please tell me how to check if the player has enough cash ect? cheers.


Re: GetPlayerMoney - Sky4D - 02.09.2010

pawn Код:
if(strcmp(cmd, "/weaponpack", true) == 0) {
    if(GetPlayerMoney(playerid) >= 125000) {
        GivePlayerMoney(playerid,-125000);
        SendClientMessage(playerid, COLOR_GREEN,"You Bought A Weapon Pack!");
        GivePlayerWeapon ect ect
    }
    else return SendClientMessage(playerid, COLOR_RED, "ERROR: You don't have enough money!");
    return 1;
}



Re: GetPlayerMoney - Quest123 - 02.09.2010

Thanks alot! Works now!