/buy command help plz!!
#7

pawn Код:
if(dialogid == 3)
{
    if(response == 0) return SendClientMessage(playerid, COLOR_YELLOW, "You closed  the '/buy' menu.");
    switch(listitem) {
        case 0:
        {
            if( GetPlayerMoney(playerid) < AMOUNTHERE ) return SendClientMessage(playerid, Color, "You dont have enough money to buy this weapon!"); // now itll check his money the first thing when he clicks on the first list item
            SendClientMessage(playerid, COLOR_YELLOW, "You have bought a Desert Eagle for $6000.");
            GivePlayerWeapon(playerid, 24, 40);
            GivePlayerMoney(playerid, -6000);
        }
        case 1:
        {
            if( GetPlayerMoney(playerid) < AMOUNTHERE ) return SendClientMessage(playerid, Color, "You dont have enough money to buy this weapon!"); // etc etc
            SendClientMessage(playerid, COLOR_YELLOW, "You have bought a Combat Shotgun for $14000.");
            GivePlayerWeapon(playerid, 27, 107);
            GivePlayerMoney(playerid, -14000);
        }
        case 2:
        {
            if( GetPlayerMoney(playerid) < AMOUNTHERE ) return SendClientMessage(playerid, Color, "You dont have enough money to buy this weapon!");
            SendClientMessage(playerid, COLOR_YELLOW, "You have bought a MP5 for $10000.");
            GivePlayerWeapon(playerid, 29, 230);
            GivePlayerMoney(playerid, -10000);
        }
        case 3:
        {
            if( GetPlayerMoney(playerid) < AMOUNTHERE ) return SendClientMessage(playerid, Color, "You dont have enough money to buy this weapon!");
            SendClientMessage(playerid, COLOR_YELLOW, "You have bought a AK-47 for $14000.");
            GivePlayerWeapon(playerid, 30, 460);
            GivePlayerMoney(playerid, -14000);
        }
        case 4:
        {
            if( GetPlayerMoney(playerid) < AMOUNTHERE ) return SendClientMessage(playerid, Color, "You dont have enough money to buy this weapon!");
            SendClientMessage(playerid, COLOR_YELLOW, "You have bought a M4 for $16000.");
            GivePlayerWeapon(playerid, 31, 460);
            GivePlayerMoney(playerid, -16000);
        }
    }
}
Reply


Messages In This Thread
/buy command help plz!! - by Captain_Mani - 14.09.2011, 12:52
Re: /buy command help plz!! - by Wesley221 - 14.09.2011, 12:54
Re: /buy command help plz!! - by Jafet_Macario - 14.09.2011, 12:55
Re: /buy command help plz!! - by Wesley221 - 14.09.2011, 12:59
Re: /buy command help plz!! - by Captain_Mani - 14.09.2011, 13:02
Re: /buy command help plz!! - by Jafet_Macario - 14.09.2011, 13:02
Re: /buy command help plz!! - by Wesley221 - 14.09.2011, 13:04
Re: /buy command help plz!! - by Captain_Mani - 14.09.2011, 13:19

Forum Jump:


Users browsing this thread: 2 Guest(s)