13.09.2016, 12:32
Fixed script:
There should also be a "return 1;" at the end. Please calculate the braces and place the "return 1;" where it should be IF THERE ARE ERRORS.
Visit this: Click here
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 11112)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 22221, DIALOG_STYLE_LIST, "Make a weapon order", "Deagle - 2,000\nSpas-12 - 5,000\nM4 - $3,900\nSniper - $3,700\nAK-47 - $3500\nMP5 - $1,500\nFlamethrower - $10,000Shovel - $60\nBat - $50\nKnife - $25\nChainsaw - $7,000", "Purchase", "Cancel order");
}
if(listitem == 1)
{
ShowPlayerDialog(playerid, 33331, DIALOG_STYLE_LIST, "First aid & vest order", "First aid kit - $4,500\nVest - $6,000", "Purchase", "Cancel order");
}
if(listitem == 2)
{
ShowPlayerDialog(playerid, 44441, DIALOG_STYLE_MSGBOX, "Department of Protection", "The Department of Protection (DOP) are currently\nworking on a cure called Antidevoxal. An Antidevoxal\nwill cure infected human beings from the Vox virus.", "Okay", "");
}
if(listitem == 3)
{
ShowPlayerDialog(playerid, 66661, DIALOG_STYLE_MSGBOX, "Department of Protection", "There are currently no maps in stock at this department.\nVisit a D.O.P in another state for more supples!", "Okay", "");
}
if(listitem == 4)
{
ShowPlayerDialog(playerid, 77771, DIALOG_STYLE_MSGBOX, "Department of Protection", "There is no food available at this department.\nVisit a D.O.P in another state for more supplies!", "Okay", "");
}
if(listitem == 5)
{
ShowPlayerDialog(playerid, 88881, DIALOG_STYLE_LIST, "BULK BUY (SETTLEMENT SUPPORT SCHEME)", "Bulk buy weapons - $30,000\nBulk buy kits/armour - $10,000\nBulk buy maps\nBulk buy food", "Select", "Cancel");
}
}
}
if(dialogid == 22221)
{
if(response)
{
if(listitem == 0)
{
if(GetPlayerMoney(playerid) < 2000) return SendClientMessage(playerid, -1, "You don't have enough money to make an order for this item!");
{
GivePlayerWeapon(playerid, 24, 200);
GivePlayerMoney(playerid, -2000);
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Your order has been processed. You have purchased a Deagle from the Department of Protection");
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Stay safe out there, it's very dangerous! Group up, stay together and stay away from populated areas.");
}
}
if(listitem == 1)
{
if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, -1, "You don't have enough money to make an order for this item!");
{
GivePlayerWeapon(playerid, 27, 250);
GivePlayerMoney(playerid, -5000);
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Your order has been processed. You have purchased a Spas12 from the Department of Protection");
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Stay safe out there, it's very dangerous! Group up, stay together and stay away from populated areas.");
}
}
if(listitem == 2)
{
if(GetPlayerMoney(playerid) < 3900) return SendClientMessage(playerid, -1, "You don't have enough money to make an order for this item!");
{
GivePlayerWeapon(playerid, 31, 400);
GivePlayerMoney(playerid, -3900);
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Your order has been processed. You have purchased an M4 from the Department of Protection");
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Stay safe out there, it's very dangerous! Group up, stay together and stay away from populated areas.");
}
}
if(listitem == 3)
{
if(GetPlayerMoney(playerid) < 3700) return SendClientMessage(playerid, -1, "You don't have enough money to make an order for this item!");
{
GivePlayerWeapon(playerid, 34, 200);
GivePlayerMoney(playerid, -3700);
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Your order has been processed. You have purchased a Sniper from the Department of Protection");
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Stay safe out there, it's very dangerous! Group up, stay together and stay away from populated areas.");
}
}
if(listitem == 4)
{
if(GetPlayerMoney(playerid) < 3500) return SendClientMessage(playerid, -1, "You don't have enough money to make an order for this item!");
{
GivePlayerWeapon(playerid, 30, 400);
GivePlayerMoney(playerid, -3500);
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Your order has been processed. You have purchased an AK-47 from the Department of Protection");
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Stay safe out there, it's very dangerous! Group up, stay together and stay away from populated areas.");
}
}
if(listitem == 5)
{
if(GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid, -1, "You don't have enough money to make an order for this item!");
{
GivePlayerWeapon(playerid, 29, 200);
GivePlayerMoney(playerid, -1500);
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Your order has been processed. You have purchased an MP5 from the Department of Protection");
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Stay safe out there, it's very dangerous! Group up, stay together and stay away from populated areas.");
}
}
if(listitem == 6)
{
if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, -1, "You don't have enough money to make an order for this item!");
{
GivePlayerWeapon(playerid, 37, 300);
GivePlayerMoney(playerid, -10000);
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Your order has been processed. You have purchased an Flame Thrower from the Department of Protection");
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Stay safe out there, it's very dangerous! Group up, stay together and stay away from populated areas.");
}
}
if(listitem == 7)
{
if(GetPlayerMoney(playerid) < 60) return SendClientMessage(playerid, -1, "You don't have enough money to make an order for this item!");
{
GivePlayerWeapon(playerid, 6, 200);
GivePlayerMoney(playerid, -60);
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Your order has been processed. You have purchased a Shovel from the Department of Protection");
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Stay safe out there, it's very dangerous! Group up, stay together and stay away from populated areas.");
}
}
if(listitem == 8)
{
if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, -1, "You don't have enough money to make an order for this item!");
{
GivePlayerWeapon(playerid, 5, 200);
GivePlayerMoney(playerid, -50);
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Your order has been processed. You have purchased a Bat from the Department of Protection");
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Stay safe out there, it's very dangerous! Group up, stay together and stay away from populated areas.");
}
}
if(listitem == 9)
{
if(GetPlayerMoney(playerid) < 25) return SendClientMessage(playerid, -1, "You don't have enough money to make an order for this item!");
{
GivePlayerWeapon(playerid, 4, 200);
GivePlayerMoney(playerid, -25);
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Your order has been processed. You have purchased a Knife from the Department of Protection");
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Stay safe out there, it's very dangerous! Group up, stay together and stay away from populated areas.");
}
}
if(listitem == 10)
{
if(GetPlayerMoney(playerid) < 7000) return SendClientMessage(playerid, -1, "You don't have enough money to make an order for this item!");
{
GivePlayerWeapon(playerid, 9, 200);
GivePlayerMoney(playerid, -7000);
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Your order has been processed. You have purchased a Chainsaw from the Department of Protection");
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Stay safe out there, it's very dangerous! Group up, stay together and stay away from populated areas.");
}
}
}
}
if(dialogid == 3331)
{
if(response)
{
if(listitem == 0)
{
if(GetPlayerMoney(playerid) < 4500) return SendClientMessage(playerid, -1, "You don't have enough money to make an order for this item!");
{
SetPlayerHealth(playerid, 100);
GivePlayerMoney(playerid, -4500);
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Your order has been processed. You have purchased a First aid kit from the Department of Protection");
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Stay safe out there, it's very dangerous! Group up, stay together and stay away from populated areas.");
}
}
if(listitem == 1)
{
if(GetPlayerMoney(playerid) < 6000) return SendClientMessage(playerid, -1, "You don't have enough money to make an order for this item!");
{
SetPlayerArmour(playerid, 100);
GivePlayerMoney(playerid, -6000);
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Your order has been processed. You have purchased a Vest from the Department of Protection");
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Stay safe out there, it's very dangerous! Group up, stay together and stay away from populated areas.");
}
}
}
}
if(dialogid == 88881)
{
if(response)
{
if(listitem == 0)
{
if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, -1, "You don't have enough money to make an order for this item!");
{
GivePlayerWeapon(playerid, 24, 200);
GivePlayerWeapon(playerid, 27, 250);
GivePlayerWeapon(playerid, 31, 400);
GivePlayerWeapon(playerid, 34, 200);
GivePlayerWeapon(playerid, 30, 400);
GivePlayerWeapon(playerid, 29, 300);
GivePlayerWeapon(playerid, 37, 200);
GivePlayerWeapon(playerid, 6, 200);
GivePlayerWeapon(playerid, 5, 200);
GivePlayerWeapon(playerid, 4, 200);
GivePlayerWeapon(playerid, 9, 200);
GivePlayerMoney(playerid, -30000);
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: You have bought one each of every weapon in bulk purchase. You paid $30,000 and saved $6,000!");
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: Stay safe courageous survivor. The outskirts of Los Santos are unsafe.");
}
}
if(listitem == 1)
{
if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, -1, "You don't have enough money to make an order for this item!");
{
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
GivePlayerMoney(playerid, -10000);
SendClientMessage(playerid, -1, "AUTOMATED MESSAGE: You have bought a first aid kit and vest in bulk purchase. You paid $10,000 and saved $500!");
}
}
}
return 1;
}
return 0;
}
Visit this: Click here