22.08.2016, 11:03
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { switch(dialogid) { case 12211: { if(!response)return 1; else { new string[128]; format(string, sizeof(string), "[HELPER]: %s is needing some help. Use /assist %d to assist them.", ReturnName(playerid, 0), playerid); format(string, sizeof(string), "[HELPER]: An assistance request has been received by %s. Use /assist %d to assist them.", ReturnName(playerid, 0), playerid); SendHelperMessage(COLOR_NEWGREEN, string); format(string, sizeof(string), "[REQUEST] %s %s", inputtext), ReturnName(playerid, 0); SendHelperMessage(COLOR_WHITE, string); AssistanceNeeded[playerid] = 1; } } case 12212: { if(!response)return 1; else { new string[128]; format(string, sizeof(string), "[FACTION MANAGEMENT]: %s is requesting their faction name to be changed. Please contact them.", ReturnName(playerid, 0), playerid); SendAdminAlert(COLOR_NEWGREEN, string); format(string, sizeof(string), "[DETAILS]: %s %s", inputtext), ReturnName(playerid, 0); SendAdminAlert(COLOR_WHITE, string); } } case 12250: { if(!response)return 1; else { switch(listitem) { case 0: { if(PlayerData[playerid][pMoney] >= 100) { PlayerData[playerid][pMoney] -= 100; new id = Inventory_Add(playerid, "Magazine", 2039); if (id == -1) return SendErrorMessage(playerid, "You don't have any inventory slots left."); SendClientMessage(playerid, COLOR_WHITE, "You have purchased a Magazine from the Black Market for the price of $100."); } else return SendErrorMessage(playerid, "You don't have enough money to finish the purchase."); } case 1: { if(PlayerData[playerid][pMoney] >= 200) { PlayerData[playerid][pMoney] -= 200; new id = Inventory_Add(playerid, "Ammo Cartridge", 2358); if (id == -1) return SendErrorMessage(playerid, "You don't have any inventory slots left."); SendClientMessage(playerid, COLOR_WHITE, "You have purchased an Ammo Cartridge from the Black Market for the price of $200."); } else return SendErrorMessage(playerid, "You don't have enough money to finish the purchase."); } case 2: { if(PlayerData[playerid][pMoney] >= 500) { if (Inventory_Count(playerid, "Armored Vest") >= 3) return SendErrorMessage(playerid, "You have 3 armored vests, you can't buy anymore."); new id = Inventory_Add(playerid, "Armored Vest", 19142); if (id == -1) return SendErrorMessage(playerid, "You don't have any inventory slots left."); PlayerData[playerid][pMoney] -= 500; SendClientMessage(playerid, COLOR_WHITE, "You have purchased an Armored Vest from the Black Market for the price of $500."); } else return SendErrorMessage(playerid, "You don't have enough money to finish the purchase."); } case 3: { if(PlayerData[playerid][pMoney] >= 1000) { PlayerData[playerid][pMoney] -= 1000; SetPlayerArmour(playerid, 100.0); SendClientMessage(playerid, COLOR_WHITE, "You have purchased a Heavy Armored Vest from the Black Market for the price of $1000."); } else return SendErrorMessage(playerid, "You don't have enough money to finish the purchase."); } case 4: { if(PlayerData[playerid][pMoney] >= 500) { PlayerData[playerid][pMoney] -= 500; new id = Inventory_Add(playerid, "Bomb", 1654); if (id == -1) return SendErrorMessage(playerid, "You don't have any inventory slots left."); SendClientMessage(playerid, COLOR_WHITE, "You have purchased a Bomb from the Black Market for the price of $500."); } else return SendErrorMessage(playerid, "You don't have enough money to finish the purchase."); } } } } } return 0; }