12.08.2013, 11:19
Which line is 327? Also you have to learn about basics first: https://sampwiki.blast.hk/wiki/Scripting_Basics
You could refactor your code using your own functions, to make adding cars to sell/buy in future much easier.
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!");
}
}
}
}