Advertisement
Jeckoz

schiavi

Oct 28th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 35.23 KB | None | 0 0
  1. Dialog:LicensesPurchase(playerid, response, listitem, inputtext[])
  2. {
  3. if (response)
  4. {
  5. switch (listitem)
  6. {
  7. case 0:
  8. {
  9. if (Inventory_HasItem(playerid, "Car License"))
  10. return SendErrorMessage(playerid, "You already have a Car License.");
  11.  
  12. Inventory_Add(playerid, "Car License", 1581);
  13. SendClientMessage(playerid, COLOR_ORANGE, "[LICENSE DEPARTMENT]: You have paid and received your Car License. You are now allowed to operate a Car.");
  14. GiveMoney(playerid, -100);
  15. }
  16. case 1:
  17. {
  18. if (Inventory_HasItem(playerid, "Truck License"))
  19. return SendErrorMessage(playerid, "You already have a Truck License.");
  20.  
  21. Inventory_Add(playerid, "Truck License", 1581);
  22. SendClientMessage(playerid, COLOR_ORANGE, "[LICENSE DEPARTMENT]: You have paid and received your Truck License. You are now allowed to operate a Truck.");
  23. GiveMoney(playerid, -200);
  24. }
  25. case 2:
  26. {
  27. if (Inventory_HasItem(playerid, "Motorbike License"))
  28. return SendErrorMessage(playerid, "You already have a Motorbike License.");
  29.  
  30. Inventory_Add(playerid, "Motorbike License", 1581);
  31. SendClientMessage(playerid, COLOR_ORANGE, "[LICENSE DEPARTMENT]: You have paid and received your Motorbike License. You are now allowed to operate a Motorbike.");
  32. GiveMoney(playerid, -150);
  33. }
  34. case 3:
  35. {
  36. if (Inventory_HasItem(playerid, "Airplane License"))
  37. return SendErrorMessage(playerid, "You already have an Airplane License.");
  38.  
  39. Inventory_Add(playerid, "Airplane License", 1581);
  40. SendClientMessage(playerid, COLOR_ORANGE, "[LICENSE DEPARTMENT]: You have paid and received your Airplane License. You are now allowed to operate a Airplane.");
  41. GiveMoney(playerid, -1000);
  42. }
  43. case 4:
  44. {
  45. if (Inventory_HasItem(playerid, "Helicopter License"))
  46. return SendErrorMessage(playerid, "You already have a Helicopter License.");
  47.  
  48. Inventory_Add(playerid, "Helicopter License", 1581);
  49. SendClientMessage(playerid, COLOR_ORANGE, "[LICENSE DEPARTMENT]: You have paid and received your Helicopter License. You are now allowed to operate a Helicopter.");
  50. GiveMoney(playerid, -1000);
  51. }
  52. }
  53. }
  54. return 1;
  55. }
  56.  
  57. Dialog:ViewCharges(playerid, response, listitem, inputtext[])
  58. {
  59. if (GetFactionType(playerid) != FACTION_POLICE || !IsACruiser(GetPlayerVehicleID(playerid)))
  60. return 0;
  61.  
  62. if (response)
  63. {
  64. if (isnull(inputtext) || strlen(inputtext) > 24)
  65. return Dialog_Show(playerid, ViewCharges, DIALOG_STYLE_INPUT, "View Charges", "Please enter the name or ID of the player:", "Submit", "Back");
  66.  
  67. if (IsNumeric(inputtext) && IsPlayerConnected(strval(inputtext))) {
  68. ViewCharges(playerid, ReturnName(strval(inputtext)));
  69. }
  70. else if (!IsNumeric(inputtext)) {
  71. ViewCharges(playerid, inputtext);
  72. }
  73. else {
  74. 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");
  75. }
  76. }
  77. else cmd_mdc(playerid, "\1");
  78. return 1;
  79. }
  80.  
  81. Dialog:Locker(playerid, response, listitem, inputtext[])
  82. {
  83. new factionid = PlayerData[playerid][pFaction];
  84.  
  85. if (factionid == -1 || !IsNearFactionLocker(playerid))
  86. return 0;
  87.  
  88. if (response)
  89. {
  90. static
  91. skins[8],
  92. string[512];
  93.  
  94. string[0] = 0;
  95.  
  96. if (FactionData[factionid][factionType] != FACTION_GANG)
  97. {
  98. switch (listitem)
  99. {
  100. case 0:
  101. {
  102. if (!PlayerData[playerid][pOnDuty])
  103. {
  104. PlayerData[playerid][pOnDuty] = true;
  105. SetPlayerArmour(playerid, 100.0);
  106.  
  107. SetFactionColor(playerid);
  108. SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s has clocked in and is now on duty.", ReturnName(playerid, 0));
  109. SendFactionMessage(factionid, COLOR_FACTIONCHAT, "**DISPATCH: %s %s is now On Duty.**", Faction_GetRank(playerid), ReturnName(playerid, 0));
  110. }
  111. else
  112. {
  113. PlayerData[playerid][pOnDuty] = false;
  114. SetPlayerArmour(playerid, 0.0);
  115.  
  116. SetPlayerColor(playerid, DEFAULT_COLOR);
  117. SetPlayerSkin(playerid, PlayerData[playerid][pSkin]);
  118.  
  119. SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s has clocked out and is now off duty.", ReturnName(playerid, 0));
  120. SendFactionMessage(factionid, COLOR_FACTIONCHAT, "**DISPATCH: %s %s is now Off Duty.**", Faction_GetRank(playerid), ReturnName(playerid, 0));
  121. }
  122. }
  123. case 1:
  124. {
  125. SetPlayerArmour(playerid, 100.0);
  126. SetPlayerHealth(playerid, 100.0);
  127. SendClientMessage(playerid, COLOR_WHITE, "You have filled your health (100.0) and armour (100.0). ");
  128. }
  129. case 2:
  130. {
  131. for (new i = 0; i < sizeof(skins); i ++)
  132. skins[i] = (FactionData[factionid][factionSkins][i]) ? (FactionData[factionid][factionSkins][i]) : (19300);
  133.  
  134. ShowModelSelectionMenu(playerid, "Choose Skin", MODEL_SELECTION_FACTION_SKIN, skins, sizeof(skins), -16.0, 0.0, -55.0);
  135. }
  136. case 3:
  137. {
  138. for (new i = 0; i < 10; i ++)
  139. {
  140. if (FactionData[factionid][factionWeapons][i])
  141. format(string, sizeof(string), "%sWeapon %d: %s\n", string, i + 1, ReturnWeaponName(FactionData[factionid][factionWeapons][i]));
  142.  
  143. else format(string, sizeof(string), "%sEmpty Slot\n", string);
  144. }
  145. Dialog_Show(playerid, LockerWeapons, DIALOG_STYLE_LIST, "Locker Weapons", string, "Select", "Cancel");
  146. }
  147. }
  148. }
  149. else
  150. {
  151. switch (listitem)
  152. {
  153. case 0:
  154. {
  155. for (new i = 0; i < sizeof(skins); i ++)
  156. skins[i] = (FactionData[factionid][factionSkins][i]) ? (FactionData[factionid][factionSkins][i]) : (19300);
  157.  
  158. ShowModelSelectionMenu(playerid, "Choose Skin", MODEL_SELECTION_FACTION_SKIN, skins, sizeof(skins), -16.0, 0.0, -55.0);
  159. }
  160. case 1:
  161. {
  162. for (new i = 0; i < 10; i ++)
  163. {
  164. if (FactionData[factionid][factionWeapons][i] && GetFactionType(playerid) != FACTION_GANG)
  165. format(string, sizeof(string), "%sWeapon %d: %s\n", string, i + 1, ReturnWeaponName(FactionData[factionid][factionWeapons][i]));
  166.  
  167. else if (FactionData[factionid][factionWeapons][i] && GetFactionType(playerid) == FACTION_GANG)
  168. format(string, sizeof(string), "%sWeapon %d: %s (%d ammo)\n", string, i + 1, ReturnWeaponName(FactionData[factionid][factionWeapons][i]), FactionData[factionid][factionAmmo][i]);
  169.  
  170. else format(string, sizeof(string), "%sEmpty Slot\n", string);
  171. }
  172. Dialog_Show(playerid, LockerWeapons, DIALOG_STYLE_LIST, "Locker Weapons", string, "Select", "Cancel");
  173. }
  174. }
  175. }
  176. }
  177. return 1;
  178. }
  179.  
  180. Dialog:TrunkLocker(playerid, response, listitem, inputtext[])
  181. {
  182. new factionid = PlayerData[playerid][pFaction];
  183.  
  184. if (factionid == -1)
  185. return 0;
  186.  
  187. if (response)
  188. {
  189. static
  190. string[512];
  191.  
  192. string[0] = 0;
  193.  
  194. if (FactionData[factionid][factionType] != FACTION_GANG)
  195. {
  196. switch (listitem)
  197. {
  198. case 0:
  199. {
  200. SetPlayerArmour(playerid, 100.0);
  201. SetPlayerHealth(playerid, 100.0);
  202. SendClientMessage(playerid, COLOR_WHITE, "You have filled your health (100.0) and armour (100.0). ");
  203. }
  204. case 1:
  205. {
  206. for (new i = 0; i < 10; i ++)
  207. {
  208. if (FactionData[factionid][factionWeapons][i])
  209. format(string, sizeof(string), "%sWeapon %d: %s\n", string, i + 1, ReturnWeaponName(FactionData[factionid][factionWeapons][i]));
  210.  
  211. else format(string, sizeof(string), "%sEmpty Slot\n", string);
  212. }
  213. Dialog_Show(playerid, TrunkWeapons, DIALOG_STYLE_LIST, "Trunk Weapons", string, "Select", "Cancel");
  214. }
  215. }
  216. }
  217. else
  218. {
  219. }
  220. }
  221. return 1;
  222. }
  223.  
  224. Dialog:TrunkWeapons(playerid, response, listitem, inputtext[])
  225. {
  226. new factionid = PlayerData[playerid][pFaction];
  227.  
  228. if (factionid == -1)
  229. return 0;
  230.  
  231. if (response)
  232. {
  233. new
  234. weaponid = FactionData[factionid][factionWeapons][listitem],
  235. ammo = FactionData[factionid][factionAmmo][listitem];
  236.  
  237. if (weaponid)
  238. {
  239. if (PlayerHasWeapon(playerid, weaponid))
  240. return SendErrorMessage(playerid, "You have this weapon equipped already.");
  241.  
  242. GiveWeaponToPlayer(playerid, weaponid, ammo);
  243. SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s reaches inside the trunk and grabs a %s.", ReturnName(playerid, 0), ReturnWeaponName(weaponid));
  244.  
  245. if (GetFactionType(playerid) == FACTION_GANG)
  246. {
  247. FactionData[factionid][factionWeapons][listitem] = 0;
  248. FactionData[factionid][factionAmmo][listitem] = 0;
  249.  
  250. Faction_Save(factionid);
  251. }
  252. }
  253. else
  254. {
  255. if (GetFactionType(playerid) == FACTION_GANG)
  256. {
  257. if ((weaponid = GetWeapon(playerid)) == 0)
  258. return SendErrorMessage(playerid, "You are not holding any weapon.");
  259.  
  260. FactionData[factionid][factionWeapons][listitem] = weaponid;
  261. FactionData[factionid][factionAmmo][listitem] = GetPlayerAmmo(playerid);
  262.  
  263. Faction_Save(factionid);
  264.  
  265. ResetWeapon(playerid, weaponid);
  266. SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s takes out a %s and stores it inside the trunk.", ReturnName(playerid, 0), ReturnWeaponName(weaponid));
  267. }
  268. else
  269. {
  270. SendErrorMessage(playerid, "The selected weapon slot is empty.");
  271. }
  272. }
  273. }
  274. else {
  275. cmd_locker(playerid, "\1");
  276. }
  277. return 1;
  278. }
  279.  
  280. Dialog:LockerWeapons(playerid, response, listitem, inputtext[])
  281. {
  282. new factionid = PlayerData[playerid][pFaction];
  283.  
  284. if (factionid == -1 || !IsNearFactionLocker(playerid))
  285. return 0;
  286.  
  287. if (response)
  288. {
  289. new
  290. weaponid = FactionData[factionid][factionWeapons][listitem],
  291. ammo = FactionData[factionid][factionAmmo][listitem];
  292.  
  293. if (weaponid)
  294. {
  295. if (PlayerHasWeapon(playerid, weaponid))
  296. return SendErrorMessage(playerid, "You have this weapon equipped already.");
  297.  
  298. GiveWeaponToPlayer(playerid, weaponid, ammo);
  299. SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s reaches inside the locker and equips a %s.", ReturnName(playerid, 0), ReturnWeaponName(weaponid));
  300.  
  301. if (GetFactionType(playerid) == FACTION_GANG)
  302. {
  303. FactionData[factionid][factionWeapons][listitem] = 0;
  304. FactionData[factionid][factionAmmo][listitem] = 0;
  305.  
  306. Faction_Save(factionid);
  307. }
  308. }
  309. else
  310. {
  311. if (GetFactionType(playerid) == FACTION_GANG)
  312. {
  313. if ((weaponid = GetWeapon(playerid)) == 0)
  314. return SendErrorMessage(playerid, "You are not holding any weapon.");
  315.  
  316. FactionData[factionid][factionWeapons][listitem] = weaponid;
  317. FactionData[factionid][factionAmmo][listitem] = GetPlayerAmmo(playerid);
  318.  
  319. Faction_Save(factionid);
  320.  
  321. ResetWeapon(playerid, weaponid);
  322. SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s takes out a %s and stores it in the locker.", ReturnName(playerid, 0), ReturnWeaponName(weaponid));
  323. }
  324. else
  325. {
  326. SendErrorMessage(playerid, "The selected weapon slot is empty.");
  327. }
  328. }
  329. }
  330. else {
  331. cmd_locker(playerid, "\1");
  332. }
  333. return 1;
  334. }
  335.  
  336. Dialog:FactionLocker(playerid, response, listitem, inputtext[])
  337. {
  338. if (PlayerData[playerid][pFactionEdit] == -1)
  339. return 0;
  340.  
  341. if (response)
  342. {
  343. switch (listitem)
  344. {
  345. case 0:
  346. {
  347. static
  348. Float:x,
  349. Float:y,
  350. Float:z;
  351.  
  352. GetPlayerPos(playerid, x, y, z);
  353.  
  354. FactionData[PlayerData[playerid][pFactionEdit]][factionLockerPos][0] = x;
  355. FactionData[PlayerData[playerid][pFactionEdit]][factionLockerPos][1] = y;
  356. FactionData[PlayerData[playerid][pFactionEdit]][factionLockerPos][2] = z;
  357.  
  358. FactionData[PlayerData[playerid][pFactionEdit]][factionLockerInt] = GetPlayerInterior(playerid);
  359. FactionData[PlayerData[playerid][pFactionEdit]][factionLockerWorld] = GetPlayerVirtualWorld(playerid);
  360.  
  361. Faction_Refresh(PlayerData[playerid][pFactionEdit]);
  362. Faction_Save(PlayerData[playerid][pFactionEdit]);
  363. SendServerMessage(playerid, "You have adjusted the locker position of faction ID: %d.", PlayerData[playerid][pFactionEdit]);
  364. }
  365. case 1:
  366. {
  367. static
  368. string[512];
  369.  
  370. string[0] = 0;
  371.  
  372. for (new i = 0; i < 10; i ++)
  373. {
  374. if (FactionData[PlayerData[playerid][pFactionEdit]][factionWeapons][i])
  375. format(string, sizeof(string), "%sWeapon %d: %s\n", string, i + 1, ReturnWeaponName(FactionData[PlayerData[playerid][pFactionEdit]][factionWeapons][i]));
  376.  
  377. else format(string, sizeof(string), "%sEmpty Slot\n", string);
  378. }
  379. Dialog_Show(playerid, FactionWeapons, DIALOG_STYLE_LIST, "Locker Weapons", string, "Select", "Cancel");
  380. }
  381. }
  382. }
  383. return 1;
  384. }
  385.  
  386. Dialog:FactionWeapons(playerid, response, listitem, inputtext[])
  387. {
  388. if (PlayerData[playerid][pFactionEdit] == -1)
  389. return 0;
  390.  
  391. if (response)
  392. {
  393. PlayerData[playerid][pSelectedSlot] = listitem;
  394. 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]]);
  395. }
  396. return 1;
  397. }
  398.  
  399. Dialog:FactionWeapon(playerid, response, listitem, inputtext[])
  400. {
  401. if (PlayerData[playerid][pFactionEdit] == -1)
  402. return 0;
  403.  
  404. if (response)
  405. {
  406. switch (listitem)
  407. {
  408. case 0:
  409. 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]);
  410.  
  411. case 1:
  412. 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]);
  413.  
  414. case 2:
  415. {
  416. FactionData[PlayerData[playerid][pFactionEdit]][factionWeapons][PlayerData[playerid][pSelectedSlot]] = 0;
  417. FactionData[PlayerData[playerid][pFactionEdit]][factionAmmo][PlayerData[playerid][pSelectedSlot]] = 0;
  418.  
  419. Faction_Save(PlayerData[playerid][pFactionEdit]);
  420.  
  421. dialog_FactionLocker(playerid, 1, 1, "\1");
  422. SendServerMessage(playerid, "You have removed the weapon in slot %d.", PlayerData[playerid][pSelectedSlot] + 1);
  423. }
  424. }
  425. }
  426. else {
  427. dialog_FactionLocker(playerid, 1, 1, "\1");
  428. }
  429. return 1;
  430. }
  431.  
  432. Dialog:FactionWeaponID(playerid, response, listitem, inputtext[])
  433. {
  434. if (PlayerData[playerid][pFactionEdit] == -1)
  435. return 0;
  436.  
  437. if (response)
  438. {
  439. new weaponid = strval(inputtext);
  440.  
  441. if (isnull(inputtext))
  442. 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]);
  443.  
  444. if (weaponid < 0 || weaponid > 46)
  445. 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]);
  446.  
  447. FactionData[PlayerData[playerid][pFactionEdit]][factionWeapons][PlayerData[playerid][pSelectedSlot]] = weaponid;
  448. Faction_Save(PlayerData[playerid][pFactionEdit]);
  449.  
  450. 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]]);
  451.  
  452. if (weaponid) {
  453. SendServerMessage(playerid, "You have set the weapon in slot %d to %s.", PlayerData[playerid][pSelectedSlot] + 1, ReturnWeaponName(weaponid));
  454. }
  455. else {
  456. SendServerMessage(playerid, "You have removed the weapon in slot %d.", PlayerData[playerid][pSelectedSlot] + 1);
  457. }
  458. }
  459. return 1;
  460. }
  461.  
  462. Dialog:FactionWeaponAmmo(playerid, response, listitem, inputtext[])
  463. {
  464. if (PlayerData[playerid][pFactionEdit] == -1)
  465. return 0;
  466.  
  467. if (response)
  468. {
  469. new ammo = strval(inputtext);
  470.  
  471. if (isnull(inputtext))
  472. 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]);
  473.  
  474. if (ammo < 1 || ammo > 15000)
  475. 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]);
  476.  
  477. FactionData[PlayerData[playerid][pFactionEdit]][factionAmmo][PlayerData[playerid][pSelectedSlot]] = ammo;
  478. Faction_Save(PlayerData[playerid][pFactionEdit]);
  479.  
  480. 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]]);
  481. SendServerMessage(playerid, "You have set the ammunition in slot %d to %d.", PlayerData[playerid][pSelectedSlot] + 1, ammo);
  482. }
  483. return 1;
  484. }
  485.  
  486. Dialog:FactionSkin(playerid, response, listitem, inputtext[])
  487. {
  488. if (PlayerData[playerid][pFactionEdit] == -1)
  489. return 0;
  490.  
  491. if (response)
  492. {
  493. static
  494. skins[311];
  495.  
  496. switch (listitem)
  497. {
  498. case 0:
  499. Dialog_Show(playerid, FactionModel, DIALOG_STYLE_INPUT, "Add by Model ID", "Please enter the model ID of the skin below (0-311):", "Add", "Cancel");
  500.  
  501. case 1:
  502. {
  503. for (new i = 0; i < sizeof(skins); i ++)
  504. skins[i] = i + 1;
  505.  
  506. ShowModelSelectionMenu(playerid, "Add Skin", MODEL_SELECTION_ADD_SKIN, skins, sizeof(skins), -16.0, 0.0, -55.0);
  507. }
  508. case 2:
  509. {
  510. FactionData[PlayerData[playerid][pFactionEdit]][factionSkins][PlayerData[playerid][pSelectedSlot]] = 0;
  511.  
  512. Faction_Save(PlayerData[playerid][pFactionEdit]);
  513. SendServerMessage(playerid, "You have removed the skin ID in slot %d.", PlayerData[playerid][pSelectedSlot] + 1);
  514. }
  515. }
  516. }
  517. return 1;
  518. }
  519.  
  520. Dialog:FactionModel(playerid, response, listitem, inputtext[])
  521. {
  522. if (PlayerData[playerid][pFactionEdit] == -1)
  523. return 0;
  524.  
  525. if (response)
  526. {
  527. new skin = strval(inputtext);
  528.  
  529. if (isnull(inputtext))
  530. 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");
  531.  
  532. if (skin < 0 || skin > 311)
  533. 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");
  534.  
  535. FactionData[PlayerData[playerid][pFactionEdit]][factionSkins][PlayerData[playerid][pSelectedSlot]] = skin;
  536. Faction_Save(PlayerData[playerid][pFactionEdit]);
  537.  
  538. if (skin) {
  539. SendServerMessage(playerid, "You have set the skin ID in slot %d to %d.", PlayerData[playerid][pSelectedSlot] + 1, skin);
  540. }
  541. else {
  542. SendServerMessage(playerid, "You have removed the skin ID in slot %d.", PlayerData[playerid][pSelectedSlot] + 1);
  543. }
  544. }
  545. return 1;
  546. }
  547.  
  548. Dialog:RestrictedFrequencies(playerid, response, listitem, inputtext[])
  549. {
  550. /*
  551. case 0: str = "PD";
  552. case 1: str = "FD";
  553. case 2: str = "GOV";
  554. */
  555. if (response)
  556. {
  557. switch (listitem)
  558. {
  559. case 0:
  560. Dialog_Show(playerid, RestrictedFrequencies, DIALOG_STYLE_MSGBOX, "Police Department", "The Radio Frequency of the Police Department is 9-1-1.", "Close", "Back");
  561.  
  562. case 1:
  563. Dialog_Show(playerid, RestrictedFrequencies, DIALOG_STYLE_MSGBOX, "Fire Department", "The Radio Frequency of the Fire Department is 9-1-2.", "Close", "Back");
  564.  
  565. case 2:
  566. Dialog_Show(playerid, RestrictedFrequencies, DIALOG_STYLE_MSGBOX, "San Andreas Government", "The Radio Frequency of the San Andreas Government is 9-1-3.", "Close", "Back");
  567.  
  568. }
  569. }
  570. return 1;
  571. }
  572.  
  573. Dialog:ACC_POLICE(playerid, response, listitem, inputtext[])
  574. {
  575. if (response)
  576. {
  577. switch (listitem)
  578. {
  579. case 0:
  580. SetPlayerAttachedObject(playerid,1,19142,1,0.1,0.05,0.0,0.0,0.0,0.0),
  581. SendClientMessage(playerid, COLOR_WHITE,"You have equiped your Kevlar Vest.");
  582.  
  583. case 1:
  584. SetPlayerAttachedObject(playerid,2,19141,2,0.11,0.0,0.0,0.0,0.0,0.0),
  585. SendClientMessage(playerid, COLOR_WHITE,"You have equiped your Police Helmet.");
  586.  
  587. case 2:
  588. SetPlayerAttachedObject(playerid,3,18637,13,0.35,0.0,0.0,0.0,0.0,180.0),
  589. SendClientMessage(playerid, COLOR_WHITE,"You have equiped your Police Shield.");
  590.  
  591. case 3:
  592. SetPlayerAttachedObject(playerid,4,18642,7,0.1,0.0,-0.11,0.0,-90.0,90.0),
  593. SendClientMessage(playerid, COLOR_WHITE,"You have equiped your Police Taser.");
  594.  
  595. case 4:
  596. SetPlayerAttachedObject(playerid,1,19515,1,0.1,0.05,0.0,0.0,0.0,0.0),
  597. SendClientMessage(playerid, COLOR_WHITE,"You have equiped your Grey SWAT Vest.");
  598.  
  599. case 5:
  600. SetPlayerAttachedObject(playerid,2,19514,2,0.11,0.0,0.0,0.0,0.0,0.0),
  601. SendClientMessage(playerid, COLOR_WHITE,"You have equiped your Grey SWAT Helmet");
  602.  
  603. }
  604. }
  605. return 1;
  606. }
  607.  
  608. Dialog:AddVehicleModel(playerid, response, listitem, inputtext[])
  609. {
  610. if (response)
  611. {
  612. new id = PlayerData[playerid][pDealership];
  613.  
  614. if (id != -1 && BusinessData[id][bizExists] && BusinessData[id][bizType] == 5)
  615. {
  616. if (isnull(inputtext))
  617. return Dialog_Show(playerid, AddVehicleModel, DIALOG_STYLE_INPUT, "Add Vehicle", "Please enter the name or the ID of the vehicle model:", "Add", "Cancel");
  618.  
  619. new model = GetVehicleModelByName(inputtext);
  620.  
  621. if (!model)
  622. 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");
  623.  
  624. for (new i = 0; i != MAX_DEALERSHIP_CARS; i ++)
  625. {
  626. if (DealershipCars[id][i][vehModel] == model)
  627. 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");
  628. }
  629. PlayerData[playerid][pDealerCar] = model;
  630. Dialog_Show(playerid, DealerCarPrice, DIALOG_STYLE_INPUT, "Enter Price", "Please enter a price for '%s':", "Submit", "Cancel", ReturnVehicleModelName(PlayerData[playerid][pDealerCar]));
  631. }
  632. }
  633. return 1;
  634. }
  635.  
  636. Dialog:AddVehicle(playerid, response, listitem, inputtext[])
  637. {
  638. if (response)
  639. {
  640. new id = PlayerData[playerid][pDealership];
  641.  
  642. if (id != -1 && BusinessData[id][bizExists] && BusinessData[id][bizType] == 5)
  643. {
  644. if (!listitem)
  645. {
  646. Dialog_Show(playerid, AddVehicleModel, DIALOG_STYLE_INPUT, "Add Vehicle", "Please enter the name or the ID of the vehicle model:", "Add", "Cancel");
  647. }
  648. else
  649. {
  650. static
  651. cars[212];
  652.  
  653. for (new i = 0; i < sizeof(cars); i ++)
  654. cars[i] = i + 400;
  655.  
  656. ShowModelSelectionMenu(playerid, "Add Vehicle", MODEL_SELECTION_DEALER_ADD, cars, sizeof(cars), -16.0, 0.0, -55.0);
  657. }
  658. }
  659. }
  660. return 1;
  661. }
  662.  
  663. Dialog:EnterNumber(playerid, response, listitem, inputtext[])
  664. {
  665. if (response)
  666. {
  667. static
  668. name[32],
  669. string[128];
  670.  
  671. strunpack(name, PlayerData[playerid][pEditingItem]);
  672.  
  673. if (isnull(inputtext) || !IsNumeric(inputtext))
  674. 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);
  675.  
  676. for (new i = 0; i != MAX_CONTACTS; i ++)
  677. {
  678. if (!ContactData[playerid][i][contactExists])
  679. {
  680. ContactData[playerid][i][contactExists] = true;
  681. ContactData[playerid][i][contactNumber] = strval(inputtext);
  682.  
  683. format(ContactData[playerid][i][contactName], 32, name);
  684.  
  685. format(string, sizeof(string), "INSERT INTO `contacts` (`ID`, `contactName`, `contactNumber`) VALUES('%d', '%s', '%d')", PlayerData[playerid][pID], SQL_ReturnEscaped(name), ContactData[playerid][i][contactNumber]);
  686. mysql_tquery(g_iHandle, string, "OnContactAdd", "dd", playerid, i);
  687.  
  688. SendServerMessage(playerid, "You have added \"%s\" to your contacts.", name);
  689. return 1;
  690. }
  691. }
  692. SendErrorMessage(playerid, "There is no room left for anymore contacts.");
  693. }
  694. else {
  695. ShowContacts(playerid);
  696. }
  697. return 1;
  698. }
  699.  
  700. Dialog:NewContact(playerid, response, listitem, inputtext[])
  701. {
  702. if (response)
  703. {
  704. if (isnull(inputtext))
  705. 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");
  706.  
  707. if (strlen(inputtext) > 32)
  708. 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");
  709.  
  710. strpack(PlayerData[playerid][pEditingItem], inputtext, 32);
  711.  
  712. Dialog_Show(playerid, EnterNumber, DIALOG_STYLE_INPUT, "Contact Number", "Contact Name: %s\n\nPlease enter the phone number for this contact:", "Submit", "Back", inputtext);
  713. }
  714. else {
  715. ShowContacts(playerid);
  716. }
  717. return 1;
  718. }
  719.  
  720. Dialog:ContactInfo(playerid, response, listitem, inputtext[])
  721. {
  722. if (response)
  723. {
  724. new
  725. id = PlayerData[playerid][pContact],
  726. string[72];
  727.  
  728. switch (listitem)
  729. {
  730. case 0:
  731. {
  732. format(string, 16, "%d", ContactData[playerid][id][contactNumber]);
  733. cmd_call(playerid, string);
  734. }
  735. case 1:
  736. {
  737. format(string, sizeof(string), "DELETE FROM `contacts` WHERE `ID` = '%d' AND `contactID` = '%d'", PlayerData[playerid][pID], ContactData[playerid][id][contactID]);
  738. mysql_tquery(g_iHandle, string);
  739.  
  740. SendServerMessage(playerid, "You have deleted \"%s\" from your contacts.", ContactData[playerid][id][contactName]);
  741.  
  742. ContactData[playerid][id][contactExists] = false;
  743. ContactData[playerid][id][contactNumber] = 0;
  744. ContactData[playerid][id][contactID] = 0;
  745.  
  746. ShowContacts(playerid);
  747. }
  748. }
  749. }
  750. else {
  751. ShowContacts(playerid);
  752. }
  753. return 1;
  754. }
  755.  
  756. Dialog:Contacts(playerid, response, listitem, inputtext[])
  757. {
  758. if (response)
  759. {
  760. if (!listitem) {
  761. Dialog_Show(playerid, NewContact, DIALOG_STYLE_INPUT, "New Contact", "Please enter the name of the contact below:", "Submit", "Back");
  762. }
  763. else {
  764. PlayerData[playerid][pContact] = ListedContacts[playerid][listitem - 1];
  765.  
  766. Dialog_Show(playerid, ContactInfo, DIALOG_STYLE_LIST, ContactData[playerid][PlayerData[playerid][pContact]][contactName], "Call Contact\nDelete Contact", "Select", "Back");
  767. }
  768. }
  769. else {
  770. cmd_phone(playerid, "\1");
  771. }
  772. for (new i = 0; i != MAX_CONTACTS; i ++) {
  773. ListedContacts[playerid][i] = -1;
  774. }
  775. return 1;
  776. }
  777.  
  778. Dialog:DialNumber(playerid, response, listitem, inputtext[])
  779. {
  780. if (response)
  781. {
  782. new
  783. string[16];
  784.  
  785. if (isnull(inputtext) || !IsNumeric(inputtext))
  786. return Dialog_Show(playerid, DialNumber, DIALOG_STYLE_INPUT, "Dial Number", "Please enter the number that you wish to dial below:", "Dial", "Back");
  787.  
  788. format(string, 16, "%d", strval(inputtext));
  789. cmd_call(playerid, string);
  790. }
  791. else {
  792. cmd_phone(playerid, "\1");
  793. }
  794. return 1;
  795. }
  796.  
  797. Dialog:SendText(playerid, response, listitem, inputtext[])
  798. {
  799. if (response)
  800. {
  801. new number = strval(inputtext);
  802.  
  803. if (isnull(inputtext) || !IsNumeric(inputtext))
  804. 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");
  805.  
  806. if (GetNumberOwner(number) == INVALID_PLAYER_ID)
  807. 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");
  808.  
  809. PlayerData[playerid][pContact] = GetNumberOwner(number);
  810. Dialog_Show(playerid, TextMessage, DIALOG_STYLE_INPUT, "Text Message", "Please enter the message to send to %s:", "Send", "Back", ReturnName(PlayerData[playerid][pContact], 0));
  811. }
  812. else {
  813. cmd_phone(playerid, "\1");
  814. }
  815. return 1;
  816. }
  817.  
  818. Dialog:TextMessage(playerid, response, listitem, inputtext[])
  819. {
  820. if (response)
  821. {
  822. if (isnull(inputtext))
  823. 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));
  824.  
  825. new targetid = PlayerData[playerid][pContact];
  826.  
  827. if (!IsPlayerConnected(targetid) || !PlayerData[targetid][pPhone])
  828. return SendErrorMessage(playerid, "The specified phone number went offline.");
  829.  
  830. GiveMoney(playerid, -1);
  831. ShowPlayerFooter(playerid, "You've been ~r~charged~w~ $1 to send a text.");
  832.  
  833. SendClientMessageEx(targetid, COLOR_YELLOW, "[TEXT]: %s - %s (%d)", inputtext, ReturnName(playerid, 0), PlayerData[playerid][pPhone]);
  834. SendClientMessageEx(playerid, COLOR_YELLOW, "[TEXT]: %s - %s (%d)", inputtext, ReturnName(playerid, 0), PlayerData[playerid][pPhone]);
  835.  
  836. PlayerPlaySoundEx(targetid, 21001);
  837. SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s takes out their phone and sends a text.", ReturnName(playerid, 0));
  838. }
  839. else {
  840. 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");
  841. }
  842. return 1;
  843. }
  844.  
  845. Dialog:MyPhone(playerid, response, listitem, inputtext[])
  846. {
  847. if (response)
  848. {
  849. switch (listitem)
  850. {
  851. case 0:
  852. {
  853. if (PlayerData[playerid][pPhoneOff])
  854. return SendErrorMessage(playerid, "Your phone must be powered on.");
  855.  
  856. Dialog_Show(playerid, DialNumber, DIALOG_STYLE_INPUT, "Dial Number", "Please enter the number that you wish to dial below:", "Dial", "Back");
  857. }
  858. case 1:
  859. {
  860. if (PlayerData[playerid][pPhoneOff])
  861. return SendErrorMessage(playerid, "Your phone must be powered on.");
  862.  
  863. ShowContacts(playerid);
  864. }
  865. case 2:
  866. {
  867. if (PlayerData[playerid][pPhoneOff])
  868. return SendErrorMessage(playerid, "Your phone must be powered on.");
  869.  
  870. 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");
  871. }
  872. case 3:
  873. {
  874. if (!PlayerData[playerid][pPhoneOff])
  875. {
  876. if (PlayerData[playerid][pCallLine] != INVALID_PLAYER_ID) {
  877. CancelCall(playerid);
  878. }
  879. PlayerData[playerid][pPhoneOff] = 1;
  880. SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s has powered off their cellphone.", ReturnName(playerid, 0));
  881. }
  882. else
  883. {
  884. PlayerData[playerid][pPhoneOff] = 0;
  885. SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s has powered on their cellphone.", ReturnName(playerid, 0));
  886. }
  887. }
  888. }
  889. }
  890. return 1;
  891. }
  892.  
  893. Dialog:ListedFurniture(playerid, response, listitem, inputtext[])
  894. {
  895. if (response)
  896. {
  897. new id = House_Inside(playerid);
  898.  
  899. if (id != -1 && House_IsOwner(playerid, id))
  900. {
  901. PlayerData[playerid][pEditFurniture] = ListedFurniture[playerid][listitem];
  902.  
  903. Dialog_Show(playerid, FurnitureList, DIALOG_STYLE_LIST, FurnitureData[PlayerData[playerid][pEditFurniture]][furnitureName], "Edit Position\nPickup Furniture\nDestroy Furniture", "Select", "Cancel");
  904. }
  905. }
  906. for (new i = 0; i != MAX_FURNITURE; i ++) {
  907. ListedFurniture[playerid][i] = -1;
  908. }
  909. return 1;
  910. }
  911.  
  912. Dialog:FurnitureList(playerid, response, listitem, inputtext[])
  913. {
  914. if (response)
  915. {
  916. new id = House_Inside(playerid);
  917.  
  918. if (id != -1 && House_IsOwner(playerid, id))
  919. {
  920. switch (listitem)
  921. {
  922. case 0:
  923. {
  924. EditDynamicObject(playerid, FurnitureData[PlayerData[playerid][pEditFurniture]][furnitureObject]);
  925. SendServerMessage(playerid, "You are now editing the position of item \"%s\".", FurnitureData[PlayerData[playerid][pEditFurniture]][furnitureName]);
  926. }
  927. case 1:
  928. {
  929. new item = Inventory_Add(playerid, FurnitureData[PlayerData[playerid][pEditFurniture]][furnitureName], FurnitureData[PlayerData[playerid][pEditFurniture]][furnitureModel]);
  930.  
  931. if (item == -1)
  932. return SendErrorMessage(playerid, "You don't have any inventory slots left.");
  933.  
  934. SendNearbyMessage(playerid, 30.0, COLOR_PURPLE, "** %s has picked up \"%s\".", ReturnName(playerid, 0), FurnitureData[PlayerData[playerid][pEditFurniture]][furnitureName]);
  935. SendServerMessage(playerid, "You have picked up your \"%s\". The item was added to your inventory.", FurnitureData[PlayerData[playerid][pEditFurniture]][furnitureName]);
  936.  
  937. Furniture_Delete(PlayerData[playerid][pEditFurniture]);
  938. CancelEdit(playerid);
  939.  
  940. PlayerData[playerid][pEditFurniture] = -1;
  941. }
  942. case 2:
  943. {
  944. Furniture_Delete(PlayerData[playerid][pEditFurniture]);
  945. SendServerMessage(playerid, "You have destroyed furniture \"%s\".", FurnitureData[PlayerData[playerid][pEditFurniture]][furnitureName]);
  946.  
  947. CancelEdit(playerid);
  948. PlayerData[playerid][pEditFurniture] = -1;
  949. }
  950. }
  951. }
  952. else {
  953. PlayerData[playerid][pEditFurniture] = -1;
  954. }
  955. }
  956. else {
  957. PlayerData[playerid][pEditFurniture] = -1;
  958. }
  959. return 1;
  960. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement