Problem with dialogs
#2

Which line is 327? Also you have to learn about basics first: https://sampwiki.blast.hk/wiki/Scripting_Basics

pawn Код:
if(response) {
    switch (dialogid) {
        case 1338: {
            if(0 == listitem)
            {
                ShowPlayerDialog(playerid , 1339 , DIALOG_STYLE_LIST , "Car Shop" , "Cadrona($20 000)\nBlista($60 000)" , "Buy" , "Exit");
            }
        }
        case 1339: {
            if(!listitem)
            {
                if(GetPlayerMoney(playerid) < 20000) return SendClientMessage(playerid , 0xFFFFFFFF , "You don't have enough money");
                CreateVehicle(527 , 210.6137 , -8.0158 , 2.5338 , 1 , 1 , 500);
                GivePlayerMoney(playerid -20000);
                SendClientMessage(playerid , 0x489048FF , "-----------------------------------------------------");
                SendClientMessage(playerid , 0x489048FF , "You have bought Cadrona for $20 000!");
            }
            else
            {
                if(GetPlayerMoney(playerid) < 60000) return SendClientMessage(playerid , 0xFFFFFFFF , "You don't have enough money");
                CreateVehicle(496 , 210.6137 , -8.0158 , 2.5338 , 1 , 1 , 500)
                GivePlayerMoney(playerid -60000)
                SendClientMessage(playerid , 0x489048FF , "-----------------------------------------------------");
                SendClientMessage(playerid , 0x489048FF , "You have bought Blista Compact for $60 000!");
            }
        }
    }
}
You could refactor your code using your own functions, to make adding cars to sell/buy in future much easier.
Reply


Messages In This Thread
Problem with dialogs - by Heisenbergx2 - 12.08.2013, 10:07
Re: Problem with dialogs - by Misiur - 12.08.2013, 11:19
Re: Problem with dialogs - by Heisenbergx2 - 12.08.2013, 11:24
Re: Problem with dialogs - by Misiur - 12.08.2013, 11:30
Re: Problem with dialogs - by Heisenbergx2 - 12.08.2013, 11:36
Re: Problem with dialogs - by Misiur - 12.08.2013, 11:46
Re: Problem with dialogs - by Heisenbergx2 - 12.08.2013, 11:49
Re: Problem with dialogs - by JeaSon - 12.08.2013, 11:52
Re: Problem with dialogs - by Misiur - 12.08.2013, 11:56
Re: Problem with dialogs - by Heisenbergx2 - 12.08.2013, 12:08

Forum Jump:


Users browsing this thread: 1 Guest(s)