GetPlayerMoney
#1

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.
Reply
#2

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;
}
Reply
#3

Thanks alot! Works now!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)