/buy command help plz!!
#4

Quote:
Originally Posted by Jafet_Macario
Посмотреть сообщение
PHP код:
if(dialogid == 3)
{
    if(
response == 0) return SendClientMessage(playeridCOLOR_YELLOW"You closed  the '/buy' menu.");
    switch(
listitem)
    {
        case 
0:
        {
            
SendClientMessage(playeridCOLOR_YELLOW"You have bought a Desert Eagle for $6000.");
            
GivePlayerWeapon(playerid2440);
            
GivePlayerMoney(playerid, -6000);
            if(
GetPlayerMoney(playerid) < 6000) return SendClientMessage(playerid, -1,"You don't have that much");
        }
        case 
1:
        {
            
SendClientMessage(playeridCOLOR_YELLOW"You have bought a Combat Shotgun for $14000.");
            
GivePlayerWeapon(playerid27107);
            
GivePlayerMoney(playerid, -14000);
            if(
GetPlayerMoney(playerid) < 14000) return SendClientMessage(playerid, -1,"You don't have that much");
        }
        case 
2:
        {
            
SendClientMessage(playeridCOLOR_YELLOW"You have bought a MP5 for $10000.");
            
GivePlayerWeapon(playerid29230);
            
GivePlayerMoney(playerid, -10000);
            if(
GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, -1,"You don't have that much");
        }
        case 
3:
        {
            
SendClientMessage(playeridCOLOR_YELLOW"You have bought a AK-47 for $14000.");
            
GivePlayerWeapon(playerid30460);
            
GivePlayerMoney(playerid, -14000);
            if(
GetPlayerMoney(playerid) < 14000) return SendClientMessage(playerid, -1,"You don't have that much");
        }
        case 
4:
        {
            
SendClientMessage(playeridCOLOR_YELLOW"You have bought a M4 for $16000.");
            
GivePlayerWeapon(playerid31460);
            
GivePlayerMoney(playerid, -16000);
            if(
GetPlayerMoney(playerid) < 16000) return SendClientMessage(playerid, -1,"You don't have that much");
        }
    }

This still wotn work.
Now it removes the money from the player first, and after that it checks the amount of money. So you will buy the weapon, money gets removed, and you get a message 'You dont have that much'.
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: 1 Guest(s)