Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dialog:LicensesPurchase(playerid, response, listitem, inputtext[])
- {
- if (response)
- {
- switch (listitem)
- {
- case 0:
- {
- if (Inventory_HasItem(playerid, "Car License"))
- return SendErrorMessage(playerid, "You already have a Car License.");
- Inventory_Add(playerid, "Car License", 1581);
- SendClientMessage(playerid, COLOR_ORANGE, "[LICENSE DEPARTMENT]: You have paid and received your Car License. You are now allowed to operate a Car.");
- GiveMoney(playerid, -100);
- }
- case 1:
- {
- if (Inventory_HasItem(playerid, "Truck License"))
- return SendErrorMessage(playerid, "You already have a Truck License.");
- Inventory_Add(playerid, "Truck License", 1581);
- SendClientMessage(playerid, COLOR_ORANGE, "[LICENSE DEPARTMENT]: You have paid and received your Truck License. You are now allowed to operate a Truck.");
- GiveMoney(playerid, -200);
- }
- case 2:
- {
- if (Inventory_HasItem(playerid, "Motorbike License"))
- return SendErrorMessage(playerid, "You already have a Motorbike License.");
- Inventory_Add(playerid, "Motorbike License", 1581);
- SendClientMessage(playerid, COLOR_ORANGE, "[LICENSE DEPARTMENT]: You have paid and received your Motorbike License. You are now allowed to operate a Motorbike.");
- GiveMoney(playerid, -150);
- }
- case 3:
- {
- if (Inventory_HasItem(playerid, "Airplane License"))
- return SendErrorMessage(playerid, "You already have an Airplane License.");
- Inventory_Add(playerid, "Airplane License", 1581);
- SendClientMessage(playerid, COLOR_ORANGE, "[LICENSE DEPARTMENT]: You have paid and received your Airplane License. You are now allowed to operate a Airplane.");
- GiveMoney(playerid, -1000);
- }
- case 4:
- {
- if (Inventory_HasItem(playerid, "Helicopter License"))
- return SendErrorMessage(playerid, "You already have a Helicopter License.");
- Inventory_Add(playerid, "Helicopter License", 1581);
- SendClientMessage(playerid, COLOR_ORANGE, "[LICENSE DEPARTMENT]: You have paid and received your Helicopter License. You are now allowed to operate a Helicopter.");
- GiveMoney(playerid, -1000);
- }
- }
- }
- return 1;
- }
- Dialog:ViewCharges(playerid, response, listitem, inputtext[])
- {
- if (GetFactionType(playerid) != FACTION_POLICE || !IsACruiser(GetPlayerVehicleID(playerid)))
- return 0;
- if (response)
- {
- if (isnull(inputtext) || strlen(inputtext) > 24)
- return Dialog_Show(playerid, ViewCharges, DIALOG_STYLE_INPUT, "View Charges", "Please enter the name or ID of the player:", "Submit", "Back");
- if (IsNumeric(inputtext) && IsPlayerConnected(strval(inputtext))) {
- ViewCharges(playerid, ReturnName(strval(inputtext)));
- }
- else if (!IsNumeric(inputtext)) {
- ViewCharges(playerid, inputtext);
- }
- else {
- Dialog_Show(playerid, ViewCharges, DIALOG_STYLE_INPUT, "View Charges", "Error: Invalid user specified.\n\nPlease enter the name or ID of the player:", "Submit", "Back");
- }
- }
- else cmd_mdc(playerid, "\1");
- return 1;
- }
- Dialog:Locker(playerid, response, listitem, inputtext[])
- {
- new factionid = PlayerData[playerid][pFaction];
- if (factionid == -1 || !IsNearFactionLocker(playerid))
- return 0;
- if (response)
- {
- static
- skins[8],
- string[512];
- string[0] = 0;
- if (FactionData[factionid][factionType] != FACTION_GANG)
- {
- switch (listitem)
- {
- case 0:
- {
- if (!PlayerData[playerid][pOnDuty])
- {
- PlayerData[playerid][pOnDuty] = true;
- SetPlayerArmour(playerid, 100.0);
- SetFactionColor(playerid);
- SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s has clocked in and is now on duty.", ReturnName(playerid, 0));
- SendFactionMessage(factionid, COLOR_FACTIONCHAT, "**DISPATCH: %s %s is now On Duty.**", Faction_GetRank(playerid), ReturnName(playerid, 0));
- }
- else
- {
- PlayerData[playerid][pOnDuty] = false;
- SetPlayerArmour(playerid, 0.0);
- SetPlayerColor(playerid, DEFAULT_COLOR);
- SetPlayerSkin(playerid, PlayerData[playerid][pSkin]);
- SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s has clocked out and is now off duty.", ReturnName(playerid, 0));
- SendFactionMessage(factionid, COLOR_FACTIONCHAT, "**DISPATCH: %s %s is now Off Duty.**", Faction_GetRank(playerid), ReturnName(playerid, 0));
- }
- }
- case 1:
- {
- SetPlayerArmour(playerid, 100.0);
- SetPlayerHealth(playerid, 100.0);
- SendClientMessage(playerid, COLOR_WHITE, "You have filled your health (100.0) and armour (100.0). ");
- }
- case 2:
- {
- for (new i = 0; i < sizeof(skins); i ++)
- skins[i] = (FactionData[factionid][factionSkins][i]) ? (FactionData[factionid][factionSkins][i]) : (19300);
- ShowModelSelectionMenu(playerid, "Choose Skin", MODEL_SELECTION_FACTION_SKIN, skins, sizeof(skins), -16.0, 0.0, -55.0);
- }
- case 3:
- {
- for (new i = 0; i < 10; i ++)
- {
- if (FactionData[factionid][factionWeapons][i])
- format(string, sizeof(string), "%sWeapon %d: %s\n", string, i + 1, ReturnWeaponName(FactionData[factionid][factionWeapons][i]));
- else format(string, sizeof(string), "%sEmpty Slot\n", string);
- }
- Dialog_Show(playerid, LockerWeapons, DIALOG_STYLE_LIST, "Locker Weapons", string, "Select", "Cancel");
- }
- }
- }
- else
- {
- switch (listitem)
- {
- case 0:
- {
- for (new i = 0; i < sizeof(skins); i ++)
- skins[i] = (FactionData[factionid][factionSkins][i]) ? (FactionData[factionid][factionSkins][i]) : (19300);
- ShowModelSelectionMenu(playerid, "Choose Skin", MODEL_SELECTION_FACTION_SKIN, skins, sizeof(skins), -16.0, 0.0, -55.0);
- }
- case 1:
- {
- for (new i = 0; i < 10; i ++)
- {
- if (FactionData[factionid][factionWeapons][i] && GetFactionType(playerid) != FACTION_GANG)
- format(string, sizeof(string), "%sWeapon %d: %s\n", string, i + 1, ReturnWeaponName(FactionData[factionid][factionWeapons][i]));
- else if (FactionData[factionid][factionWeapons][i] && GetFactionType(playerid) == FACTION_GANG)
- format(string, sizeof(string), "%sWeapon %d: %s (%d ammo)\n", string, i + 1, ReturnWeaponName(FactionData[factionid][factionWeapons][i]), FactionData[factionid][factionAmmo][i]);
- else format(string, sizeof(string), "%sEmpty Slot\n", string);
- }
- Dialog_Show(playerid, LockerWeapons, DIALOG_STYLE_LIST, "Locker Weapons", string, "Select", "Cancel");
- }
- }
- }
- }
- return 1;
- }
- Dialog:TrunkLocker(playerid, response, listitem, inputtext[])
- {
- new factionid = PlayerData[playerid][pFaction];
- if (factionid == -1)
- return 0;
- if (response)
- {
- static
- string[512];
- string[0] = 0;
- if (FactionData[factionid][factionType] != FACTION_GANG)
- {
- switch (listitem)
- {
- case 0:
- {
- SetPlayerArmour(playerid, 100.0);
- SetPlayerHealth(playerid, 100.0);
- SendClientMessage(playerid, COLOR_WHITE, "You have filled your health (100.0) and armour (100.0). ");
- }
- case 1:
- {
- for (new i = 0; i < 10; i ++)
- {
- if (FactionData[factionid][factionWeapons][i])
- format(string, sizeof(string), "%sWeapon %d: %s\n", string, i + 1, ReturnWeaponName(FactionData[factionid][factionWeapons][i]));
- else format(string, sizeof(string), "%sEmpty Slot\n", string);
- }
- Dialog_Show(playerid, TrunkWeapons, DIALOG_STYLE_LIST, "Trunk Weapons", string, "Select", "Cancel");
- }
- }
- }
- else
- {
- }
- }
- return 1;
- }
- Dialog:TrunkWeapons(playerid, response, listitem, inputtext[])
- {
- new factionid = PlayerData[playerid][pFaction];
- if (factionid == -1)
- return 0;
- if (response)
- {
- new
- weaponid = FactionData[factionid][factionWeapons][listitem],
- ammo = FactionData[factionid][factionAmmo][listitem];
- if (weaponid)
- {
- if (PlayerHasWeapon(playerid, weaponid))
- return SendErrorMessage(playerid, "You have this weapon equipped already.");
- GiveWeaponToPlayer(playerid, weaponid, ammo);
- SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s reaches inside the trunk and grabs a %s.", ReturnName(playerid, 0), ReturnWeaponName(weaponid));
- if (GetFactionType(playerid) == FACTION_GANG)
- {
- FactionData[factionid][factionWeapons][listitem] = 0;
- FactionData[factionid][factionAmmo][listitem] = 0;
- Faction_Save(factionid);
- }
- }
- else
- {
- if (GetFactionType(playerid) == FACTION_GANG)
- {
- if ((weaponid = GetWeapon(playerid)) == 0)
- return SendErrorMessage(playerid, "You are not holding any weapon.");
- FactionData[factionid][factionWeapons][listitem] = weaponid;
- FactionData[factionid][factionAmmo][listitem] = GetPlayerAmmo(playerid);
- Faction_Save(factionid);
- ResetWeapon(playerid, weaponid);
- SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s takes out a %s and stores it inside the trunk.", ReturnName(playerid, 0), ReturnWeaponName(weaponid));
- }
- else
- {
- SendErrorMessage(playerid, "The selected weapon slot is empty.");
- }
- }
- }
- else {
- cmd_locker(playerid, "\1");
- }
- return 1;
- }
- Dialog:LockerWeapons(playerid, response, listitem, inputtext[])
- {
- new factionid = PlayerData[playerid][pFaction];
- if (factionid == -1 || !IsNearFactionLocker(playerid))
- return 0;
- if (response)
- {
- new
- weaponid = FactionData[factionid][factionWeapons][listitem],
- ammo = FactionData[factionid][factionAmmo][listitem];
- if (weaponid)
- {
- if (PlayerHasWeapon(playerid, weaponid))
- return SendErrorMessage(playerid, "You have this weapon equipped already.");
- GiveWeaponToPlayer(playerid, weaponid, ammo);
- SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s reaches inside the locker and equips a %s.", ReturnName(playerid, 0), ReturnWeaponName(weaponid));
- if (GetFactionType(playerid) == FACTION_GANG)
- {
- FactionData[factionid][factionWeapons][listitem] = 0;
- FactionData[factionid][factionAmmo][listitem] = 0;
- Faction_Save(factionid);
- }
- }
- else
- {
- if (GetFactionType(playerid) == FACTION_GANG)
- {
- if ((weaponid = GetWeapon(playerid)) == 0)
- return SendErrorMessage(playerid, "You are not holding any weapon.");
- FactionData[factionid][factionWeapons][listitem] = weaponid;
- FactionData[factionid][factionAmmo][listitem] = GetPlayerAmmo(playerid);
- Faction_Save(factionid);
- ResetWeapon(playerid, weaponid);
- SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s takes out a %s and stores it in the locker.", ReturnName(playerid, 0), ReturnWeaponName(weaponid));
- }
- else
- {
- SendErrorMessage(playerid, "The selected weapon slot is empty.");
- }
- }
- }
- else {
- cmd_locker(playerid, "\1");
- }
- return 1;
- }
- Dialog:FactionLocker(playerid, response, listitem, inputtext[])
- {
- if (PlayerData[playerid][pFactionEdit] == -1)
- return 0;
- if (response)
- {
- switch (listitem)
- {
- case 0:
- {
- static
- Float:x,
- Float:y,
- Float:z;
- GetPlayerPos(playerid, x, y, z);
- FactionData[PlayerData[playerid][pFactionEdit]][factionLockerPos][0] = x;
- FactionData[PlayerData[playerid][pFactionEdit]][factionLockerPos][1] = y;
- FactionData[PlayerData[playerid][pFactionEdit]][factionLockerPos][2] = z;
- FactionData[PlayerData[playerid][pFactionEdit]][factionLockerInt] = GetPlayerInterior(playerid);
- FactionData[PlayerData[playerid][pFactionEdit]][factionLockerWorld] = GetPlayerVirtualWorld(playerid);
- Faction_Refresh(PlayerData[playerid][pFactionEdit]);
- Faction_Save(PlayerData[playerid][pFactionEdit]);
- SendServerMessage(playerid, "You have adjusted the locker position of faction ID: %d.", PlayerData[playerid][pFactionEdit]);
- }
- case 1:
- {
- static
- string[512];
- string[0] = 0;
- for (new i = 0; i < 10; i ++)
- {
- if (FactionData[PlayerData[playerid][pFactionEdit]][factionWeapons][i])
- format(string, sizeof(string), "%sWeapon %d: %s\n", string, i + 1, ReturnWeaponName(FactionData[PlayerData[playerid][pFactionEdit]][factionWeapons][i]));
- else format(string, sizeof(string), "%sEmpty Slot\n", string);
- }
- Dialog_Show(playerid, FactionWeapons, DIALOG_STYLE_LIST, "Locker Weapons", string, "Select", "Cancel");
- }
- }
- }
- return 1;
- }
- Dialog:FactionWeapons(playerid, response, listitem, inputtext[])
- {
- if (PlayerData[playerid][pFactionEdit] == -1)
- return 0;
- if (response)
- {
- PlayerData[playerid][pSelectedSlot] = listitem;
- Dialog_Show(playerid, FactionWeapon, DIALOG_STYLE_LIST, "Edit Weapon", "Set Weapon (%d)\nSet Ammunition (%d)\nClear Slot", "Select", "Cancel", FactionData[PlayerData[playerid][pFactionEdit]][factionWeapons][PlayerData[playerid][pSelectedSlot]], FactionData[PlayerData[playerid][pFactionEdit]][factionAmmo][PlayerData[playerid][pSelectedSlot]]);
- }
- return 1;
- }
- Dialog:FactionWeapon(playerid, response, listitem, inputtext[])
- {
- if (PlayerData[playerid][pFactionEdit] == -1)
- return 0;
- if (response)
- {
- switch (listitem)
- {
- case 0:
- Dialog_Show(playerid, FactionWeaponID, DIALOG_STYLE_INPUT, "Set Weapon", "Current Weapon: %s (%d)\n\nPlease enter the new weapon ID for slot %d:", "Submit", "Cancel", ReturnWeaponName(FactionData[PlayerData[playerid][pFactionEdit]][factionWeapons][PlayerData[playerid][pSelectedSlot]]), FactionData[PlayerData[playerid][pFactionEdit]][factionWeapons][PlayerData[playerid][pSelectedSlot]], PlayerData[playerid][pSelectedSlot]);
- case 1:
- Dialog_Show(playerid, FactionWeaponAmmo, DIALOG_STYLE_INPUT, "Set Ammunition", "Current Ammo: %d\n\nPlease enter the new ammunition for the weapon in slot %d:", "Submit", "Cancel", FactionData[PlayerData[playerid][pFactionEdit]][factionAmmo][PlayerData[playerid][pSelectedSlot]], PlayerData[playerid][pSelectedSlot]);
- case 2:
- {
- FactionData[PlayerData[playerid][pFactionEdit]][factionWeapons][PlayerData[playerid][pSelectedSlot]] = 0;
- FactionData[PlayerData[playerid][pFactionEdit]][factionAmmo][PlayerData[playerid][pSelectedSlot]] = 0;
- Faction_Save(PlayerData[playerid][pFactionEdit]);
- dialog_FactionLocker(playerid, 1, 1, "\1");
- SendServerMessage(playerid, "You have removed the weapon in slot %d.", PlayerData[playerid][pSelectedSlot] + 1);
- }
- }
- }
- else {
- dialog_FactionLocker(playerid, 1, 1, "\1");
- }
- return 1;
- }
- Dialog:FactionWeaponID(playerid, response, listitem, inputtext[])
- {
- if (PlayerData[playerid][pFactionEdit] == -1)
- return 0;
- if (response)
- {
- new weaponid = strval(inputtext);
- if (isnull(inputtext))
- return Dialog_Show(playerid, FactionWeaponID, DIALOG_STYLE_INPUT, "Set Weapon", "Current Weapon: %s (%d)\n\nPlease enter the new weapon ID for slot %d:", "Submit", "Cancel", ReturnWeaponName(FactionData[PlayerData[playerid][pFactionEdit]][factionWeapons][PlayerData[playerid][pSelectedSlot]]), FactionData[PlayerData[playerid][pFactionEdit]][factionWeapons][PlayerData[playerid][pSelectedSlot]], PlayerData[playerid][pSelectedSlot]);
- if (weaponid < 0 || weaponid > 46)
- return Dialog_Show(playerid, FactionWeaponID, DIALOG_STYLE_INPUT, "Set Weapon", "Error: The weapon ID can't be below 0 or above 46.\n\nCurrent Weapon: %s (%d)\n\nPlease enter the new weapon ID for slot %d:", "Submit", "Cancel", ReturnWeaponName(FactionData[PlayerData[playerid][pFactionEdit]][factionWeapons][PlayerData[playerid][pSelectedSlot]]), FactionData[PlayerData[playerid][pFactionEdit]][factionWeapons][PlayerData[playerid][pSelectedSlot]], PlayerData[playerid][pSelectedSlot]);
- FactionData[PlayerData[playerid][pFactionEdit]][factionWeapons][PlayerData[playerid][pSelectedSlot]] = weaponid;
- Faction_Save(PlayerData[playerid][pFactionEdit]);
- Dialog_Show(playerid, FactionWeapon, DIALOG_STYLE_LIST, "Edit Weapon", "Set Weapon (%d)\nSet Ammunition (%d)\nClear Slot", "Select", "Cancel", FactionData[PlayerData[playerid][pFactionEdit]][factionWeapons][PlayerData[playerid][pSelectedSlot]], FactionData[PlayerData[playerid][pFactionEdit]][factionAmmo][PlayerData[playerid][pSelectedSlot]]);
- if (weaponid) {
- SendServerMessage(playerid, "You have set the weapon in slot %d to %s.", PlayerData[playerid][pSelectedSlot] + 1, ReturnWeaponName(weaponid));
- }
- else {
- SendServerMessage(playerid, "You have removed the weapon in slot %d.", PlayerData[playerid][pSelectedSlot] + 1);
- }
- }
- return 1;
- }
- Dialog:FactionWeaponAmmo(playerid, response, listitem, inputtext[])
- {
- if (PlayerData[playerid][pFactionEdit] == -1)
- return 0;
- if (response)
- {
- new ammo = strval(inputtext);
- if (isnull(inputtext))
- return Dialog_Show(playerid, FactionWeaponAmmo, DIALOG_STYLE_INPUT, "Set Ammunition", "Current Ammo: %d\n\nPlease enter the new ammunition for the weapon in slot %d:", "Submit", "Cancel", FactionData[PlayerData[playerid][pFactionEdit]][factionAmmo][PlayerData[playerid][pSelectedSlot]], PlayerData[playerid][pSelectedSlot]);
- if (ammo < 1 || ammo > 15000)
- return Dialog_Show(playerid, FactionWeaponAmmo, DIALOG_STYLE_INPUT, "Set Ammunition", "Error: The ammo can't be below 1 or above 15,000.\n\nCurrent Ammo: %d\n\nPlease enter the new ammunition for the weapon in slot %d:", "Submit", "Cancel", FactionData[PlayerData[playerid][pFactionEdit]][factionAmmo][PlayerData[playerid][pSelectedSlot]], PlayerData[playerid][pSelectedSlot]);
- FactionData[PlayerData[playerid][pFactionEdit]][factionAmmo][PlayerData[playerid][pSelectedSlot]] = ammo;
- Faction_Save(PlayerData[playerid][pFactionEdit]);
- Dialog_Show(playerid, FactionWeapon, DIALOG_STYLE_LIST, "Edit Weapon", "Set Weapon (%d)\nSet Ammunition (%d)\nClear Slot", "Select", "Cancel", FactionData[PlayerData[playerid][pFactionEdit]][factionWeapons][PlayerData[playerid][pSelectedSlot]], FactionData[PlayerData[playerid][pFactionEdit]][factionAmmo][PlayerData[playerid][pSelectedSlot]]);
- SendServerMessage(playerid, "You have set the ammunition in slot %d to %d.", PlayerData[playerid][pSelectedSlot] + 1, ammo);
- }
- return 1;
- }
- Dialog:FactionSkin(playerid, response, listitem, inputtext[])
- {
- if (PlayerData[playerid][pFactionEdit] == -1)
- return 0;
- if (response)
- {
- static
- skins[311];
- switch (listitem)
- {
- case 0:
- Dialog_Show(playerid, FactionModel, DIALOG_STYLE_INPUT, "Add by Model ID", "Please enter the model ID of the skin below (0-311):", "Add", "Cancel");
- case 1:
- {
- for (new i = 0; i < sizeof(skins); i ++)
- skins[i] = i + 1;
- ShowModelSelectionMenu(playerid, "Add Skin", MODEL_SELECTION_ADD_SKIN, skins, sizeof(skins), -16.0, 0.0, -55.0);
- }
- case 2:
- {
- FactionData[PlayerData[playerid][pFactionEdit]][factionSkins][PlayerData[playerid][pSelectedSlot]] = 0;
- Faction_Save(PlayerData[playerid][pFactionEdit]);
- SendServerMessage(playerid, "You have removed the skin ID in slot %d.", PlayerData[playerid][pSelectedSlot] + 1);
- }
- }
- }
- return 1;
- }
- Dialog:FactionModel(playerid, response, listitem, inputtext[])
- {
- if (PlayerData[playerid][pFactionEdit] == -1)
- return 0;
- if (response)
- {
- new skin = strval(inputtext);
- if (isnull(inputtext))
- return Dialog_Show(playerid, FactionModel, DIALOG_STYLE_INPUT, "Add by Model ID", "Please enter the model ID of the skin below (0-311):", "Add", "Cancel");
- if (skin < 0 || skin > 311)
- return Dialog_Show(playerid, FactionModel, DIALOG_STYLE_INPUT, "Add by Model ID", "Error: The skin ID can't be below 0 or above 311.\n\nPlease enter the model ID of the skin below (0-311):", "Add", "Cancel");
- FactionData[PlayerData[playerid][pFactionEdit]][factionSkins][PlayerData[playerid][pSelectedSlot]] = skin;
- Faction_Save(PlayerData[playerid][pFactionEdit]);
- if (skin) {
- SendServerMessage(playerid, "You have set the skin ID in slot %d to %d.", PlayerData[playerid][pSelectedSlot] + 1, skin);
- }
- else {
- SendServerMessage(playerid, "You have removed the skin ID in slot %d.", PlayerData[playerid][pSelectedSlot] + 1);
- }
- }
- return 1;
- }
- Dialog:RestrictedFrequencies(playerid, response, listitem, inputtext[])
- {
- /*
- case 0: str = "PD";
- case 1: str = "FD";
- case 2: str = "GOV";
- */
- if (response)
- {
- switch (listitem)
- {
- case 0:
- Dialog_Show(playerid, RestrictedFrequencies, DIALOG_STYLE_MSGBOX, "Police Department", "The Radio Frequency of the Police Department is 9-1-1.", "Close", "Back");
- case 1:
- Dialog_Show(playerid, RestrictedFrequencies, DIALOG_STYLE_MSGBOX, "Fire Department", "The Radio Frequency of the Fire Department is 9-1-2.", "Close", "Back");
- case 2:
- Dialog_Show(playerid, RestrictedFrequencies, DIALOG_STYLE_MSGBOX, "San Andreas Government", "The Radio Frequency of the San Andreas Government is 9-1-3.", "Close", "Back");
- }
- }
- return 1;
- }
- Dialog:ACC_POLICE(playerid, response, listitem, inputtext[])
- {
- if (response)
- {
- switch (listitem)
- {
- case 0:
- SetPlayerAttachedObject(playerid,1,19142,1,0.1,0.05,0.0,0.0,0.0,0.0),
- SendClientMessage(playerid, COLOR_WHITE,"You have equiped your Kevlar Vest.");
- case 1:
- SetPlayerAttachedObject(playerid,2,19141,2,0.11,0.0,0.0,0.0,0.0,0.0),
- SendClientMessage(playerid, COLOR_WHITE,"You have equiped your Police Helmet.");
- case 2:
- SetPlayerAttachedObject(playerid,3,18637,13,0.35,0.0,0.0,0.0,0.0,180.0),
- SendClientMessage(playerid, COLOR_WHITE,"You have equiped your Police Shield.");
- case 3:
- SetPlayerAttachedObject(playerid,4,18642,7,0.1,0.0,-0.11,0.0,-90.0,90.0),
- SendClientMessage(playerid, COLOR_WHITE,"You have equiped your Police Taser.");
- case 4:
- SetPlayerAttachedObject(playerid,1,19515,1,0.1,0.05,0.0,0.0,0.0,0.0),
- SendClientMessage(playerid, COLOR_WHITE,"You have equiped your Grey SWAT Vest.");
- case 5:
- SetPlayerAttachedObject(playerid,2,19514,2,0.11,0.0,0.0,0.0,0.0,0.0),
- SendClientMessage(playerid, COLOR_WHITE,"You have equiped your Grey SWAT Helmet");
- }
- }
- return 1;
- }
- Dialog:AddVehicleModel(playerid, response, listitem, inputtext[])
- {
- if (response)
- {
- new id = PlayerData[playerid][pDealership];
- if (id != -1 && BusinessData[id][bizExists] && BusinessData[id][bizType] == 5)
- {
- if (isnull(inputtext))
- return Dialog_Show(playerid, AddVehicleModel, DIALOG_STYLE_INPUT, "Add Vehicle", "Please enter the name or the ID of the vehicle model:", "Add", "Cancel");
- new model = GetVehicleModelByName(inputtext);
- if (!model)
- return Dialog_Show(playerid, AddVehicleModel, DIALOG_STYLE_INPUT, "Add Vehicle", "Error: Invalid model specified.\n\nPlease enter the name or the ID of the vehicle model:", "Add", "Cancel");
- for (new i = 0; i != MAX_DEALERSHIP_CARS; i ++)
- {
- if (DealershipCars[id][i][vehModel] == model)
- return Dialog_Show(playerid, AddVehicleModel, DIALOG_STYLE_INPUT, "Add Vehicle", "Error: This model is already sold at this dealership.\n\nPlease enter the name or the ID of the vehicle model:", "Add", "Cancel");
- }
- PlayerData[playerid][pDealerCar] = model;
- Dialog_Show(playerid, DealerCarPrice, DIALOG_STYLE_INPUT, "Enter Price", "Please enter a price for '%s':", "Submit", "Cancel", ReturnVehicleModelName(PlayerData[playerid][pDealerCar]));
- }
- }
- return 1;
- }
- Dialog:AddVehicle(playerid, response, listitem, inputtext[])
- {
- if (response)
- {
- new id = PlayerData[playerid][pDealership];
- if (id != -1 && BusinessData[id][bizExists] && BusinessData[id][bizType] == 5)
- {
- if (!listitem)
- {
- Dialog_Show(playerid, AddVehicleModel, DIALOG_STYLE_INPUT, "Add Vehicle", "Please enter the name or the ID of the vehicle model:", "Add", "Cancel");
- }
- else
- {
- static
- cars[212];
- for (new i = 0; i < sizeof(cars); i ++)
- cars[i] = i + 400;
- ShowModelSelectionMenu(playerid, "Add Vehicle", MODEL_SELECTION_DEALER_ADD, cars, sizeof(cars), -16.0, 0.0, -55.0);
- }
- }
- }
- return 1;
- }
- Dialog:EnterNumber(playerid, response, listitem, inputtext[])
- {
- if (response)
- {
- static
- name[32],
- string[128];
- strunpack(name, PlayerData[playerid][pEditingItem]);
- if (isnull(inputtext) || !IsNumeric(inputtext))
- return Dialog_Show(playerid, EnterNumber, DIALOG_STYLE_INPUT, "Contact Number", "Contact Name: %s\n\nPlease enter the phone number for this contact:", "Submit", "Back", name);
- for (new i = 0; i != MAX_CONTACTS; i ++)
- {
- if (!ContactData[playerid][i][contactExists])
- {
- ContactData[playerid][i][contactExists] = true;
- ContactData[playerid][i][contactNumber] = strval(inputtext);
- format(ContactData[playerid][i][contactName], 32, name);
- format(string, sizeof(string), "INSERT INTO `contacts` (`ID`, `contactName`, `contactNumber`) VALUES('%d', '%s', '%d')", PlayerData[playerid][pID], SQL_ReturnEscaped(name), ContactData[playerid][i][contactNumber]);
- mysql_tquery(g_iHandle, string, "OnContactAdd", "dd", playerid, i);
- SendServerMessage(playerid, "You have added \"%s\" to your contacts.", name);
- return 1;
- }
- }
- SendErrorMessage(playerid, "There is no room left for anymore contacts.");
- }
- else {
- ShowContacts(playerid);
- }
- return 1;
- }
- Dialog:NewContact(playerid, response, listitem, inputtext[])
- {
- if (response)
- {
- if (isnull(inputtext))
- return Dialog_Show(playerid, NewContact, DIALOG_STYLE_INPUT, "New Contact", "Error: Please enter a contact name.\n\nPlease enter the name of the contact below:", "Submit", "Back");
- if (strlen(inputtext) > 32)
- return Dialog_Show(playerid, NewContact, DIALOG_STYLE_INPUT, "New Contact", "Error: The contact name can't exceed 32 characters.\n\nPlease enter the name of the contact below:", "Submit", "Back");
- strpack(PlayerData[playerid][pEditingItem], inputtext, 32);
- Dialog_Show(playerid, EnterNumber, DIALOG_STYLE_INPUT, "Contact Number", "Contact Name: %s\n\nPlease enter the phone number for this contact:", "Submit", "Back", inputtext);
- }
- else {
- ShowContacts(playerid);
- }
- return 1;
- }
- Dialog:ContactInfo(playerid, response, listitem, inputtext[])
- {
- if (response)
- {
- new
- id = PlayerData[playerid][pContact],
- string[72];
- switch (listitem)
- {
- case 0:
- {
- format(string, 16, "%d", ContactData[playerid][id][contactNumber]);
- cmd_call(playerid, string);
- }
- case 1:
- {
- format(string, sizeof(string), "DELETE FROM `contacts` WHERE `ID` = '%d' AND `contactID` = '%d'", PlayerData[playerid][pID], ContactData[playerid][id][contactID]);
- mysql_tquery(g_iHandle, string);
- SendServerMessage(playerid, "You have deleted \"%s\" from your contacts.", ContactData[playerid][id][contactName]);
- ContactData[playerid][id][contactExists] = false;
- ContactData[playerid][id][contactNumber] = 0;
- ContactData[playerid][id][contactID] = 0;
- ShowContacts(playerid);
- }
- }
- }
- else {
- ShowContacts(playerid);
- }
- return 1;
- }
- Dialog:Contacts(playerid, response, listitem, inputtext[])
- {
- if (response)
- {
- if (!listitem) {
- Dialog_Show(playerid, NewContact, DIALOG_STYLE_INPUT, "New Contact", "Please enter the name of the contact below:", "Submit", "Back");
- }
- else {
- PlayerData[playerid][pContact] = ListedContacts[playerid][listitem - 1];
- Dialog_Show(playerid, ContactInfo, DIALOG_STYLE_LIST, ContactData[playerid][PlayerData[playerid][pContact]][contactName], "Call Contact\nDelete Contact", "Select", "Back");
- }
- }
- else {
- cmd_phone(playerid, "\1");
- }
- for (new i = 0; i != MAX_CONTACTS; i ++) {
- ListedContacts[playerid][i] = -1;
- }
- return 1;
- }
- Dialog:DialNumber(playerid, response, listitem, inputtext[])
- {
- if (response)
- {
- new
- string[16];
- if (isnull(inputtext) || !IsNumeric(inputtext))
- return Dialog_Show(playerid, DialNumber, DIALOG_STYLE_INPUT, "Dial Number", "Please enter the number that you wish to dial below:", "Dial", "Back");
- format(string, 16, "%d", strval(inputtext));
- cmd_call(playerid, string);
- }
- else {
- cmd_phone(playerid, "\1");
- }
- return 1;
- }
- Dialog:SendText(playerid, response, listitem, inputtext[])
- {
- if (response)
- {
- new number = strval(inputtext);
- if (isnull(inputtext) || !IsNumeric(inputtext))
- return Dialog_Show(playerid, SendText, DIALOG_STYLE_INPUT, "Send Text Message", "Please enter the number that you wish to send a text message to:", "Dial", "Back");
- if (GetNumberOwner(number) == INVALID_PLAYER_ID)
- return Dialog_Show(playerid, SendText, DIALOG_STYLE_INPUT, "Send Text Message", "Error: That number is not online right now.\n\nPlease enter the number that you wish to send a text message to:", "Dial", "Back");
- PlayerData[playerid][pContact] = GetNumberOwner(number);
- Dialog_Show(playerid, TextMessage, DIALOG_STYLE_INPUT, "Text Message", "Please enter the message to send to %s:", "Send", "Back", ReturnName(PlayerData[playerid][pContact], 0));
- }
- else {
- cmd_phone(playerid, "\1");
- }
- return 1;
- }
- Dialog:TextMessage(playerid, response, listitem, inputtext[])
- {
- if (response)
- {
- if (isnull(inputtext))
- return Dialog_Show(playerid, TextMessage, DIALOG_STYLE_INPUT, "Text Message", "Error: Please enter a message to send.\n\nPlease enter the message to send to %s:", "Send", "Back", ReturnName(PlayerData[playerid][pContact], 0));
- new targetid = PlayerData[playerid][pContact];
- if (!IsPlayerConnected(targetid) || !PlayerData[targetid][pPhone])
- return SendErrorMessage(playerid, "The specified phone number went offline.");
- GiveMoney(playerid, -1);
- ShowPlayerFooter(playerid, "You've been ~r~charged~w~ $1 to send a text.");
- SendClientMessageEx(targetid, COLOR_YELLOW, "[TEXT]: %s - %s (%d)", inputtext, ReturnName(playerid, 0), PlayerData[playerid][pPhone]);
- SendClientMessageEx(playerid, COLOR_YELLOW, "[TEXT]: %s - %s (%d)", inputtext, ReturnName(playerid, 0), PlayerData[playerid][pPhone]);
- PlayerPlaySoundEx(targetid, 21001);
- SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s takes out their phone and sends a text.", ReturnName(playerid, 0));
- }
- else {
- Dialog_Show(playerid, SendText, DIALOG_STYLE_INPUT, "Send Text Message", "Please enter the number that you wish to send a text message to:", "Submit", "Back");
- }
- return 1;
- }
- Dialog:MyPhone(playerid, response, listitem, inputtext[])
- {
- if (response)
- {
- switch (listitem)
- {
- case 0:
- {
- if (PlayerData[playerid][pPhoneOff])
- return SendErrorMessage(playerid, "Your phone must be powered on.");
- Dialog_Show(playerid, DialNumber, DIALOG_STYLE_INPUT, "Dial Number", "Please enter the number that you wish to dial below:", "Dial", "Back");
- }
- case 1:
- {
- if (PlayerData[playerid][pPhoneOff])
- return SendErrorMessage(playerid, "Your phone must be powered on.");
- ShowContacts(playerid);
- }
- case 2:
- {
- if (PlayerData[playerid][pPhoneOff])
- return SendErrorMessage(playerid, "Your phone must be powered on.");
- Dialog_Show(playerid, SendText, DIALOG_STYLE_INPUT, "Send Text Message", "Please enter the number that you wish to send a text message to:", "Dial", "Back");
- }
- case 3:
- {
- if (!PlayerData[playerid][pPhoneOff])
- {
- if (PlayerData[playerid][pCallLine] != INVALID_PLAYER_ID) {
- CancelCall(playerid);
- }
- PlayerData[playerid][pPhoneOff] = 1;
- SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s has powered off their cellphone.", ReturnName(playerid, 0));
- }
- else
- {
- PlayerData[playerid][pPhoneOff] = 0;
- SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s has powered on their cellphone.", ReturnName(playerid, 0));
- }
- }
- }
- }
- return 1;
- }
- Dialog:ListedFurniture(playerid, response, listitem, inputtext[])
- {
- if (response)
- {
- new id = House_Inside(playerid);
- if (id != -1 && House_IsOwner(playerid, id))
- {
- PlayerData[playerid][pEditFurniture] = ListedFurniture[playerid][listitem];
- Dialog_Show(playerid, FurnitureList, DIALOG_STYLE_LIST, FurnitureData[PlayerData[playerid][pEditFurniture]][furnitureName], "Edit Position\nPickup Furniture\nDestroy Furniture", "Select", "Cancel");
- }
- }
- for (new i = 0; i != MAX_FURNITURE; i ++) {
- ListedFurniture[playerid][i] = -1;
- }
- return 1;
- }
- Dialog:FurnitureList(playerid, response, listitem, inputtext[])
- {
- if (response)
- {
- new id = House_Inside(playerid);
- if (id != -1 && House_IsOwner(playerid, id))
- {
- switch (listitem)
- {
- case 0:
- {
- EditDynamicObject(playerid, FurnitureData[PlayerData[playerid][pEditFurniture]][furnitureObject]);
- SendServerMessage(playerid, "You are now editing the position of item \"%s\".", FurnitureData[PlayerData[playerid][pEditFurniture]][furnitureName]);
- }
- case 1:
- {
- new item = Inventory_Add(playerid, FurnitureData[PlayerData[playerid][pEditFurniture]][furnitureName], FurnitureData[PlayerData[playerid][pEditFurniture]][furnitureModel]);
- if (item == -1)
- return SendErrorMessage(playerid, "You don't have any inventory slots left.");
- SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s has picked up \"%s\".", ReturnName(playerid, 0), FurnitureData[PlayerData[playerid][pEditFurniture]][furnitureName]);
- SendServerMessage(playerid, "You have picked up your \"%s\". The item was added to your inventory.", FurnitureData[PlayerData[playerid][pEditFurniture]][furnitureName]);
- Furniture_Delete(PlayerData[playerid][pEditFurniture]);
- CancelEdit(playerid);
- PlayerData[playerid][pEditFurniture] = -1;
- }
- case 2:
- {
- Furniture_Delete(PlayerData[playerid][pEditFurniture]);
- SendServerMessage(playerid, "You have destroyed furniture \"%s\".", FurnitureData[PlayerData[playerid][pEditFurniture]][furnitureName]);
- CancelEdit(playerid);
- PlayerData[playerid][pEditFurniture] = -1;
- }
- }
- }
- else {
- PlayerData[playerid][pEditFurniture] = -1;
- }
- }
- else {
- PlayerData[playerid][pEditFurniture] = -1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement