Problem Weapon Shop
#5

This should work
PHP код:
            public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
            {
        if(
dialogid == 67)
        {
            if(!
response) return 1;
            if(
response)
            {
            
                switch(
listitem)
                {
                    case 
0:
                       {
                        if(
GetPlayerMoney(playerid) < 100)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -100);
                        
GivePlayerWeapon(playerid41);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
1:
                    {
                           if(
GetPlayerMoney(playerid) < 100)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -100);
                        
GivePlayerWeapon(playerid91);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                     }
                    case 
2:
                    {
                        if(
GetPlayerMoney(playerid) < 1500)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -1500);
                        
GivePlayerWeapon(playerid161);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
3:
                    {
                        if(
GetPlayerMoney(playerid) < 2000)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -2000);
                        
GivePlayerWeapon(playerid182);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
4:
                    {
                        if(
GetPlayerMoney(playerid) < 1150)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -1150);
                        
GivePlayerWeapon(playerid24100);
                        
SendClientMessage(playerid0x99FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
5:
                    {
                        if(
GetPlayerMoney(playerid) < 1000)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -1000);
                        
GivePlayerWeapon(playerid26100);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
6:
                    {
                        if(
GetPlayerMoney(playerid) < 1000)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -1000);
                        
GivePlayerWeapon(playerid28100);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
7:
                    {
                        if(
GetPlayerMoney(playerid) < 500)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -500);
                        
GivePlayerWeapon(playerid29150);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
8:
                    {
                        if(
GetPlayerMoney(playerid) < 1000)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -1000);
                        
GivePlayerWeapon(playerid3410);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
9:
                    {
                        if(
GetPlayerMoney(playerid) < 2000)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -2000);
                        
GivePlayerWeapon(playerid3710);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
10:
                    {
                           if(
GetPlayerMoney(playerid) < 5000)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -5000);
                        
GivePlayerWeapon(playerid391);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
11:
                    {
                        if(
GetPlayerMoney(playerid) < 5000)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -5000);
                        
GivePlayerWeapon(playerid4250);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
12:
                    {
                        if(
GetPlayerMoney(playerid) < 50)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -50);
                        
GivePlayerWeapon(playerid111);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
13:
                    {
                        if(
GetPlayerMoney(playerid) < 200)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -200);
                        
GivePlayerWeapon(playerid121);
                           
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                    }
                    case 
14:
                    {
                        if(
GetPlayerMoney(playerid) < 100)
                        return 
SendClientMessage(playerid0x33FF00AA"You don't have enough cash to buy this Weapon.");
                        
GivePlayerMoney(playerid, -100);
                        
GivePlayerWeapon(playerid461);
                        
SendClientMessage(playerid0x33FF00AA"You have succesfully buyed your weapon.");
                }
        }
    }
return 
1;

and for the warning just organize the script
Reply


Messages In This Thread
Problem Weapon Shop - by Mijata - 09.01.2015, 16:11
Re: Problem Weapon Shop - by nezo2001 - 09.01.2015, 16:14
Re: Problem Weapon Shop - by Mijata - 09.01.2015, 16:21
Re: Problem Weapon Shop - by UltraScripter - 09.01.2015, 16:27
Re: Problem Weapon Shop - by nezo2001 - 09.01.2015, 16:29
Re: Problem Weapon Shop - by Mijata - 09.01.2015, 16:34
Re: Problem Weapon Shop - by Mijata - 09.01.2015, 17:06

Forum Jump:


Users browsing this thread: 1 Guest(s)