Advertisement
Guest User

Untitled

a guest
May 6th, 2016
869
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 358.25 KB | None | 0 0
  1. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  2. {
  3. //printf("DIALOG: [%d] %s (Dialog %d, Response %d, Listitem %d, Inputtext %s)",playerid, PlayerName(playerid), dialogid, response, listitem, inputtext);
  4. new string[224], sendername[MAX_PLAYER_NAME];
  5. switch(dialogid)
  6. {
  7. case 1: // Login dialog
  8. {
  9. if (GetPVarInt(playerid, "PlayerLogged") != 0) return true;
  10. if(!strlen(inputtext)) return ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"Server Account","Welcome back to Diverse RP, please enter your password to login.","Login", "Other");
  11. if(strlen(inputtext) >= 40) {
  12. SendClientMessage(playerid, COLOR_WHITE, "Password is too long (40 Chars max).");
  13. ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"Server Account","Welcome back to Diverse RP, please enter your password to login.","Login", "Other");
  14. return true;
  15. }
  16. new query[200], input[65];
  17. //mysql_escape_string(inputtext, input);
  18. SHA256_PassHash(inputtext, HASH_KEY, input, 65);
  19. if(PlayerInfo[playerid][pSerialBan] == 1) {
  20. new banpass[65];
  21. GetPVarString(playerid, "BanPass", banpass, 65);
  22. if(strlen(banpass) > 0 && strmatch(banpass, input)) {
  23. SCM(playerid, COLOR_YELLOW, "______________________________________________________________________");
  24. SendClientMessage(playerid, COLOR_YELLOW, "[System] You are banned from Diverse Roleplay.");
  25. SendClientMessage(playerid, COLOR_YELLOW, "[System] Ban evasion detected.");
  26. SendClientMessage(playerid, COLOR_YELLOW, "[System] To appeal this ban, go to www.diverseroleplay.org");
  27. SCM(playerid, COLOR_YELLOW, "______________________________________________________________________");
  28. SetPVarInt(playerid, "Banned", 1);
  29. DeletePVar(playerid, "BanPass");
  30. PlayerInfo[playerid][pSerialBan] = 0;
  31. KickPlayer(playerid, "");
  32. } else {
  33. DeletePVar(playerid, "BanPass");
  34. PlayerInfo[playerid][pSerialBan] = 0;
  35. }
  36. }
  37. format(query, sizeof(query), "SELECT * FROM accounts WHERE Name = '%s' AND Pass = '%s'", PlayerName(playerid), input);
  38. mysql_function_query(handlesql, query, true, "LogUserIn", "i", playerid);
  39. format(PlayerInfo[playerid][pPass],65,"%s",input); //Sloppy, but it'll have to do since it won't retrieve the pass...
  40. }
  41. case 2: // Register dialog
  42. {
  43. // Registering password
  44. if(!strlen(inputtext)) return ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"Server Account","There is no existing account using your playername, please create a new account!\nPlease enter your desired password.","Register", "");
  45. if(strlen(inputtext) < 6)
  46. {
  47. SendClientMessage(playerid, COLOR_WHITE, "Password is too short (5 Chars min.).");
  48. ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"Server Account","There is no existing account using your playername, please create a new account!\nPlease enter your desired password.","Register", "");
  49. return 1;
  50. }
  51. if(strlen(inputtext) >= 40)
  52. {
  53. SendClientMessage(playerid, COLOR_WHITE, "Password is too long (40 Chars max).");
  54. ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"Server Account","There is no existing account using your playername, please create a new account!\nPlease enter your desired password.","Register", "");
  55. return 1;
  56. }
  57. if(PlayerInfo[playerid][pSerialBan] == 1) {
  58. new banpass[65], input[65];
  59. SHA256_PassHash(inputtext, HASH_KEY, input, 65);
  60. GetPVarString(playerid, "BanPass", banpass, 65);
  61. if(strlen(banpass) > 0 && strmatch(banpass, input)) {
  62. SCM(playerid, COLOR_YELLOW, "______________________________________________________________________");
  63. SendClientMessage(playerid, COLOR_YELLOW, "[System] You are banned from Diverse Roleplay.");
  64. SendClientMessage(playerid, COLOR_YELLOW, "[System] Ban evasion detected.");
  65. SendClientMessage(playerid, COLOR_YELLOW, "[System] To appeal this ban, go to www.diverseroleplay.org");
  66. SCM(playerid, COLOR_YELLOW, "______________________________________________________________________");
  67. SetPVarInt(playerid, "Banned", 1);
  68. DeletePVar(playerid, "BanPass");
  69. PlayerInfo[playerid][pSerialBan] = 0;
  70. KickPlayer(playerid, "");
  71. } else {
  72. DeletePVar(playerid, "BanPass");
  73. PlayerInfo[playerid][pSerialBan] = 0;
  74. }
  75. }
  76. SetPVarInt(playerid, "Approve", 0);
  77. SetPVarString(playerid, "TempPass", inputtext);
  78. strmid(PlayerInfo[playerid][pOOC], "None", 0, strlen("None"), 255);
  79. strmid(PlayerInfo[playerid][pMetagame], "None", 0, strlen("None"), 255);
  80. strmid(PlayerInfo[playerid][pRevenge], "None", 0, strlen("None"), 255);
  81. strmid(PlayerInfo[playerid][pRoleplay], "None", 0, strlen("None"), 255);
  82. strmid(PlayerInfo[playerid][pPowergame], "None", 0, strlen("None"), 255);
  83. strmid(PlayerInfo[playerid][pQuest1], "None", 0, strlen("None"), 255);
  84. strmid(PlayerInfo[playerid][pQuest2], "None", 0, strlen("None"), 255);
  85. strmid(PlayerInfo[playerid][pQuest3], "None", 0, strlen("None"), 255);
  86. strmid(PlayerInfo[playerid][pQuest4], "None", 0, strlen("None"), 255);
  87. strmid(PlayerInfo[playerid][pQuest5], "None", 0, strlen("None"), 255);
  88. SetPVarInt(playerid, "TutQuestAmount", 0);
  89. return CallRemoteFunction("TutorialAnswers","i",playerid);
  90. }
  91. case 3: // Rental Agreement Dialog
  92. {
  93. switch(response)
  94. {
  95. case 1:
  96. {
  97. new result[1000];
  98. for(new i = 0; i < sizeof(gRentalIDs); i++) {
  99. if(i == 0) { format(result, 1000, "%s", VehicleName[gRentalIDs[i][0]-400]); }
  100. else { format(result, 1000, "%s\n%s", result, VehicleName[gRentalIDs[i][0]-400]); }
  101. }
  102. ShowPlayerDialog(playerid, 73,DIALOG_STYLE_LIST,"Rental Options", result, "Select", "");
  103. }
  104. }
  105. }
  106. case 4: // Job Options Dialog
  107. {
  108. if(!response) return true;
  109. new foundid = -1;
  110. for(new jb = 0; jb < MAX_JOBS; jb++) {
  111. if(JobInfo[jb][jID] >= 1)
  112. {
  113. if(IsPlayerInRangeOfPoint(playerid, 2.0, JobInfo[jb][jX], JobInfo[jb][jY], JobInfo[jb][jZ])) {
  114. foundid=jb;
  115. break;
  116. }
  117. }
  118. }
  119. if(foundid == -1) return true;
  120. if(GetPVarInt(playerid, "Job") != foundid+1) return true;
  121. switch(listitem)
  122. {
  123. case 0:
  124. {
  125. if(GetPVarInt(playerid, "OnRoute") != 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are already on a route!");
  126. if(GetPVarInt(playerid, "JobReduce") >= 1 && GetPVarInt(playerid, "MonthDon") == 0)
  127. {
  128. format(string, sizeof(string), "You must wait (%d) seconds before starting another route!", GetPVarInt(playerid, "JobReduce"));
  129. SCM(playerid, COLOR_LIGHTRED, string);
  130. return true;
  131. }
  132. new veh;
  133. veh = CreateVehicle(JobInfo[foundid][jVehicleID], JobInfo[foundid][jVX], JobInfo[foundid][jVY], JobInfo[foundid][jVZ], JobInfo[foundid][jVA], -1, -1, -1);
  134. Iter_Add(Vehicle, veh);
  135. VehicleInfo[veh][vFuel]=100, VehicleInfo[veh][vEngine]=1;
  136. VehicleInfo[veh][vWindows]=0, VehicleInfo[veh][vID]=0;
  137. VehicleInfo[veh][vLights]=0, VehicleInfo[veh][vCreated]=1;
  138. VehicleInfo[veh][vType] = VEHICLE_JOB, VehicleInfo[veh][vJob]=GetPVarInt(playerid, "Job");
  139. VehicleInfo[veh][vLights] = 0, VehicleInfo[veh][vLock] = 0;
  140. new engine, lights, alarm, doors, bonnet, boot, objective;
  141. GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
  142. SetVehicleParamsEx(veh,engine,lights,alarm,0,bonnet,boot,objective);
  143. SetVehicleNumberPlate(veh, "JOB");
  144. SetVehicleToRespawn(veh);
  145. SetPVarInt(playerid, "RouteVeh", veh);
  146. foreach(new i : Player) { SetVehicleParamsForPlayer(veh, i, 0, 1); }
  147. TogglePlayerControllableEx(playerid, false);
  148. SetTimerEx("ForceInVeh", 1000, false, "ifff", playerid, veh);
  149. TogglePlayerAllDynamicCPs(playerid, false);
  150. }
  151. case 1:
  152. {
  153. if(GetPVarInt(playerid, "OnRoute") == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not on a route!");
  154. DeletePVar(playerid, "OnRoute");
  155. DeletePVar(playerid, "RouteOT");
  156. if(GetPVarInt(playerid, "RouteVeh") >= 1) { DespawnVehicle(GetPVarInt(playerid, "RouteVeh")); }
  157. DeletePVar(playerid, "RouteVeh");
  158. DeletePVar(playerid, "PizzaTime");
  159. DeletePVar(playerid, "PizzaTimeEx");
  160. SendClientMessage(playerid, COLOR_WHITE, "Route ended!");
  161. DisablePlayerCheckpoint(playerid);
  162. TogglePlayerAllDynamicCPs(playerid, true);
  163. }
  164. case 2:
  165. {
  166. if(GetPVarInt(playerid, "OnRoute") != 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are currently on a route!");
  167. SetPVarInt(playerid, "Job", 0);
  168. SendClientMessage(playerid, COLOR_WHITE, "You are now unemployed!");
  169. }
  170. }
  171. }
  172. case 5: // Accept Job Dialog
  173. {
  174. if(!response) return true;
  175. new foundid = -1;
  176. for(new jb = 0; jb < MAX_JOBS; jb++)
  177. {
  178. if(JobInfo[jb][jID] >= 1)
  179. {
  180. if(IsPlayerInRangeOfPoint(playerid, 2.0, JobInfo[jb][jX], JobInfo[jb][jY], JobInfo[jb][jZ]))
  181. {
  182. foundid=jb;
  183. break;
  184. }
  185. }
  186. }
  187. if(foundid == -1) return true;
  188. if(GetPVarInt(playerid, "Job") != 0) return true;
  189. format(string, sizeof(string), "Congratulations you are now a %s!", JobInfo[foundid][jName]);
  190. SendClientMessage(playerid, COLOR_WHITE, string);
  191. SendClientMessage(playerid, COLOR_WHITE, "To navigate your job, press ~k~~GROUP_CONTROL_BWD~ at the job icon.");
  192. SetPVarInt(playerid, "Job", foundid+1);
  193. }
  194. case 6: // DMV LICENSE TEST
  195. {
  196. if(!response) return true;
  197. if(GetPVarInt(playerid, "ConnectTime") >= 8) GivePlayerMoneyEx(playerid, -150);
  198. SetPVarInt(playerid, "TakeTest", 1);
  199. new veh, rand = random(sizeof(gRentalIDs));
  200. veh = CreateVehicle(gRentalIDs[rand][0], DMVSpot[0][3], DMVSpot[0][4], DMVSpot[0][5], DMVSpot[0][6], 6, 6, -1);
  201. Iter_Add(Vehicle, veh);
  202. VehicleInfo[veh][vFuel]=100, VehicleInfo[veh][vEngine]=1;
  203. VehicleInfo[veh][vWindows]=0, VehicleInfo[veh][vID]=0;
  204. VehicleInfo[veh][vLights]=0, VehicleInfo[veh][vCreated]=1;
  205. VehicleInfo[veh][vType] = VEHICLE_DMV, VehicleInfo[veh][vJob]=0;
  206.  
  207. SetVehicleNumberPlate(veh, "DMV");
  208. SetVehicleToRespawn(veh);
  209. SetPVarInt(playerid, "TestVeh", veh);
  210. foreach(new i : Player) { SetVehicleParamsForPlayer(veh, i, 0, 1); }
  211. TogglePlayerControllableEx(playerid, false);
  212. SetTimerEx("ForceInVeh", 1000, false, "ifff", playerid, veh);
  213. SetPlayerRaceCheckpoint(playerid, 0, DMVRoute[0][0], DMVRoute[0][1], DMVRoute[0][2], DMVRoute[1][0], DMVRoute[1][1], DMVRoute[1][2], 5.0);
  214. SendClientMessage(playerid,COLOR_LIGHTBLUE," ");
  215. SendClientMessage(playerid,COLOR_LIGHTBLUE,"---------------------------------------------------------------");
  216. SendClientMessage(playerid,COLOR_LIGHTBLUE,"Los Santos Department Of Motor Vehicles");
  217. SendClientMessage(playerid,COLOR_LIGHTBLUE,"---------------------------------------------------------------");
  218. SendClientMessage(playerid,COLOR_LIGHTBLUE,"Once you enter the checkpoint on your GPS the test will start,");
  219. SendClientMessage(playerid,COLOR_LIGHTBLUE,"Keep your vehicle under 95 KPH and make sure to not go too quick or too slow.");
  220. SendClientMessage(playerid,COLOR_LIGHTBLUE,"Also make sure your vehicle is not damaged and is in good shape,");
  221. SendClientMessage(playerid,COLOR_LIGHTBLUE,"Judging by your status you are capable of earning a (Gold, Silver, Bronze) ribbon.");
  222. SendClientMessage(playerid,COLOR_LIGHTBLUE,"---------------------------------------------------------------");
  223. }
  224. //==========//
  225. case 7: // STORE DIALOG
  226. {
  227. if(!response) return true;
  228. SetPVarInt(playerid, "PDBT", 1), SetPVarInt(playerid, "PDBTLI", listitem);
  229. format(string, sizeof(string), "Would you like to purchase this item?~n~Cost: $%d~n~Cash: $%d - Bank: $%d", StoreItems[listitem][1], GetPlayerMoneyEx(playerid), GetPVarInt(playerid, "Bank"));
  230. ConfigPayment(playerid, 1, string);
  231. }
  232. //==========//
  233. case 8: // Burger DIALOG
  234. {
  235. if(!response) return true;
  236. SetPVarInt(playerid, "PDBT", 2), SetPVarInt(playerid, "PDBTLI", listitem);
  237. format(string, sizeof(string), "Would you like to purchase this item?~n~Cost: $%d~n~Cash: $%d - Bank: $%d", BurgerItems[listitem][1], GetPlayerMoneyEx(playerid), GetPVarInt(playerid, "Bank"));
  238. ConfigPayment(playerid, 1, string);
  239. }
  240. //==========//
  241. case 9: // Pizza DIALOG
  242. {
  243. if(!response) return true;
  244. SetPVarInt(playerid, "PDBT", 3), SetPVarInt(playerid, "PDBTLI", listitem);
  245. format(string, sizeof(string), "Would you like to purchase this item?~n~Cost: $%d~n~Cash: $%d - Bank: $%d", PizzaItems[listitem][1], GetPlayerMoneyEx(playerid), GetPVarInt(playerid, "Bank"));
  246. ConfigPayment(playerid, 1, string);
  247. }
  248. //==========//
  249. case 10: // Cluck DIALOG
  250. {
  251. if(!response) return true;
  252. SetPVarInt(playerid, "PDBT", 4), SetPVarInt(playerid, "PDBTLI", listitem);
  253. format(string, sizeof(string), "Would you like to purchase this item?~n~Cost: $%d~n~Cash: $%d - Bank: $%d", CluckItems[listitem][1], GetPlayerMoneyEx(playerid), GetPVarInt(playerid, "Bank"));
  254. ConfigPayment(playerid, 1, string);
  255. }
  256. //==========//
  257. case 11:
  258. {
  259. switch(response)
  260. {
  261. case 1:
  262. {
  263. switch(listitem)
  264. {
  265. case 0: SendBankDialog(playerid, 1);
  266. case 1: SendBankDialog(playerid, 2);
  267. case 2:
  268. {
  269. if(GetPVarInt(playerid, "CheckEarn") <= 0)
  270. {
  271. SetPVarInt(playerid, "OCC", 0);
  272. return SendClientMessage(playerid,COLOR_WHITE,"You have no checks to cash.");
  273. }
  274. if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
  275. format(sendername, sizeof(sendername), "%s", PlayerName(playerid));
  276. GiveNameSpace(sendername);
  277. format(string, sizeof(string), "* Bank Clerk hands the $%d to %s.", GetPVarInt(playerid, "CheckEarn"), sendername);
  278. SendClientMessage(playerid,COLOR_PURPLE,string);
  279. GivePlayerMoneyEx(playerid,GetPVarInt(playerid, "CheckEarn"));
  280. DeletePVar(playerid,"CheckEarn");
  281. OnPlayerDataSave(playerid);
  282. }
  283. }
  284. }
  285. }
  286. }
  287. case 12: // Bank Deposit dialog
  288. {
  289. switch(response)
  290. {
  291. case 0:
  292. {
  293. format(string, sizeof(string), "Bank Account: $%d", GetPVarInt(playerid, "Bank"));
  294. ShowPlayerDialog(playerid,11,DIALOG_STYLE_LIST,string,"{33FF66}Deposit\n{33FF66}Withdraw", "Continue", "Exit");
  295. }
  296. case 1:
  297. {
  298. if(!strlen(inputtext)) return SendBankDialog(playerid, 1);
  299. if(strlen(inputtext) >= 7) return SendBankDialog(playerid, 1);
  300. new amount = strval(inputtext);
  301. if(amount <= 0) return SendBankDialog(playerid, 1);
  302. if(amount >= 99999999) return SendBankDialog(playerid, 1);
  303. if(GetPlayerMoneyEx(playerid) >= amount)
  304. {
  305. PlayerPlaySound(playerid,1055, 0.0, 0.0, 0.0);
  306. GivePlayerMoneyEx(playerid,-amount);
  307. new current = GetPVarInt(playerid, "Bank");
  308. SetPVarInt(playerid, "Bank", amount+GetPVarInt(playerid, "Bank"));
  309. SendClientMessage(playerid, COLOR_GREEN," ");
  310. SendClientMessage(playerid,COLOR_WHITE,":Bank Statement:");
  311. format(string, sizeof(string), "Deposit: $%d", amount);
  312. SendClientMessage(playerid, COLOR_GREEN, string);
  313. format(string, sizeof(string), "Old Balance: $%d", current);
  314. SendClientMessage(playerid, COLOR_GREEN, string);
  315. format(string, sizeof(string), "New Balance: $%d", GetPVarInt(playerid, "Bank"));
  316. SendClientMessage(playerid, COLOR_GREEN, string);
  317. SetPVarInt(playerid, "OCC", 0);
  318. }
  319. else SendBankDialog(playerid, 1);
  320. }
  321. }
  322. }
  323. case 13: // BANK Withdraw dialog
  324. {
  325. switch(response)
  326. {
  327. case 0:
  328. {
  329. format(string, sizeof(string), "Bank Account: $%d", GetPVarInt(playerid, "Bank"));
  330. ShowPlayerDialog(playerid,11,DIALOG_STYLE_LIST,string,"{33FF66}Deposit\n{33FF66}Withdraw", "Continue", "Exit");
  331. }
  332. case 1:
  333. {
  334. if(!strlen(inputtext)) return SendBankDialog(playerid, 2);
  335. if(strlen(inputtext) >= 7) return SendBankDialog(playerid, 2);
  336. new amount = strval(inputtext);
  337. if(amount <= 0) return SendBankDialog(playerid, 2);
  338. if(amount >= 99999999) return SendBankDialog(playerid, 2);
  339. if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
  340. if(GetPVarInt(playerid, "Bank") >= amount)
  341. {
  342. PlayerPlaySound(playerid,1055, 0.0, 0.0, 0.0);
  343. GivePlayerMoneyEx(playerid,amount);
  344. new current = GetPVarInt(playerid, "Bank");
  345. SetPVarInt(playerid, "Bank", GetPVarInt(playerid, "Bank")-amount);
  346. SendClientMessage(playerid, COLOR_GREEN," ");
  347. SendClientMessage(playerid,COLOR_WHITE,":Bank Statement:");
  348. format(string, sizeof(string), "Withdraw: $%d", amount);
  349. SendClientMessage(playerid, COLOR_GREEN, string);
  350. format(string, sizeof(string), "Old Balance: $%d", current);
  351. SendClientMessage(playerid, COLOR_GREEN, string);
  352. format(string, sizeof(string), "New Balance: $%d", GetPVarInt(playerid, "Bank"));
  353. SendClientMessage(playerid, COLOR_GREEN, string);
  354. SetPVarInt(playerid, "OCC", 0);
  355. }
  356. else SendBankDialog(playerid, 2);
  357. }
  358. }
  359. }
  360. case 14: // ATM Withdraw dialog
  361. {
  362. switch(response)
  363. {
  364. case 1:
  365. {
  366. if(!strlen(inputtext)) return SendBankDialog(playerid, 3);
  367. if(strlen(inputtext) >= 7) return SendBankDialog(playerid, 3);
  368. new amount = strval(inputtext);
  369. if(amount <= 0) return SendBankDialog(playerid, 3);
  370. if(amount >= 99999999) return SendBankDialog(playerid, 3);
  371. if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
  372. if(GetPVarInt(playerid, "Bank") >= amount)
  373. {
  374. PlayerPlaySound(playerid,1055, 0.0, 0.0, 0.0);
  375. GivePlayerMoneyEx(playerid,amount);
  376. new current = GetPVarInt(playerid, "Bank");
  377. SetPVarInt(playerid, "Bank", GetPVarInt(playerid, "Bank")-amount);
  378. SendClientMessage(playerid, COLOR_GREEN," ");
  379. SendClientMessage(playerid,COLOR_WHITE,":Bank Statement:");
  380. format(string, sizeof(string), "Withdraw: $%d", amount);
  381. SendClientMessage(playerid, COLOR_GREEN, string);
  382. format(string, sizeof(string), "Old Balance: $%d", current);
  383. SendClientMessage(playerid, COLOR_GREEN, string);
  384. format(string, sizeof(string), "New Balance: $%d", GetPVarInt(playerid, "Bank"));
  385. SendClientMessage(playerid, COLOR_GREEN, string);
  386. SetPVarInt(playerid, "OCC", 0);
  387. }
  388. else SendBankDialog(playerid, 3);
  389. }
  390. }
  391. }
  392. case 15: // Gas Liters
  393. {
  394. if(!response) return true;
  395. if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return true;
  396. if(!strlen(inputtext)) return SendClientMessage(playerid, COLOR_LIGHTRED, "Invalid liter amount!");
  397. if(strlen(inputtext) >= 7) return SendClientMessage(playerid, COLOR_LIGHTRED, "Invalid liter amount!");
  398. new amount = strval(inputtext), amountcheck, price;
  399. if(amount <= 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Invalid liter amount!");
  400. if(amount >= 101) return SendClientMessage(playerid, COLOR_LIGHTRED, "Invalid liter amount!");
  401. amountcheck = amount + VehicleInfo[GetPlayerVehicleID(playerid)][vFuel];
  402. if(amountcheck >= 101) return SendClientMessage(playerid, COLOR_LIGHTRED, "Your car can't hold this much more fuel!");
  403. new gasType = GasType(GetVehicleModel(GetPlayerVehicleID(playerid)));
  404. price = amount*GasPrice[gasType];
  405. if(GetPVarInt(playerid, "DonateRank") >= 2) price = 0;
  406. if(GetPVarInt(playerid, "Member") == 1 || GetPVarInt(playerid, "Member") == 2 || GetPVarInt(playerid, "Member") == 8) price = 0;
  407. if(GetPlayerMoneyEx(playerid) >= price)
  408. {
  409. TogglePlayerControllable(playerid, false);
  410. ProgressBar(playerid, "Refueling car...", 1*(amount/2), 0);
  411. SetTimerEx("DoFillUp", 1000*(amount/2), false, "iii", playerid, amount, price);
  412. }
  413. else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds!");
  414. }
  415. //==========//
  416. case 17:
  417. {
  418. if(!response) return true;
  419. new str[4848], tit[128];
  420. format(tit, 128, "%s", HelpMenu[listitem][0]);
  421. switch(listitem)
  422. {
  423. case 0:
  424. {
  425. for(new i = 0; i < sizeof(GenHelp); i++)
  426. {
  427. if(i == 0) { format(str, sizeof(str), "%s", GenHelp[i][0]); }
  428. else { format(str, sizeof(str), "%s\n%s", str, GenHelp[i][0]); }
  429. }
  430. }
  431. case 1:
  432. {
  433. for(new i = 0; i < sizeof(ConHelp); i++)
  434. {
  435. if(i == 0) { format(str, sizeof(str), "%s", ConHelp[i][0]); }
  436. else { format(str, sizeof(str), "%s\n%s", str, ConHelp[i][0]); }
  437. }
  438. }
  439. case 2:
  440. {
  441. for(new i = 0; i < sizeof(AnimHelp); i++)
  442. {
  443. if(i == 0) { format(str, sizeof(str), "%s", AnimHelp[i][0]); }
  444. else { format(str, sizeof(str), "%s\n%s", str, AnimHelp[i][0]); }
  445. }
  446. }
  447. case 3:
  448. {
  449. for(new i = 0; i < sizeof(VehHelp); i++)
  450. {
  451. if(i == 0) { format(str, sizeof(str), "%s", VehHelp[i][0]); }
  452. else { format(str, sizeof(str), "%s\n%s", str, VehHelp[i][0]); }
  453. }
  454. }
  455. case 4:
  456. {
  457. for(new i = 0; i < sizeof(HouseHelp); i++)
  458. {
  459. if(i == 0) { format(str, sizeof(str), "%s", HouseHelp[i][0]); }
  460. else { format(str, sizeof(str), "%s\n%s", str, HouseHelp[i][0]); }
  461. }
  462. }
  463. case 5:
  464. {
  465. for(new i = 0; i < sizeof(BizzHelp); i++)
  466. {
  467. if(i == 0) { format(str, sizeof(str), "%s", BizzHelp[i][0]); }
  468. else { format(str, sizeof(str), "%s\n%s", str, BizzHelp[i][0]); }
  469. }
  470. }
  471. case 6:
  472. {
  473. for(new i = 0; i < sizeof(BasketHelp); i++)
  474. {
  475. if(i == 0) { format(str, sizeof(str), "%s", BasketHelp[i][0]); }
  476. else { format(str, sizeof(str), "%s\n%s", str, BasketHelp[i][0]); }
  477. }
  478. }
  479. case 7:
  480. {
  481. for(new i = 0; i < sizeof(FactHelp); i++)
  482. {
  483. if(i == 0) { format(str, sizeof(str), "%s", FactHelp[i][0]); }
  484. else { format(str, sizeof(str), "%s\n%s", str, FactHelp[i][0]); }
  485. }
  486. }
  487. case 8:
  488. {
  489. if(GetPVarInt(playerid, "Member") != 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not a police officer!");
  490. for(new i = 0; i < sizeof(LSPDHelp); i++)
  491. {
  492. if(i == 0) { format(str, sizeof(str), "%s", LSPDHelp[i][0]); }
  493. else { format(str, sizeof(str), "%s\n%s", str, LSPDHelp[i][0]); }
  494. }
  495. }
  496. case 9:
  497. {
  498. if(GetPVarInt(playerid, "Member") != 2) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not a member of the LSFD!");
  499. for(new i = 0; i < sizeof(LSFDHelp); i++)
  500. {
  501. if(i == 0) { format(str, sizeof(str), "%s", LSFDHelp[i][0]); }
  502. else { format(str, sizeof(str), "%s\n%s", str, LSFDHelp[i][0]); }
  503. }
  504. }
  505. case 10:
  506. {
  507. if(GetPVarInt(playerid, "Member") != 4 && GetPVarInt(playerid, "Member") != 3) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not in San News or RLS!");
  508. for(new i = 0; i < sizeof(NewsHelp); i++)
  509. {
  510. if(i == 0) { format(str, sizeof(str), "%s", NewsHelp[i][0]); }
  511. else { format(str, sizeof(str), "%s\n%s", str, NewsHelp[i][0]); }
  512. }
  513. }
  514. case 11:
  515. {
  516. if(GetPVarInt(playerid, "Reg") < 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not a registration moderator!");
  517. for(new i = 0; i < sizeof(RegiHelp); i++)
  518. {
  519. if(i == 0) { format(str, sizeof(str), "%s", RegiHelp[i][0]); }
  520. else { format(str, sizeof(str), "%s\n%s", str, RegiHelp[i][0]); }
  521. }
  522. }
  523. case 12:
  524. {
  525. if(GetPVarInt(playerid, "Admin") == 0 && GetPVarInt(playerid, "Helper") == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not an admin!");
  526. for(new i = 0; i < sizeof(StaffHelp); i++)
  527. {
  528. if(i == 0) { format(str, sizeof(str), "%s", StaffHelp[i][0]); }
  529. else { format(str, sizeof(str), "%s\n%s", str, StaffHelp[i][0]); }
  530. }
  531. }
  532. case 13:
  533. {
  534. if(GetPVarInt(playerid, "Admin") == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not an administrator!");
  535. new count;
  536. for(new i = 1; i <= 10; i++) {
  537. count = 0;
  538. if(i == 1) {
  539. format(str, sizeof(str), "{FFFFFF}Commands for {CD5C5C}Level %i {FFFFFF}Administrators:{a9c4e4}\n", i);
  540. } else {
  541. format(str, sizeof(str), "%s\n\n{FFFFFF}Commands for {CD5C5C}Level %i {FFFFFF}Administrators:{a9c4e4}\n", str, i);
  542. }
  543. for(new j = 0; j < sizeof(AdminCmds); j++) {
  544. if(AdminCmds[j][acRank] == i) {
  545. count++;
  546. if(count % 10 == 0) {
  547. format(str, sizeof(str), "%s\n/%s", str, AdminCmds[j][acCmd]);
  548. } else {
  549. if(count % 10 != 0 && count != 1) {
  550. format(str, sizeof(str), "%s, /%s", str, AdminCmds[j][acCmd]);
  551. } else {
  552. format(str, sizeof(str), "%s/%s", str, AdminCmds[j][acCmd]);
  553. }
  554. }
  555. }
  556. }
  557. if(count == 0) { format(str, sizeof(str), "%sNone.", str); }
  558. }
  559. }
  560. }
  561. ShowPlayerDialog(playerid, 18, DIALOG_STYLE_MSGBOX, tit, str, "Go Back", "");
  562. }
  563. case 18:
  564. {
  565. if(!response) return true;
  566. cmd_help(playerid, "");
  567. }
  568. case 19: // Fightstyle
  569. {
  570. switch(response)
  571. {
  572. case 1: // Selecting
  573. {
  574. switch(listitem)
  575. {
  576. case 0: LearnFightstyle(playerid,50,FIGHT_STYLE_NORMAL,"Normal");
  577. case 1: LearnFightstyle(playerid,500,FIGHT_STYLE_BOXING,"Boxing");
  578. case 2: LearnFightstyle(playerid,3000,FIGHT_STYLE_KUNGFU,"KungFu");
  579. case 3:
  580. {
  581. if(GetPVarInt(playerid, "ConnectTime") >= 250)
  582. {
  583. LearnFightstyle(playerid,6000,FIGHT_STYLE_KNEEHEAD,"KneeHead");
  584. }
  585. else SendClientMessage(playerid, COLOR_LIGHTRED, "You need 250+ hours played to purchase this fight style!");
  586. }
  587. case 4: LearnFightstyle(playerid,8000,FIGHT_STYLE_GRABKICK,"GrabKick");
  588. case 5:
  589. {
  590. if(GetPVarInt(playerid, "ConnectTime") >= 250)
  591. {
  592. LearnFightstyle(playerid,10000,FIGHT_STYLE_ELBOW,"Elbow Attack");
  593. }
  594. else SendClientMessage(playerid, COLOR_LIGHTRED, "You need 250+ hours played to purchase this fight style!");
  595. }
  596. }
  597. }
  598. }
  599. }
  600. //==========//
  601. case 20: // AMMU DIALOG
  602. {
  603. if(!response) return true;
  604. SetPVarInt(playerid, "PDBT", 5), SetPVarInt(playerid, "PDBTLI", listitem);
  605. format(string, sizeof(string), "Would you like to purchase this item?~n~Cost: $%d | Cash: $%d", AmmuItems[listitem][1], GetPlayerMoneyEx(playerid), GetPVarInt(playerid, "Bank"));
  606. ConfigPayment(playerid, 1, string);
  607. }
  608. //==========//
  609. case 21:
  610. {
  611. new id = 18645;
  612. switch(listitem)
  613. {
  614. case 0: id = 18645;
  615. case 1: id = 18976;
  616. case 2: id = 18977;
  617. case 3: id = 18978;
  618. case 4: id = 18979;
  619. }
  620. switch(GetPlayerSkin(playerid))
  621. {
  622. #define SPAO{%0,%1,%2,%3,%4,%5} SetPlayerAttachedObject(playerid, HOLDOBJECT_CLOTH1, id, 2, (%0), (%1), (%2), (%3), (%4), (%5));
  623. case 0, 65, 74, 149, 208, 273: SPAO{0.070000, 0.0, 0.0, 88.0, 75.0, 0.0}
  624. case 1..6, 8, 14, 16, 22, 27, 29, 33, 41..49, 82..84, 86, 87, 119, 289: SPAO{0.070000, 0.0, 0.0, 88.0, 77.0, 0.0}
  625. case 7, 10: SPAO{0.090000, 0.019999, 0.0, 88.0, 90.0, 0.0}
  626. case 9: SPAO{0.059999, 0.019999, 0.0, 88.0, 90.0, 0.0}
  627. case 11..13: SPAO{0.070000, 0.019999, 0.0, 88.0, 90.0, 0.0}
  628. case 15: SPAO{0.059999, 0.0, 0.0, 88.0, 82.0, 0.0}
  629. case 17..21: SPAO{0.059999, 0.019999, 0.0, 88.0, 82.0, 0.0}
  630. case 23..26, 28, 30..32, 34..39, 57, 58, 98, 99, 104..118, 120..131: SPAO{0.079999, 0.019999, 0.0, 88.0, 82.0, 0.0}
  631. case 40: SPAO{0.050000, 0.009999, 0.0, 88.0, 82.0, 0.0}
  632. case 50, 100..103, 148, 150..189, 222: SPAO{0.070000, 0.009999, 0.0, 88.0, 82.0, 0.0}
  633. case 51..54: SPAO{0.100000, 0.009999, 0.0, 88.0, 82.0, 0.0}
  634. case 55, 56, 63, 64, 66..73, 75, 76, 78..81, 133..143, 147, 190..207, 209..219, 221, 247..272, 274..288, 290..293: SPAO{0.070000, 0.019999, 0.0, 88.0, 82.0, 0.0}
  635. case 59..62: SPAO{0.079999, 0.029999, 0.0, 88.0, 82.0, 0.0}
  636. case 77: SPAO{0.059999, 0.019999, 0.0, 87.0, 82.0, 0.0}
  637. case 85, 88, 89: SPAO{0.070000, 0.039999, 0.0, 88.0, 82.0, 0.0}
  638. case 90..97: SPAO{0.050000, 0.019999, 0.0, 88.0, 82.0, 0.0}
  639. case 132: SPAO{0.0, 0.019999, 0.0, 88.0, 82.0, 0.0}
  640. case 144..146: SPAO{0.090000, 0.0, 0.0, 88.0, 82.0, 0.0}
  641. case 220: SPAO{0.029999, 0.019999, 0.0, 88.0, 82.0, 0.0}
  642. case 223, 246: SPAO{0.070000, 0.050000, 0.0, 88.0, 82.0, 0.0}
  643. case 224..245: SPAO{0.070000, 0.029999, 0.0, 88.0, 82.0, 0.0}
  644. case 294: SPAO{0.070000, 0.019999, 0.0, 91.0, 84.0, 0.0}
  645. case 295: SPAO{0.050000, 0.019998, 0.0, 86.0, 82.0, 0.0}
  646. case 296..298: SPAO{0.064999, 0.009999, 0.0, 88.0, 82.0, 0.0}
  647. case 299: SPAO{0.064998, 0.019999, 0.0, 88.0, 82.0, 0.0}
  648. }
  649. }
  650. case 22: // BAR DIALOG
  651. {
  652. if(!response) return true;
  653. SetPVarInt(playerid, "PDBT", 6), SetPVarInt(playerid, "PDBTLI", listitem);
  654. format(string, sizeof(string), "Would you like to purchase this item?~n~Cost: $%d~n~Cash: $%d - Bank: $%d", BarItems[listitem][1], GetPlayerMoneyEx(playerid), GetPVarInt(playerid, "Bank"));
  655. ConfigPayment(playerid, 1, string);
  656. }
  657. //==========//
  658. case 25: // MOD SHOP DIALOG
  659. {
  660. switch(GetPVarInt(playerid, "VEHSEC"))
  661. {
  662. case 0:
  663. {
  664. if(!response) // EXIT MOD SHOP
  665. {
  666. new id = GetPVarInt(playerid, "VEHMODID");
  667. new idcar = GetPlayerVehicleID(playerid);
  668. DeletePVar(playerid, "VEHMOD"), DeletePVar(playerid, "VEHMODKEY");
  669. SetVehiclePosEx(idcar, ModShop[id][0], ModShop[id][1], ModShop[id][2]);
  670. foreach(new i : Player)
  671. {
  672. if(GetPlayerVehicleID(i) == idcar)
  673. {
  674. if(i != playerid) SetPVarInt(i, "SeatIDm", GetPlayerVehicleSeat(i));
  675. TogglePlayerControllableEx(i, true);
  676. SetVehicleVirtualWorldEx(idcar, 0);
  677. SetPlayerVirtualWorld(i, 0);
  678. if(i != playerid) PutPlayerInVehicleEx(i, idcar, GetPVarInt(i, "SeatIDm"));
  679. SetCameraBehindPlayer(i);
  680. }
  681. }
  682. return true;
  683. }
  684. SetPVarInt(playerid, "VEHSEC", listitem+1);
  685. CallRemoteFunction("VehMod", "i", playerid);
  686. }
  687. case 1: // SELECT COLOR 1
  688. {
  689. if(!response) // RETURN TO MENU
  690. {
  691. SetPVarInt(playerid, "VEHSEC", 0);
  692. CallRemoteFunction("VehMod", "i", playerid);
  693. return true;
  694. }
  695. if(!strlen(inputtext)) return CallRemoteFunction("VehMod", "i", playerid);
  696. if(strlen(inputtext) >= 7) return CallRemoteFunction("VehMod", "i", playerid);
  697. new amount = strval(inputtext);
  698. if(amount < 0) return CallRemoteFunction("VehMod", "i", playerid);
  699. if(amount > 300) return CallRemoteFunction("VehMod", "i", playerid);
  700. new cost = 500;
  701. if(GetPVarInt(playerid, "DonateRank") >= 2) cost = 0;
  702. if(GetPlayerMoneyEx(playerid) >= cost)
  703. {
  704. new key = GetPVarInt(playerid, "VEHMODKEY"), query[65];
  705.  
  706. GivePlayerMoneyEx(playerid, -cost);
  707. VehicleInfo[key][vColorOne]=amount;
  708. ChangeVehicleColor(GetPlayerVehicleID(playerid), VehicleInfo[key][vColorOne], VehicleInfo[key][vColorTwo]);
  709. CallRemoteFunction("VehMod", "i", playerid);
  710. format(string, 128, "ColorID %d purchased !", amount);
  711. SCM(playerid, COLOR_WHITE, string);
  712. mysql_format(handlesql, query, sizeof(query), "UPDATE `vehicles` SET `ColorOne` = %i WHERE `ID` = %i;", VehicleInfo[key][vColorOne], VehicleInfo[key][vID]);
  713. mysql_tquery(handlesql, query);
  714. }
  715. else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds !"), CallRemoteFunction("VehMod", "i", playerid);
  716. }
  717. case 2: // SELECT COLOR 2
  718. {
  719. if(!response) // RETURN TO MENU
  720. {
  721. SetPVarInt(playerid, "VEHSEC", 0);
  722. CallRemoteFunction("VehMod", "i", playerid);
  723. return true;
  724. }
  725. if(!strlen(inputtext)) return CallRemoteFunction("VehMod", "i", playerid);
  726. if(strlen(inputtext) >= 7) return CallRemoteFunction("VehMod", "i", playerid);
  727. new amount = strval(inputtext);
  728. if(amount < 0) return CallRemoteFunction("VehMod", "i", playerid);
  729. if(amount > 300) return CallRemoteFunction("VehMod", "i", playerid);
  730. new cost = 500;
  731. if(GetPVarInt(playerid, "DonateRank") >= 2) cost = 0;
  732. if(GetPlayerMoneyEx(playerid) >= cost)
  733. {
  734. new key = GetPVarInt(playerid, "VEHMODKEY"), query[65];
  735.  
  736. GivePlayerMoneyEx(playerid, -cost);
  737. VehicleInfo[key][vColorTwo]=amount;
  738. ChangeVehicleColor(GetPlayerVehicleID(playerid), VehicleInfo[key][vColorOne], VehicleInfo[key][vColorTwo]);
  739. CallRemoteFunction("VehMod", "i", playerid);
  740. format(string, 128, "ColorID %d purchased !", amount);
  741. SCM(playerid, COLOR_WHITE, string);
  742. mysql_format(handlesql, query, sizeof(query), "UPDATE `vehicles` SET `ColorTwo` = %i WHERE `ID` = %i;", VehicleInfo[key][vColorTwo], VehicleInfo[key][vID]);
  743. mysql_tquery(handlesql, query);
  744. }
  745. else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds !"), CallRemoteFunction("VehMod", "i", playerid);
  746. }
  747. case 3: // SELECT WHEELS
  748. {
  749. if(!response) // RETURN TO MENU
  750. {
  751. SetPVarInt(playerid, "VEHSEC", 0);
  752. CallRemoteFunction("VehMod", "i", playerid);
  753. return true;
  754. }
  755. ShowWheels(playerid);
  756. }
  757. case 4: // BODY MODS
  758. {
  759. if(!response) // RETURN TO MENU
  760. {
  761. SetPVarInt(playerid, "VEHSEC", 0);
  762. CallRemoteFunction("VehMod", "i", playerid);
  763. return true;
  764. }
  765. new key = GetPVarInt(playerid, "VEHMODKEY");
  766. new price = 0;
  767. if(GetPVarInt(playerid, "DonateRank") == 0) price = 1000;
  768. if(GetPlayerMoneyEx(playerid) >= price)
  769. {
  770. new comp[20], compname[20][128];
  771. comp[0]=1087, compname[0]="Hydraulics";
  772. switch(GetVehicleModel(GetPlayerVehicleID(playerid)))
  773. {
  774. case 534: // REMMINGTON
  775. {
  776. comp[1]=1100, compname[1]="Bullbar Chrome Grill";
  777. comp[2]=1101, compname[2]="Sideskirt Left `Chrome Flames`";
  778. comp[3]=1106, compname[3]="Sideskirt Right `Chrome Arches`";
  779. comp[4]=1122, compname[4]="Sideskirt Right `Chrome Flames`";
  780. comp[5]=1123, compname[5]="Bullbars Bullbar Chrome Bars";
  781. comp[6]=1124, compname[6]="Sideskirt Left `Chrome Arches`";
  782. comp[7]=1125, compname[7]="Bullbars Bullbar Chrome Lights";
  783. comp[8]=1126, compname[8]="Exhaust Chrome Exhaust";
  784. comp[9]=1127, compname[9]="Exhaust Slamin Exhaust";
  785. comp[10]=1178, compname[10]="Rear Bumper Slamin";
  786. comp[11]=1179, compname[11]="Front Bumper Chrome";
  787. comp[12]=1180, compname[12]="Rear Bumper Chrome";
  788. comp[13]=1185, compname[13]="Front Bumper Slamin";
  789. }
  790. case 535: // SLAMVAN
  791. {
  792. comp[1]=1109, compname[1]="Rear Bullbars Chrome";
  793. comp[2]=1110, compname[2]="Rear Bullbars Slamin";
  794. comp[3]=1111, compname[3]="Front Sign?Little Sign?";
  795. comp[4]=1112, compname[4]="Front Sign?Little Sign?";
  796. comp[5]=1113, compname[5]="Exhaust Chrome";
  797. comp[6]=1114, compname[6]="Exhaust Slamin";
  798. comp[7]=1115, compname[7]="Front Bullbars Chrome";
  799. comp[8]=1116, compname[8]="Front Bullbars Slamin";
  800. comp[9]=1117, compname[9]="Front Bumper Chrome";
  801. comp[10]=1118, compname[10]="Sideskirt Right `Chrome Trim`";
  802. comp[11]=1119, compname[11]="Sideskirt Right `Wheelcovers`";
  803. comp[12]=1120, compname[12]="Sideskirt Left `Chrome Trim`";
  804. comp[13]=1121, compname[13]="Sideskirt Left `Wheelcovers`";
  805. }
  806. case 536: // BLADE
  807. {
  808. comp[1]=1103, compname[1]="Roof Covertible";
  809. comp[2]=1104, compname[2]="Exhaust Chrome";
  810. comp[3]=1105, compname[3]="Exhaust Slamin";
  811. comp[4]=1107, compname[4]="Sideskirt Left `Chrome Strip`";
  812. comp[5]=1108, compname[5]="Sideskirt Right `Chrome Strip`";
  813. comp[6]=1128, compname[6]="RoofVinyl Hardtop";
  814. comp[7]=1181, compname[7]="Front Bumper Slamin";
  815. comp[8]=1182, compname[8]="Front Bumper Chrome";
  816. comp[9]=1183, compname[9]="Rear Bumper Slamin";
  817. comp[10]=1184, compname[10]="Rear Bumper Chrome";
  818. }
  819. case 567: // SAVANNA
  820. {
  821. comp[1]=1102, compname[1]="Sideskirt Left `Chrome Strip`";
  822. comp[2]=1129, compname[2]="Exhaust Chrome";
  823. comp[3]=1130, compname[3]="Roof Hardtop";
  824. comp[4]=1131, compname[4]="Roof Softtop";
  825. comp[5]=1132, compname[5]="Exhaust Slamin";
  826. comp[6]=1133, compname[6]="Sideskirt Right `Chrome Strip`";
  827. comp[7]=1186, compname[7]="Rear Bumper Slamin";
  828. comp[8]=1187, compname[8]="Rear Bumper Chrome";
  829. comp[9]=1188, compname[9]="Front Bumper Slamin";
  830. comp[10]=1189, compname[10]="Front Bumper Chrome";
  831. }
  832. case 558: // URANUS
  833. {
  834. comp[1]=1088, compname[1]="Roof Alien";
  835. comp[2]=1089, compname[2]="Exhaust X-Flow";
  836. comp[3]=1090, compname[3]="SideskirtRight Alien";
  837. comp[4]=1091, compname[4]="RoofX-Flow";
  838. comp[5]=1092, compname[5]="Exhaust Alien";
  839. comp[6]=1093, compname[6]="Sideskirt Left X-Flow";
  840. comp[7]=1094, compname[7]="Sideskirt Left Alien";
  841. comp[8]=1095, compname[8]="Sideskirt Right X-Flow";
  842. comp[9]=1163, compname[9]="SpoilerX-Flow";
  843. comp[10]=1164, compname[10]="Spoiler Alien";
  844. comp[11]=1165, compname[11]="Front Bumper X-Flow";
  845. comp[12]=1166, compname[12]="Front Bumper Alien";
  846. comp[13]=1167, compname[13]="Rear Bumper X-Flow";
  847. comp[14]=1168, compname[14]="Rear Bumper Alien";
  848. }
  849. case 559: // JESTER
  850. {
  851. comp[1]=1065, compname[1]="Exhaust Alien";
  852. comp[2]=1066, compname[2]="Exhaust X-Flow";
  853. comp[3]=1067, compname[3]="Roof Alien";
  854. comp[4]=1068, compname[4]="Roof X-Flow";
  855. comp[5]=1069, compname[5]="Right Alien Sideskirt";
  856. comp[6]=1070, compname[6]="Right X-Flow Sideskirt";
  857. comp[7]=1071, compname[7]="Left Alien Sideskirt";
  858. comp[8]=1072, compname[8]="Left X-Flow Sideskirt";
  859. comp[9]=1158, compname[9]="SpoilerX-Flow";
  860. comp[10]=1159, compname[10]="Rear BumperAlien";
  861. comp[11]=1160, compname[11]="Front BumperAlien";
  862. comp[12]=1161, compname[12]="Rear BumperX-Flow";
  863. comp[13]=1162, compname[13]="Spoiler Alien";
  864. comp[14]=1173, compname[14]="Front BumperX-Flow";
  865. }
  866. case 560: // SULTAN
  867. {
  868. comp[1]=1026, compname[1]="Sideskirt Right Alien";
  869. comp[2]=1027, compname[2]="Sideskirt Left Alien";
  870. comp[3]=1028, compname[3]="Exhaust Alien";
  871. comp[4]=1029, compname[4]="Exhaust X-Flow";
  872. comp[5]=1030, compname[5]="Sideskirt Left X-Flow";
  873. comp[6]=1031, compname[6]="Sideskirt Right X-Flow";
  874. comp[7]=1032, compname[7]="RoofAlien Roof Vent";
  875. comp[8]=1033, compname[8]="RoofX-Flow Roof Vent";
  876. comp[9]=1138, compname[9]="Spoiler Alien";
  877. comp[10]=1139, compname[10]="SpoilerX-Flow";
  878. comp[11]=1140, compname[11]="Rear BumperX-Flow";
  879. comp[12]=1141, compname[12]="Rear Bumper Alien";
  880. comp[13]=1169, compname[13]="Front Bumper Alien";
  881. comp[14]=1170, compname[14]="Front BumperX-Flow";
  882. }
  883. case 561: // stratum
  884. {
  885. comp[1]=1055, compname[1]="Roof Alien";
  886. comp[2]=1056, compname[2]="SideskirtRight Alien";
  887. comp[3]=1057, compname[3]="SideskirtRight X-Flow";
  888. comp[4]=1058, compname[4]="Spoiler Alien";
  889. comp[5]=1059, compname[5]="ExhaustX-Flow";
  890. comp[6]=1060, compname[6]="SpoilerX-Flow";
  891. comp[7]=1061, compname[7]="RoofX-Flow";
  892. comp[8]=1062, compname[8]="SideskirtLeft Alien";
  893. comp[9]=1063, compname[9]="SideskirtLeft X-Flow";
  894. comp[10]=1064, compname[10]="Exhaust Alien";
  895. comp[11]=1154, compname[11]="Rear BumperAlien";
  896. comp[12]=1155, compname[12]="Front BumperAlien";
  897. comp[13]=1156, compname[13]="Rear BumperX-Flow";
  898. comp[14]=1157, compname[14]="Front BumperX-Flow";
  899. }
  900. case 562: // elegy
  901. {
  902. comp[1]=1034, compname[1]="Exhaust Alien";
  903. comp[2]=1035, compname[2]="RoofX-Flow Roof Vent";
  904. comp[3]=1036, compname[3]="SideSkirt Right Alien";
  905. comp[4]=1037, compname[4]="ExhaustX-Flow";
  906. comp[5]=1038, compname[5]="RoofAlien Roof Vent";
  907. comp[6]=1039, compname[6]="SideSkirtLeft X-Flow";
  908. comp[7]=1040, compname[7]="SideSkirtLeft Alien";
  909. comp[8]=1041, compname[8]="SideSkirtRight X-Flow";
  910. comp[9]=1146, compname[9]="SpoilerX-Flow";
  911. comp[10]=1147, compname[10]="Spoiler Alien";
  912. comp[11]=1148, compname[11]="Rear BumperX-Flow";
  913. comp[12]=1149, compname[12]="Rear BumperAlien";
  914. comp[13]=1171, compname[13]="Front BumperAlien";
  915. comp[14]=1172, compname[14]="Front BumperX-Flow";
  916. }
  917. case 565: // flash
  918. {
  919. comp[1]=1045, compname[1]="ExhaustX-Flow";
  920. comp[2]=1046, compname[2]="Exhaust Alien";
  921. comp[3]=1047, compname[3]="SideSkirtRight Alien";
  922. comp[4]=1048, compname[4]="SideSkirtRight X-Flow";
  923. comp[5]=1049, compname[5]="Spoiler Alien";
  924. comp[6]=1050, compname[6]="Spoiler X-Flow";
  925. comp[7]=1051, compname[7]="SideSkirtLeft Alien";
  926. comp[8]=1052, compname[8]="SideSkirtLeft X-Flow";
  927. comp[9]=1053, compname[9]="RoofX-Flow";
  928. comp[10]=1054, compname[10]="Roof Alien";
  929. comp[11]=1150, compname[11]="Bumper Alien";
  930. comp[12]=1151, compname[12]="BumperX-Flow";
  931. comp[13]=1152, compname[13]="BumperX-Flow";
  932. comp[14]=1153, compname[14]="Bumper Alien";
  933. }
  934. case 575: // broadway
  935. {
  936. comp[1]=1042, compname[1]="SideSkirt Right Chrome";
  937. comp[2]=1043, compname[2]="Exhaust Slamin";
  938. comp[3]=1044, compname[3]="Exhaust Chrome";
  939. comp[4]=1099, compname[4]="SideskirtLeft Chrome";
  940. comp[5]=1174, compname[5]="Front Bumper Chrome";
  941. comp[6]=1175, compname[6]="Rear Bumper Slamin";
  942. comp[7]=1176, compname[7]="Front Bumper Chrome";
  943. comp[8]=1177, compname[8]="Rear Bumper Slamin";
  944. }
  945. case 576: // tornado
  946. {
  947. comp[1]=1134, compname[1]="SideSkirt Right `Chrome Strip`";
  948. comp[2]=1135, compname[2]="Exhaust Slamin";
  949. comp[3]=1136, compname[3]="Exhaust Chrome";
  950. comp[4]=1137, compname[4]="SideskirtLeft `Chrome Strip`";
  951. comp[5]=1190, compname[5]="Front Bumper Slamin";
  952. comp[6]=1191, compname[6]="Front Bumper Chrome";
  953. comp[7]=1192, compname[7]="Rear Bumper Chrome";
  954. comp[8]=1193, compname[8]="Rear Bumper Slamin";
  955. }
  956. }
  957.  
  958. new query[300];
  959. key = GetPVarInt(playerid, "VEHMODKEY");
  960. GivePlayerMoneyEx(playerid, -price);
  961. AddVehicleComponent(GetPlayerVehicleID(playerid), comp[listitem]);
  962. format(string, 128, "%s purchased for $%d!", compname[listitem], price);
  963. SCM(playerid, COLOR_WHITE, string);
  964. CallRemoteFunction("VehMod", "i", playerid);
  965. PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
  966. AddVehMod(key, comp[listitem]);
  967. mysql_format(handlesql, query, sizeof(query), "UPDATE `vehicles` SET `Mod1` = %i, `Mod2` = %i, `Mod3` = %i, `Mod4` = %i, `Mod5` = %i, `Mod6` = %i, `Mod7` = %i, \
  968. `Mod8` = %i, `Mod9` = %i, `Mod10` = %i, `Mod11` = %i WHERE `ID` = %i;",
  969. VehicleInfo[key][vMod][0], VehicleInfo[key][vMod][1], VehicleInfo[key][vMod][2], VehicleInfo[key][vMod][3], VehicleInfo[key][vMod][4], VehicleInfo[key][vMod][5],
  970. VehicleInfo[key][vMod][6], VehicleInfo[key][vMod][7], VehicleInfo[key][vMod][8], VehicleInfo[key][vMod][9], VehicleInfo[key][vMod][10], VehicleInfo[key][vID]);
  971. mysql_tquery(handlesql, query);
  972. }
  973. else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds !"), CallRemoteFunction("VehMod", "i", playerid);
  974. }
  975. case 5: // REMOVE MODS
  976. {
  977. new found, query[300];
  978.  
  979. key = GetPVarInt(playerid, "VEHMODKEY");
  980. for(new i = 1; i < 10; i++)
  981. {
  982. if(VehicleInfo[key][vMod][i] >= 1000 && VehicleInfo[key][vMod][i] <= 1193)
  983. {
  984. RemoveVehicleComponent(GetPlayerVehicleID(playerid), VehicleInfo[key][vMod][i]);
  985. found++;
  986. VehicleInfo[key][vMod][i]=0;
  987. }
  988. }
  989. format(string, 128, "%d components removed !", found);
  990. SCM(playerid, COLOR_WHITE, string);
  991. PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
  992. mysql_format(handlesql, query, sizeof(query), "UPDATE `vehicles` SET `Mod1` = %i, `Mod2` = %i, `Mod3` = %i, `Mod4` = %i, `Mod5` = %i, `Mod6` = %i, `Mod7` = %i, \
  993. `Mod8` = %i, `Mod9` = %i, `Mod10` = %i, `Mod11` = %i WHERE `ID` = %i;",
  994. VehicleInfo[key][vMod][0], VehicleInfo[key][vMod][1], VehicleInfo[key][vMod][2], VehicleInfo[key][vMod][3], VehicleInfo[key][vMod][4], VehicleInfo[key][vMod][5],
  995. VehicleInfo[key][vMod][6], VehicleInfo[key][vMod][7], VehicleInfo[key][vMod][8], VehicleInfo[key][vMod][9], VehicleInfo[key][vMod][10], VehicleInfo[key][vID]);
  996. mysql_tquery(handlesql, query);
  997. SetPVarInt(playerid, "VEHSEC", 0);
  998. CallRemoteFunction("VehMod", "i", playerid);
  999. }
  1000. }
  1001. }
  1002. //==========//
  1003. case 26:
  1004. {
  1005. format(string, sizeof(string),"%s", PlayerNameEx(playerid));
  1006. switch(response)
  1007. {
  1008. case 0:
  1009. {
  1010. SetPlayerColor(playerid, COLOR_WHITE);
  1011. if(GetPVarInt(playerid, "MaskUse") == 1) Update3DTextLabelText(PlayerTag[playerid], COLOR_WHITE, string);
  1012. }
  1013. case 1:
  1014. {
  1015. SetPlayerColor(playerid, 0x8080FFAA);
  1016. if(GetPVarInt(playerid, "MaskUse") == 1) Update3DTextLabelText(PlayerTag[playerid], 0x8080FFFF, string);
  1017. }
  1018. }
  1019. }
  1020. //==========//
  1021. case 27: // Roadblocks
  1022. {
  1023. switch(response)
  1024. {
  1025. case 1: // Selecting
  1026. {
  1027. new Float:X,Float:Y,Float:Z,Float:A;
  1028. GetPlayerPos(playerid, X, Y, Z);
  1029. GetPlayerFacingAngle(playerid,A);
  1030. RoadBlocks++;
  1031. switch(listitem)
  1032. {
  1033. case 0: RoadBlockObject[RoadBlocks] = CreateDynamicObject(973, X, Y+1, Z, 0, 0, A, 0);
  1034. case 1: RoadBlockObject[RoadBlocks] = CreateDynamicObject(997, X, Y, Z-1, 0, 0, A, 0);
  1035. case 2: RoadBlockObject[RoadBlocks] = CreateDynamicObject(1237, X, Y, Z-1, 0, 0, A, 0);
  1036. case 3: RoadBlockObject[RoadBlocks] = CreateDynamicObject(1282, X, Y, Z-0.5, 0, 0, A, 0);
  1037. case 4: RoadBlockObject[RoadBlocks] = CreateDynamicObject(1422, X, Y, Z-0.5, 0, 0, A, 0);
  1038. case 5: RoadBlockObject[RoadBlocks] = CreateDynamicObject(18646, X, Y, Z-1.0, 0, 0, A, 0);
  1039. case 6: RoadBlockObject[RoadBlocks] = CreateDynamicObject(978, X, Y, Z-0.2, 0, 0, A, 0);
  1040. case 7: RoadBlockObject[RoadBlocks] = CreateDynamicObject(3091, X, Y, Z-0.7, 0, 0, A, 0);
  1041. case 8: RoadBlockObject[RoadBlocks] = CreateDynamicObject(981, X, Y, Z-0.3, 0, 0, A, 0);
  1042. }
  1043. }
  1044. }
  1045. }
  1046. //==========//
  1047. case 28:
  1048. {
  1049. switch(response)
  1050. {
  1051. case 1: // Selecting
  1052. {
  1053. switch(listitem)
  1054. {
  1055. case 0: // LSPD
  1056. {
  1057. ShowPlayerDialog(playerid,29,DIALOG_STYLE_LIST,"Car Color","{33FF66}Black\n{33FF66}Blue\n{33FF66}Green\n{33FF66}Grey", "Select", "");
  1058. SetPVarInt(playerid, "CarType", 1);
  1059. }
  1060. case 1: // SFPD
  1061. {
  1062. if(GetPVarInt(playerid, "Rank") >= 5)
  1063. {
  1064. ShowPlayerDialog(playerid,29,DIALOG_STYLE_LIST,"Car Color","{33FF66}Black\n{33FF66}Blue\n{33FF66}Green\n{33FF66}Grey", "Select", "");
  1065. SetPVarInt(playerid, "CarType", 2);
  1066. }
  1067. else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
  1068. }
  1069. case 2: // LVPD
  1070. {
  1071. if(GetPVarInt(playerid, "Rank") >= 7)
  1072. {
  1073. ShowPlayerDialog(playerid,29,DIALOG_STYLE_LIST,"Car Color","{33FF66}Black\n{33FF66}Blue\n{33FF66}Green\n{33FF66}Grey", "Select", "");
  1074. SetPVarInt(playerid, "CarType", 3);
  1075. }
  1076. else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
  1077. }
  1078. case 3: // S.W.A.T Truck
  1079. {
  1080. if(GetPVarInt(playerid, "Rank") >= 5) CreateLSPDVehicle(playerid,427,0,1,"LSPD");
  1081. else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
  1082. }
  1083. case 4: // Ranger
  1084. {
  1085. if(GetPVarInt(playerid, "Rank") >= 5)
  1086. {
  1087. ShowPlayerDialog(playerid,29,DIALOG_STYLE_LIST,"Car Color","{33FF66}Black\n{33FF66}Blue\n{33FF66}Green\n{33FF66}Grey", "Select", "");
  1088. SetPVarInt(playerid, "CarType", 4);
  1089. }
  1090. else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
  1091. }
  1092. case 5: // Police Bike
  1093. {
  1094. if(GetPVarInt(playerid, "Rank") >= 2) CreateLSPDVehicle(playerid,523,0,1,"LSPD");
  1095. else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
  1096. }
  1097. case 6: // Rancher
  1098. {
  1099. if(GetPVarInt(playerid, "Rank") >= 4) CreateLSPDVehicle(playerid,490,0,0,"LSPD");
  1100. else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
  1101. }
  1102. case 7: // LSPD Chopper
  1103. {
  1104. if(GetPVarInt(playerid, "Rank") >= 3) CreateLSPDVehicle(playerid,497,0,0,"LSPD");
  1105. else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
  1106. }
  1107. case 8: // WATER TANK
  1108. {
  1109. if(GetPVarInt(playerid, "Rank") >= 3) CreateLSPDVehicle(playerid,601,0,0,"LSPD");
  1110. else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
  1111. }
  1112. case 9: // Tow Truck
  1113. {
  1114. if(GetPVarInt(playerid, "Rank") >= 2) CreateLSPDVehicle(playerid,525,0,0,"LSPD");
  1115. else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
  1116. }
  1117. }
  1118. }
  1119. }
  1120. }
  1121. //==========//
  1122. case 29:
  1123. {
  1124. switch(listitem)
  1125. {
  1126. case 0: // Black
  1127. {
  1128. switch(GetPVarInt(playerid, "CarType"))
  1129. {
  1130. case 1: CreateLSPDVehicle(playerid,596,0,1,"LSPD");
  1131. case 2: CreateLSPDVehicle(playerid,597,0,1,"LSPD");
  1132. case 3: CreateLSPDVehicle(playerid,598,0,1,"LSPD");
  1133. case 4: CreateLSPDVehicle(playerid,599,0,1,"LSPD");
  1134. }
  1135. }
  1136. case 1: // Blue
  1137. {
  1138. switch(GetPVarInt(playerid, "CarType"))
  1139. {
  1140. case 1: CreateLSPDVehicle(playerid,596,79,1,"LSPD");
  1141. case 2: CreateLSPDVehicle(playerid,597,79,1,"LSPD");
  1142. case 3: CreateLSPDVehicle(playerid,598,79,1,"LSPD");
  1143. case 4: CreateLSPDVehicle(playerid,599,79,1,"LSPD");
  1144. }
  1145. }
  1146. case 2: // Green
  1147. {
  1148. switch(GetPVarInt(playerid, "CarType"))
  1149. {
  1150. case 1: CreateLSPDVehicle(playerid,596,16,1,"LSPD");
  1151. case 2: CreateLSPDVehicle(playerid,597,16,1,"LSPD");
  1152. case 3: CreateLSPDVehicle(playerid,598,16,1,"LSPD");
  1153. case 4: CreateLSPDVehicle(playerid,599,16,1,"LSPD");
  1154. }
  1155. }
  1156. case 3: // Grey
  1157. {
  1158. switch(GetPVarInt(playerid, "CarType"))
  1159. {
  1160. case 1: CreateLSPDVehicle(playerid,596,29,29,"LSPD");
  1161. case 2: CreateLSPDVehicle(playerid,597,29,29,"LSPD");
  1162. case 3: CreateLSPDVehicle(playerid,598,29,29,"LSPD");
  1163. case 4: CreateLSPDVehicle(playerid,599,29,29,"LSPD");
  1164. }
  1165. }
  1166. }
  1167. }
  1168. //==========//
  1169. case 30: // Inventory Menu
  1170. {
  1171. if(!response) return true;
  1172. new chosen = listitem, str[50];
  1173. if(PlayerInfo[playerid][pDelay] > 0) return 1; // Block any fix inv breaks.
  1174. if(chosen == MAX_INV_SLOTS) // STORE WEAPON SECTION !
  1175. {
  1176. if(GetPVarInt(playerid, "JustChosen") == 1) return error(playerid, "You must wait a second.");
  1177. cmd_putgun(playerid, "");
  1178. return true;
  1179. }
  1180. else if(chosen == MAX_INV_SLOTS + 1) // DROP WEAPON SECTION !
  1181. {
  1182. if(GetPVarInt(playerid, "PlayerLogged") != 1) return true;
  1183. if(GetPVarInt(playerid, "LSPD_Ta") == 1) return 1; // Block taser bug.
  1184. if(GetPVarInt(playerid, "JustChosen") == 1) return error(playerid, "You must wait a second.");
  1185. if(GetPVarInt(playerid, "Dead") > 0) return SendClientMessage(playerid, COLOR_GREY, "You cannot give out weapons when your character has died.");
  1186. if(PlayerInfo[playerid][pPlayerWeapon] == 0) return SendClientMessage(playerid, COLOR_GREY, "You aren't even holding a weapon.");
  1187. if(GetPlayerPing(playerid) >= 500) return SendClientMessage(playerid, COLOR_WHITE, "Your ping is too high to use this!");
  1188. new sweapon, sammo;
  1189. for (new i = 0; i < 9; i++) {
  1190. GetPlayerWeaponData(playerid, i, sweapon, sammo);
  1191. if(sweapon == PlayerInfo[playerid][pPlayerWeapon]) {
  1192. PlayerInfo[playerid][pPlayerAmmo]=sammo;
  1193. }
  1194. }
  1195. if(PlayerInfo[playerid][pPlayerWeapon] >= 22 && PlayerInfo[playerid][pPlayerWeapon] <= 34)
  1196. {
  1197. new amount = PlayerInfo[playerid][pPlayerAmmo], am = 0;
  1198. switch(PlayerInfo[playerid][pPlayerWeapon])
  1199. {
  1200. case 22 .. 24: am=7;
  1201. case 25 .. 27: am=6;
  1202. case 28 .. 32: am=30;
  1203. case 33, 34: am=10;
  1204. }
  1205. if(amount > am)
  1206. {
  1207. switch(PlayerInfo[playerid][pAmmoType])
  1208. {
  1209. case 101: am=14;
  1210. case 107: am=14;
  1211. case 116: am=60;
  1212. case 126: am=80;
  1213. case 127: am=60;
  1214. }
  1215. amount = am;
  1216. }
  1217. PlayerInfo[playerid][pPlayerAmmo]=amount;
  1218. if(PlayerInfo[playerid][pAmmoType] == 0) {
  1219. PlayerInfo[playerid][pPlayerAmmo]=0; }
  1220. }
  1221. new Float:X, Float:Y, Float:Z, pw = PlayerInfo[playerid][pPlayerWeapon];
  1222. GetPlayerPos(playerid, X, Y, Z);
  1223. format(str, 50, "%s dropped!", PrintIName(pw));
  1224. SendClientMessage(playerid, COLOR_WHITE, str);
  1225. if(GetPVarInt(playerid, "Member") != 1 && PlayerInfo[playerid][pPlayerWeapon] != 42 && GetPVarInt(playerid, "Member") != 8)
  1226. {
  1227. CreateLoot(PlayerInfo[playerid][pPlayerWeapon], PlayerInfo[playerid][pPlayerAmmo], PlayerInfo[playerid][pAmmoType], PlayerInfo[playerid][pSerial], X, Y, Z, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
  1228. }
  1229. ResetPlayerWeapons(playerid);
  1230. PlayerInfo[playerid][pPlayerWeapon]=0;
  1231. PlayerInfo[playerid][pPlayerAmmo]=0;
  1232. ResetPlayerWeaponsEx(playerid);
  1233. format(str, 50, "%s dropped his %s", PlayerInfo[playerid][pName], PrintIName(pw));
  1234. WepLog(str);
  1235. SetTimerEx("LoadHolsters", 1500, false, "i", playerid);
  1236. return true;
  1237. }
  1238. else if(chosen == MAX_INV_SLOTS + 2) // STORE AMMO SECTION !
  1239. {
  1240. if(GetPVarInt(playerid, "LSPD_Ta") == 1) return 1; // Block taser bug.
  1241. if(GetPVarInt(playerid, "JustChosen") == 1) return error(playerid, "You must wait a second.");
  1242. if(GetPlayerPing(playerid) >= 500) return SendClientMessage(playerid, COLOR_WHITE, "Your ping is too high to use this!");
  1243. if(CheckInv(playerid) == 1)
  1244. {
  1245. new sweapon, sammo;
  1246. for (new i = 0; i < 9; i++)
  1247. {
  1248. GetPlayerWeaponData(playerid, i, sweapon, sammo);
  1249. if(sweapon == PlayerInfo[playerid][pPlayerWeapon])
  1250. {
  1251. PlayerInfo[playerid][pPlayerAmmo]=sammo;
  1252. }
  1253. }
  1254. if(PlayerInfo[playerid][pPlayerWeapon] >= 22 && PlayerInfo[playerid][pPlayerWeapon] <= 34)
  1255. {
  1256. new amount = PlayerInfo[playerid][pPlayerAmmo], am = 0;
  1257. switch(PlayerInfo[playerid][pPlayerWeapon])
  1258. {
  1259. case 22 .. 24: am=150;
  1260. case 25 .. 27: am=150;
  1261. case 28 .. 32: am=500;
  1262. case 33, 34: am=250;
  1263. }
  1264. if(amount > am) {
  1265. amount = am; }
  1266. }
  1267. ResetPlayerWeapons(playerid);
  1268. GiveInvItem(playerid, PlayerInfo[playerid][pAmmoType], PlayerInfo[playerid][pPlayerAmmo], 0);
  1269. format(str, 50, "%s stored into your inventory!", PrintIName(PlayerInfo[playerid][pAmmoType]));
  1270. SendClientMessage(playerid, COLOR_WHITE, str);
  1271. PlayerInfo[playerid][pPlayerAmmo]=0, PlayerInfo[playerid][pAmmoType]=0;
  1272. SetTimerEx("LoadHolsters", 1500, false, "i", playerid);
  1273. }
  1274. else SendClientMessage(playerid, COLOR_WHITE, "Your inventory is currently full!");
  1275. return true;
  1276. }
  1277.  
  1278. if(GetPVarInt(playerid, "Combining"))
  1279. {
  1280. if(PlayerInfo[playerid][pInvItem][GetPVarInt(playerid, "CombiningChose")] != PlayerInfo[playerid][pInvItem][chosen])
  1281. {
  1282. SendClientMessage(playerid, COLOR_GREY, "You can only combine items of the same type.");
  1283. SetPVarInt(playerid, "Combining", 0);
  1284. SetPVarInt(playerid, "CombiningChose", 0);
  1285. return 1;
  1286. }
  1287.  
  1288. switch(PlayerInfo[playerid][pInvItem][GetPVarInt(playerid, "CombiningChose")])
  1289. {
  1290. case 500, 501, 502, 503, 504, 505, 506, 507:
  1291. {
  1292. if(PlayerInfo[playerid][pInvQ][chosen] + PlayerInfo[playerid][pInvQ][GetPVarInt(playerid, "CombiningChose")] > 100)
  1293. {
  1294. SetPVarInt(playerid, "Combining", 0);
  1295. SetPVarInt(playerid, "CombiningChose", 0);
  1296. return SendClientMessage(playerid, COLOR_GREY, "Your combination can't result in a package being bigger than 100.");
  1297. }
  1298.  
  1299. if(chosen == GetPVarInt(playerid, "CombiningChose"))
  1300. {
  1301. SetPVarInt(playerid, "Combining", 0);
  1302. SetPVarInt(playerid, "CombiningChose", 0);
  1303. return SendClientMessage(playerid, COLOR_GREY, "You can't combine an item with itself.");
  1304. }
  1305.  
  1306. PlayerInfo[playerid][pInvQ][chosen] += PlayerInfo[playerid][pInvQ][GetPVarInt(playerid, "CombiningChose")];
  1307. RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][GetPVarInt(playerid, "CombiningChose")], 0, GetPVarInt(playerid, "CombiningChose"));
  1308. SendClientMessage(playerid, COLOR_WHITE, "Items combined!");
  1309. }
  1310. }
  1311.  
  1312. SetPVarInt(playerid, "Combining", 0);
  1313. SetPVarInt(playerid, "CombiningChose", 0);
  1314. return 1;
  1315. }
  1316.  
  1317. if(PlayerInfo[playerid][pInvItem][chosen] > 0) {
  1318. new option_list[128];
  1319.  
  1320. switch(PlayerInfo[playerid][pInvItem][chosen])
  1321. {
  1322. case 500, 501, 502, 503, 504, 505, 506, 507:
  1323. {
  1324. format(option_list, sizeof(option_list), "Use\nDrop\nCombine\nDivide");
  1325. }
  1326.  
  1327. default:
  1328. {
  1329. format(option_list, sizeof(option_list), "Use\nDrop");
  1330. }
  1331. }
  1332.  
  1333. format(str, 50, "%s", PrintIName(PlayerInfo[playerid][pInvItem][chosen]));
  1334. SetPVarInt(playerid, "InvChose", chosen);
  1335. new id = GetPVarInt(playerid, "HouseEnter");
  1336. new kez = -1;
  1337.  
  1338. if(GetCloseHouseSafe(playerid, id) && HouseInfo[id][sLocked] != 1) {
  1339. format(option_list, sizeof(option_list), "%s\nStore in Property", option_list);
  1340. }
  1341.  
  1342. id = GetPVarInt(playerid, "BizzEnter");
  1343. if(GetCloseBizzSafe(playerid, id) && BizInfo[id][sLocked] != 1) {
  1344. format(option_list, sizeof(option_list), "%s\nStore in Business", option_list);
  1345. }
  1346.  
  1347. new keyex = -1;
  1348. if(PlayerToCar(playerid, 1, 4.0))
  1349. {
  1350. keyex = PlayerToCar(playerid, 2, 4.0);
  1351. if(IsValidTCar(keyex))
  1352. {
  1353. if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  1354. {
  1355. format(option_list, sizeof(option_list), "%s\nStore in %s", option_list, PrintVehName(keyex));
  1356. kez = keyex;
  1357. }
  1358. }
  1359.  
  1360. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
  1361. {
  1362. kez = GetPlayerVehicleID(playerid);
  1363. if(!IsHelmetCar(kez) && VehicleInfo[kez][vType] == VEHICLE_PERSONAL) {
  1364. format(option_list, sizeof(option_list), "%s\nStore in Glovebox", option_list);
  1365. } else kez = -1;
  1366. }
  1367. }
  1368.  
  1369. if(kez == -1)
  1370. {
  1371. if(IsPoliceCar(playerid))
  1372. {
  1373. if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  1374. {
  1375. format(option_list, sizeof(option_list), "%s\nStore in %s", option_list, PrintVehName(GetPoliceCarID(playerid)));
  1376. }
  1377. }
  1378. }
  1379.  
  1380. ShowPlayerDialog(playerid, 31, DIALOG_STYLE_LIST, str, option_list, "Select", "Back");
  1381. } else CallRemoteFunction("PrintInv", "i", playerid);
  1382. }
  1383. case 31: // Inventory Menu
  1384. {
  1385. if(!response)
  1386. {
  1387. DeletePVar(playerid, "InvChose");
  1388. CallRemoteFunction("PrintInv", "i", playerid);
  1389. return true;
  1390. }
  1391. new str2[50], chose = GetPVarInt(playerid, "InvChose");
  1392. DeletePVar(playerid, "InvChose");
  1393. switch(listitem)
  1394. {
  1395. case 0: // USE
  1396. {
  1397. switch(PlayerInfo[playerid][pInvItem][chose])
  1398. {
  1399. case 1 .. 99: // WEAPONS
  1400. {
  1401. if(PlayerInfo[playerid][pPlayerWeapon] != 0)
  1402. {
  1403. SendClientMessage(playerid, COLOR_WHITE, "You already have a weapon equiped!");
  1404. CallRemoteFunction("PrintInv", "i", playerid);
  1405. return true;
  1406. }
  1407. if(PlayerInfo[playerid][pInvItem][chose] == 4) {
  1408. if(GetPVarInt(playerid, "ConnectTime") < 150) {
  1409. SendClientMessage(playerid, COLOR_WHITE, "You need (150) hours played to use a knife!");
  1410. return 1;
  1411. }
  1412. }
  1413. if(PlayerInfo[playerid][pInvItem][chose] >= 22 && PlayerInfo[playerid][pInvItem][chose] <= 34) {
  1414. if(GetPVarInt(playerid, "ConnectTime") < 8) {
  1415. SendClientMessage(playerid, COLOR_WHITE, "You need (8) hours played to use firearms!");
  1416. return 1;
  1417. }
  1418. }
  1419. //==========//
  1420. PlayerInfo[playerid][pAmmoType]=PlayerInfo[playerid][pInvEx][chose];
  1421. GivePlayerWeaponEx(playerid, PlayerInfo[playerid][pInvItem][chose], PlayerInfo[playerid][pInvQ][chose]);
  1422. PlayerInfo[playerid][pSerial]=PlayerInfo[playerid][pInvS][chose];
  1423. //==========//
  1424. format(str2, 128, "%s equiped!", PrintIName(PlayerInfo[playerid][pInvItem][chose]));
  1425. SendClientMessage(playerid, COLOR_WHITE, str2);
  1426. //==========//
  1427. RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][chose], 0, chose);
  1428. //==========//
  1429. SetTimerEx("LoadHolsters", 1500, false, "i", playerid);
  1430. }
  1431. case 100 .. 199: // AMMUNITION
  1432. {
  1433. if(PlayerInfo[playerid][pPlayerWeapon] != 0 && PlayerInfo[playerid][pPlayerAmmo] != 0)
  1434. {
  1435. SendClientMessage(playerid, COLOR_WHITE, "Your weapon is currently loaded!");
  1436. CallRemoteFunction("PrintInv", "i", playerid);
  1437. return true;
  1438. }
  1439. if(PlayerInfo[playerid][pPlayerWeapon] == 0)
  1440. {
  1441. SendClientMessage(playerid, COLOR_WHITE, "You don't have any weapon equipped !");
  1442. CallRemoteFunction("PrintInv", "i", playerid);
  1443. return true;
  1444. }
  1445. if(CompatAmmo(playerid, PlayerInfo[playerid][pInvItem][chose]) == 0)
  1446. {
  1447. SendClientMessage(playerid, COLOR_WHITE, "Ammunition is not compatible with this weapon !");
  1448. CallRemoteFunction("PrintInv", "i", playerid);
  1449. return true;
  1450. }
  1451. ApplyAnimation(playerid, "SILENCED", "Silence_reload", 3.0, 0, 0, 0, 0, 0);
  1452. PlayerInfo[playerid][pAmmoType]=PlayerInfo[playerid][pInvItem][chose];
  1453. GivePlayerWeaponEx(playerid, PlayerInfo[playerid][pPlayerWeapon], PlayerInfo[playerid][pInvQ][chose]);
  1454. PlayerInfo[playerid][pSerial]=PlayerInfo[playerid][pInvS][chose];
  1455. //==========//
  1456. format(str2, 128, "%s reloaded with '%s'!", PrintIName(PlayerInfo[playerid][pPlayerWeapon]), PrintIName(PlayerInfo[playerid][pInvItem][chose]));
  1457. SendClientMessage(playerid, COLOR_WHITE, str2);
  1458. //==========//
  1459. RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][chose], 0, chose);
  1460. //==========//
  1461. SetTimerEx("LoadHolsters", 1500, false, "i", playerid);
  1462. }
  1463. case 200 .. 299: // FOOD
  1464. {
  1465. new Float:health, rand;
  1466. rand = random(50)+1;
  1467. GetPlayerHealth(playerid, health);
  1468. health+=float(rand)+20.0;
  1469. if(health >= 100.0) health=99.0;
  1470. SetPlayerHealth(playerid, health);
  1471. //==========//
  1472. switch(PrintIid(PlayerInfo[playerid][pInvItem][chose]))
  1473. {
  1474. case 1: ApplyAnimation(playerid, "FOOD", "EAT_Burger", 3.0, 0, 0, 0, 0, 0);
  1475. case 2: ApplyAnimation(playerid, "VENDING", "VEND_Drink2_P", 3.0, 0, 0, 0, 0, 0);
  1476. }
  1477. //==========//
  1478. format(str2, 128, "%s consumed!", PrintIName(PlayerInfo[playerid][pInvItem][chose]));
  1479. SendClientMessage(playerid, COLOR_WHITE, str2);
  1480. PlaySoundPlyRadius(playerid, 32200, 10.0);
  1481. //==========//
  1482. format(string, sizeof(string), "consumed %s", PrintIName(PlayerInfo[playerid][pInvItem][chose]));
  1483. ForceAME(playerid, string);
  1484. //==========//
  1485. SetPVarInt(playerid, "Hunger", 0);
  1486. //==========//
  1487. RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][chose], 0, chose);
  1488. }
  1489. case 300 .. 399: // SPECIAL ITEMS
  1490. {
  1491. SetPlayerSpecialAction(playerid, PrintIid(PlayerInfo[playerid][pInvItem][chose]));
  1492. //==========//
  1493. format(str2, 128, "%s used!", PrintIName(PlayerInfo[playerid][pInvItem][chose]));
  1494. SendClientMessage(playerid, COLOR_WHITE, str2);
  1495. //==========//
  1496. RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][chose], 0, chose);
  1497. }
  1498. case 400 .. 499: // PVARS
  1499. {
  1500. new allow = 0;
  1501. switch(PlayerInfo[playerid][pInvItem][chose])
  1502. {
  1503. case 400 .. 405: { allow=PlayerInfo[playerid][pInvItem][chose]; }
  1504. case 408 .. 411: { allow=PlayerInfo[playerid][pInvItem][chose]; }
  1505. case 414 .. 415: { allow=PlayerInfo[playerid][pInvItem][chose]; }
  1506. case 417: { allow=PlayerInfo[playerid][pInvItem][chose]; }
  1507. }
  1508. if(allow == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You can't use this item!");
  1509. switch(allow)
  1510. {
  1511. case 400: // DICE
  1512. {
  1513. cmd_dice(playerid, "");
  1514. return true;
  1515. }
  1516. case 401: // MASK
  1517. {
  1518. if(GetPVarInt(playerid, "ConnectTime") <= 55) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need (56) and over hours played!");
  1519. switch(GetPVarInt(playerid, "MaskUse"))
  1520. {
  1521. case 0:
  1522. {
  1523. SetPVarInt(playerid, "MaskUse", 1);
  1524. GameTextForPlayer(playerid, "~w~Mask ~g~On", 5000, 6);
  1525. format(string, sizeof(string),"%s", PlayerNameEx(playerid));
  1526. PlayerTag[playerid] = Create3DTextLabel("NULL",0xFFFFFFFF,0.0,0.0,0.0,8.0,0,1);
  1527. Attach3DTextLabelToPlayer(PlayerTag[playerid], playerid, 0.0, 0.0, 0.1);
  1528. Update3DTextLabelText(PlayerTag[playerid], 0xFFFFFFFF,string);
  1529. foreach(new i : Player) {
  1530. if(GetPVarInt(i, "Admin") < 1) {
  1531. ShowPlayerNameTagForPlayer(i,playerid,0);
  1532. }
  1533. }
  1534. return true;
  1535. }
  1536. case 1:
  1537. {
  1538. SetPVarInt(playerid, "MaskUse", 0);
  1539. GameTextForPlayer(playerid, "~w~Mask ~r~Off", 5000, 6);
  1540. Delete3DTextLabel(PlayerTag[playerid]);
  1541. foreach(new i : Player) { ShowPlayerNameTagForPlayer(i,playerid,1); }
  1542. return true;
  1543. }
  1544. }
  1545. }
  1546. case 402: // WALKIE TALKIE
  1547. {
  1548. cmd_wt(playerid, "");
  1549. return true;
  1550. }
  1551. case 404: // WATCH
  1552. {
  1553. cmd_time(playerid, "");
  1554. return true;
  1555. }
  1556. case 405: // PHONE
  1557. {
  1558. cmd_cellphone(playerid, "");
  1559. return true;
  1560. }
  1561. case 408: // MP5
  1562. {
  1563. cmd_mp3(playerid, "");
  1564. return true;
  1565. }
  1566. case 409, 410: // Cannabis Seeds / GROWING CHEMS
  1567. {
  1568. if (!CheckInvItem(playerid, 409))
  1569. {
  1570. SCM(playerid, COLOR_LIGHTRED, "You need cannabis seeds to continue!");
  1571. return true;
  1572. }
  1573. if (!CheckInvItem(playerid, 410))
  1574. {
  1575. SCM(playerid, COLOR_LIGHTRED, "You need growing chemicals to continue!");
  1576. return true;
  1577. }
  1578.  
  1579. new player_plants = 0;
  1580.  
  1581. for(new weed = 0; weed < sizeof(WeedInfo); weed++)
  1582. {
  1583. if(WeedInfo[weed][wPlanted] != 0 && strcmp(PlayerInfo[playerid][pUsername], WeedInfo[weed][wName]) == 0)
  1584. {
  1585. player_plants++;
  1586. }
  1587. }
  1588.  
  1589. if(player_plants >= MAX_PLAYER_WEED_PLANTS)
  1590. {
  1591. return SendClientMessage(playerid, COLOR_GREY, "You have already planted the maximum allowed amount of cannabis plants per player.");
  1592. }
  1593.  
  1594. for(new weed = 0; weed < sizeof(WeedInfo); weed++)
  1595. {
  1596. if(WeedInfo[weed][wPlanted] == 0 && WeedInfo[weed][wTime] == 0)
  1597. {
  1598. new Float:X,Float:Y,Float:Z;
  1599.  
  1600. RemoveInvItem(playerid, 409, 1); // Remove cannabis seeds
  1601. RemoveInvItem(playerid, 410, 1); // Remove growing chemical
  1602.  
  1603. ApplyAnimation(playerid, "BOMBER","BOM_Plant_In",4.0,0,0,0,0,0);
  1604. GetPlayerPos(playerid, X, Y, Z);
  1605.  
  1606. WeedInfo[weed][wObject] = CreateDynamicObject(3409, X, Y, Z-2.5, 0, 0, GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid));
  1607. WeedInfo[weed][wX] = X;
  1608. WeedInfo[weed][wY] = Y;
  1609. WeedInfo[weed][wZ] = Z;
  1610. WeedInfo[weed][wWorld] = GetPlayerVirtualWorld(playerid);
  1611. WeedInfo[weed][wTime] = 60;
  1612. WeedInfo[weed][wPlanted] = 1;
  1613.  
  1614. format(WeedInfo[weed][wName], MAX_PLAYER_NAME + 1, "%s", PlayerInfo[playerid][pUsername]);
  1615. SendClientMessage(playerid, COLOR_WHITE, "You have planted your cannabis, it will be fully grown in sixty minutes. (press 'H' to collect)");
  1616.  
  1617. format(string, sizeof(string), "AdmWarn: %s(%i) has planted cannabis.", PlayerInfo[playerid][pUsername], playerid);
  1618. SendAdminMessage(COLOR_YELLOW, string);
  1619. return 1;
  1620. }
  1621. }
  1622. }
  1623. case 411: // Baking Soda
  1624. {
  1625. if(!CheckInvItem(playerid, 501))
  1626. {
  1627. SendClientMessage(playerid, COLOR_GREY, "You need Cocaine to continue.");
  1628. return true;
  1629. }
  1630. if(NotAbleToPlant(playerid))
  1631. {
  1632. SendClientMessage(playerid, COLOR_GREY, "You can't do this while in jail.");
  1633. return true;
  1634. }
  1635.  
  1636. for(new weed = 0; weed < sizeof(CrackInfo); weed++)
  1637. {
  1638. if(CrackInfo[weed][cPlanted] == 0 && CrackInfo[weed][cTime] == 0)
  1639. {
  1640. new hasitem = HasInvItem(playerid, 501, 100);
  1641. if(hasitem == -1) return SendClientMessage(playerid, COLOR_GREY, "You need 100 grams of Cocaine to continue.");
  1642.  
  1643. RemoveInvItem(playerid, 501, 100, hasitem);
  1644. RemoveInvItem(playerid, 411);
  1645.  
  1646. ApplyAnimation(playerid, "BOMBER","BOM_Plant_In",4.0,0,0,0,0,0);
  1647.  
  1648. new Float:X,Float:Y,Float:Z;
  1649. GetPlayerPos(playerid, X, Y, Z);
  1650.  
  1651. CrackInfo[weed][cObject] = CreateDynamicObject(1554, X, Y, Z-1.0, 0, 0, GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid));
  1652. CrackInfo[weed][cX] = X;
  1653. CrackInfo[weed][cY] = Y;
  1654. CrackInfo[weed][cZ] = Z;
  1655. CrackInfo[weed][cWorld] = GetPlayerVirtualWorld(playerid);
  1656. CrackInfo[weed][cTime] = 60;
  1657. CrackInfo[weed][cPlanted] = 1;
  1658.  
  1659. strmid(CrackInfo[weed][cName], PlayerInfo[playerid][pUsername], 0, strlen(PlayerInfo[playerid][pUsername]), 255);
  1660. SendClientMessage(playerid, COLOR_WHITE, "You have started cooking crack, it will be done in 60 minutes. (press 'H' to collect)");
  1661. return 1;
  1662. }
  1663. }
  1664. }
  1665. case 415:
  1666. {
  1667. if(!IsInLS(playerid)) {
  1668. scm(playerid, -1, "You need to be in Los Santos for any scanner reception.");
  1669. return 1;
  1670. }
  1671. switch(PlayerInfo[playerid][pScanner])
  1672. {
  1673. case 0:
  1674. {
  1675. PlayerInfo[playerid][pScanner] = 1;
  1676. GameTextForPlayer(playerid, "~w~Scanner~n~~g~On", 4000, 3);
  1677. format(string, sizeof(string), "turned %s police scanner on", CheckSex(playerid));
  1678. ForceAME(playerid, string);
  1679. }
  1680. case 1:
  1681. {
  1682. PlayerInfo[playerid][pScanner] = 0;
  1683. GameTextForPlayer(playerid, "~w~Scanner~n~~r~Off", 4000, 3);
  1684. format(string, sizeof(string), "turned %s police scanner off", CheckSex(playerid));
  1685. ForceAME(playerid, string);
  1686. }
  1687. }
  1688. return 1;
  1689. }
  1690. case 417:
  1691. {
  1692. for(new i = 0; i < MAX_CAMPFIRES; i++)
  1693. {
  1694. if(Campfire[i][cID] == 0)
  1695. {
  1696. new Float:x, Float:y, Float:z;
  1697. GetPlayerPos(playerid, x, y, z);
  1698. Campfire[i][cID] = CreateDynamicObject(19632, x, y, z - 1.0, 0, 0, 0);
  1699. Campfire[i][cX] = x;
  1700. Campfire[i][cY] = y;
  1701. Campfire[i][cZ] = z;
  1702.  
  1703. Campfire[i][cTimer] = SetTimerEx("DestroyCampfire", 600000, false, "i", i);
  1704.  
  1705. SendClientMessage(playerid, COLOR_WHITE, "Campfire created. (use 'H' to extinguish)");
  1706. break;
  1707. }
  1708. }
  1709. }
  1710. }
  1711. RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][chose], 0, chose);
  1712. }
  1713. case 500 .. 549: // NARCOTICS
  1714. {
  1715. new Float:ar, Float:ar2, gpid = PlayerInfo[playerid][pInvItem][chose];
  1716. if(GetPVarInt(playerid, "DrugTime") > 0)
  1717. {
  1718. format(string, sizeof(string), "You must wait (%d) secons before using your narcotics!", GetPVarInt(playerid, "DrugTime"));
  1719. SCM(playerid, COLOR_GREY, string);
  1720. return true;
  1721. }
  1722. GetPlayerArmour(playerid, ar);
  1723. switch(gpid)
  1724. {
  1725. case 500 .. 501: SetPVarInt(playerid, "Addiction", GetPVarInt(playerid, "Addiction")+4), ar2=10.0;
  1726. case 502: ar2 = 5.0;
  1727. case 503 .. 505: SetPVarInt(playerid, "Addiction", GetPVarInt(playerid, "Addiction")+4), ar2=10.0;
  1728. case 506: SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY), ar2=5.0;
  1729. case 507: SetPVarInt(playerid, "Addiction", GetPVarInt(playerid, "Addiction")+6), ar2=15.0;
  1730. }
  1731. SetPVarInt(playerid, "AddictionID", gpid);
  1732. SetPVarInt(playerid, "DrugTime", PrintIid(gpid)/4);
  1733. SetPVarInt(playerid, "DrugHigh", gpid);
  1734. ar+=ar2;
  1735. if(ar >= 99.0) ar = 99.0;
  1736. SetPlayerArmourEx(playerid, ar);
  1737. //==========//
  1738. format(str2, 128, "%s consumed!", PrintIName(gpid));
  1739. SendClientMessage(playerid, COLOR_WHITE, str2);
  1740. //==========//
  1741. RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][chose], 1, chose);
  1742. //==========//
  1743. }
  1744. case 1002: // Silencer
  1745. {
  1746. scm(playerid, COLOR_BLUE, "[TIP] {FFFFFF}Use the command /silencer to attach/detach a silencer to/from a colt 45.");
  1747. cmd_silencer(playerid, "");
  1748. return true;
  1749. }
  1750. case 1003:
  1751. {
  1752. cmd_plantradio(playerid, "");
  1753. return true;
  1754. }
  1755. case 1004: // bomb
  1756. {
  1757. cmd_v(playerid, "bomb");
  1758. return true;
  1759. }
  1760. case 1005: // bullet-proof vest
  1761. {
  1762. SetPlayerArmourEx(playerid, 50.0);
  1763. format(sendername, sizeof(sendername), "%s", PlayerNameEx(playerid));
  1764. GiveNameSpace(sendername);
  1765. format(string, sizeof(string), "*** %s put on a bulletproof vest, strapping it securely to %s torso.", sendername, CheckSex(playerid));
  1766. ProxDetector(30.0, playerid, string, COLOR_PURPLE);
  1767. RemoveInvItem(playerid, 1005);
  1768. return true;
  1769. }
  1770. case 1006: // Backpack
  1771. {
  1772. if(GetPVarInt(playerid, "Backpack") == 1) {
  1773. error(playerid, "You're already wearing a backpack.");
  1774. return scm(playerid, COLOR_BLUE, "[TIP] {FFFFFF}To take off your backpack type (/backpack).");
  1775. }
  1776. SetPVarInt(playerid, "Backpack", 1);
  1777. RemoveInvItem(playerid, 1006);
  1778. if(IsPlayerAttachedObjectSlotUsed(playerid, 6)) RemovePlayerAttachedObject(playerid, 6);
  1779. if(IsPlayerAttachedObjectSlotUsed(playerid, 7)) RemovePlayerAttachedObject(playerid, 7);
  1780. scm(playerid, COLOR_BLUE, "[TIP] {FFFFFF}To take off your backpack type (/backpack).");
  1781. format(sendername, sizeof(sendername), "%s", PlayerNameEx(playerid));
  1782. GiveNameSpace(sendername);
  1783. format(string, sizeof(string), "*** %s puts on %s backpack.", sendername, CheckSex(playerid));
  1784. ProxDetector(30.0, playerid, string, COLOR_PURPLE);
  1785. new query[82];
  1786. mysql_format(handlesql, query, sizeof(query), "UPDATE accounts SET Backpack=1 WHERE `Name`='%s'",PlayerName(playerid));
  1787. mysql_tquery(handlesql, query);
  1788. SetPlayerAttachedObject(playerid, 6, 371, 1, 0.0, -0.14, 0.0, 0.0, 90, 359.5022, 1, 1, 1);
  1789. return true;
  1790. }
  1791. case 1007: // Fishing rod
  1792. {
  1793. cmd_fish(playerid, "");
  1794. return true;
  1795. }
  1796. case 1008: // GAS CAN
  1797. {
  1798. if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return SendClientMessage(playerid, COLOR_GREY, "You must be onfoot to use this!");
  1799. if (PlayerInfo[playerid][pInvQ][chose] < 1 || PlayerInfo[playerid][pInvEx][chose] == -1) { //Fill gas can.
  1800. if(!IsAtGasStation(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not around any fuel pumps.");
  1801. SetPVarInt(playerid, "GC_ItemSlot", chose);
  1802. ShowPlayerDialog(playerid, FUEL_DIALOG_FILL_GASCAN, DIALOG_STYLE_LIST, "Fuel Pump", "{C9C9C9}Regular\n{3A0BC6}Premium\n{F2C71A}Diesel", "Ok", "Cancel");
  1803. } else { //Use gas can.
  1804. if(PlayerToCar(playerid,1,5.0)) {
  1805. new carid = PlayerToCar(playerid,2,5.0);
  1806. if(IsNotAEngineCar(carid)) return SendClientMessage(playerid, COLOR_GREY, "This vehicle doesn't have an engine.");
  1807. if(VehicleInfo[carid][vFuel] >= 100) return SendClientMessage(playerid, COLOR_LIGHTRED, "Vehicles fuel tank is full!");
  1808. if(VehicleInfo[carid][vEngine] != 0 && VehicleInfo[carid][vFuel] >= 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "Vehicle's engine must be off to use this!");
  1809. new vmodel = GetVehicleModel(carid);
  1810. if(PlayerInfo[playerid][pInvEx][chose] == GasType(vmodel)) {
  1811. new amount = (100-VehicleInfo[carid][vFuel]);
  1812. if(PlayerInfo[playerid][pInvQ][chose] > amount) {
  1813. VehicleInfo[carid][vFuel] = 100;
  1814. RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][chose], amount, chose);
  1815. format(string, sizeof(string), "%sGas can{FFFFFF} used on the %s. You still have %i litres left in your gas can.", GasColor(GasType(vmodel)), VehicleName[vmodel-400], PlayerInfo[playerid][pInvQ][chose]);
  1816. } else {
  1817. VehicleInfo[carid][vFuel] = VehicleInfo[carid][vFuel]+PlayerInfo[playerid][pInvQ][chose];
  1818. RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][chose], 0, chose);
  1819. format(string, sizeof(string), "%sGas can{FFFFFF} used on the %s.", GasColor(GasType(vmodel)), VehicleName[vmodel-400]);
  1820. }
  1821. SendClientMessage(playerid, COLOR_WHITE, string);
  1822. } else {
  1823. format(string, sizeof(string), "Your gas can contains %s{AFAFAF} fuel, but the %s requires %s{AFAFAF} fuel.", FuelName(PlayerInfo[playerid][pInvEx][chose]), VehicleName[vmodel-400], FuelName(GasType(vmodel)));
  1824. return SendClientMessage(playerid, COLOR_GREY, string);
  1825. }
  1826. } else {
  1827. if(!IsAtGasStation(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not around any fuel pumps or vehicles.");
  1828. SetPVarInt(playerid, "GC_ItemSlot", chose);
  1829. ShowPlayerDialog(playerid, FUEL_DIALOG_FILL_GASCAN, DIALOG_STYLE_LIST, "Fuel Pump", "{C9C9C9}Regular\n{3A0BC6}Premium\n{F2C71A}Diesel", "Ok", "Cancel");
  1830. }
  1831. }
  1832. return true;
  1833. }
  1834. case 1050: // Cigarettes
  1835. {
  1836. if(IsPlayerAttachedObjectSlotUsed(playerid, HOLDOBJECT_CLOTH4)) RemovePlayerAttachedObject(playerid, HOLDOBJECT_CLOTH4);
  1837. SetPVarInt(playerid, "usingCig", 1);
  1838. SetPlayerAttachedObject(playerid, HOLDOBJECT_CLOTH4, 19625, 6, 0.115, 0.031, 0.019, 102.9, 117.0, -110.5, 1.0, 1.0, 1.0);
  1839. SendClientMessage(playerid,COLOR_WHITE,"Type (/drop cig) to drop your cigarette.");
  1840. //==========//
  1841. RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][chose], 1, chose);
  1842. return true;
  1843. }
  1844. case 1051: // Worms
  1845. {
  1846. cmd_fish(playerid, "");
  1847. return true;
  1848. }
  1849. }
  1850. }
  1851. case 1: // DROP
  1852. {
  1853. if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
  1854. new Float:X, Float:Y, Float:Z;
  1855. GetPlayerPos(playerid, X, Y, Z);
  1856. switch(PlayerInfo[playerid][pInvItem][chose])
  1857. {
  1858. case 401:
  1859. {
  1860. if(GetPVarInt(playerid, "MaskUse") == 1) {
  1861. SendClientMessage(playerid, COLOR_LIGHTRED, "You need to take your mask off!");
  1862. return true;
  1863. }
  1864. }
  1865. case 1000 .. 1001:
  1866. {
  1867. if((GetPVarInt(playerid, "Member") == 1 || GetPVarInt(playerid, "Member") == 8)) return error(playerid, "You can not do this to prevent LSPD and LSG weapon distribution.");
  1868. }
  1869. }
  1870. format(string, sizeof(string), "%s dropped!", PrintIName(PlayerInfo[playerid][pInvItem][chose]));
  1871. SendClientMessage(playerid, COLOR_WHITE, string);
  1872. //==========//
  1873. new allow = 0;
  1874. if(GetPVarInt(playerid, "Member") == 1 || GetPVarInt(playerid, "Member") == 8) {
  1875. allow++;
  1876. } else if(PlayerInfo[playerid][pInvItem][chose] == 42) allow++;
  1877. if(PlayerInfo[playerid][pInvItem][chose] > 200) allow=0;
  1878. if(allow == 0) {
  1879. CreateLoot(PlayerInfo[playerid][pInvItem][chose], PlayerInfo[playerid][pInvQ][chose], PlayerInfo[playerid][pInvEx][chose], PlayerInfo[playerid][pInvS][chose], X, Y, Z, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)); }
  1880. //==========//
  1881. RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][chose], 0, chose);
  1882. //==========//
  1883. SetTimerEx("LoadHolsters", 1500, false, "i", playerid);
  1884. //==========//
  1885. Streamer_Update(playerid);
  1886. }
  1887. case 2: //Put in house inventory, business inventory OR Put in vehicle
  1888. {
  1889. switch(PlayerInfo[playerid][pInvItem][chose])
  1890. {
  1891. case 500, 501, 502, 503, 504, 505, 506, 507:
  1892. {
  1893. new combine_string[128];
  1894. format(combine_string, sizeof(combine_string), "Select an item that you would like to combine with %s(%i).", PrintIName(PlayerInfo[playerid][pInvItem][chose]), PlayerInfo[playerid][pInvQ][chose]);
  1895. SendClientMessage(playerid, COLOR_WHITE, combine_string);
  1896. SetPVarInt(playerid, "Combining", 1);
  1897. SetPVarInt(playerid, "CombiningChose", chose);
  1898. PrintInv(playerid);
  1899. }
  1900.  
  1901. default:
  1902. {
  1903. StorePlayerItemInHouse(playerid, chose, GetPVarInt(playerid, "HouseEnter"));
  1904. StorePlayerItemInBusiness(playerid, chose, GetPVarInt(playerid, "BizzEnter"));
  1905.  
  1906. //Vehicle storing
  1907. new kez = -1;
  1908. new keyex = -1;
  1909. if(PlayerToCar(playerid, 1, 4.0)) {
  1910. keyex = PlayerToCar(playerid, 2, 4.0);
  1911. if(IsValidTCar(keyex))
  1912. {
  1913. if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  1914. {
  1915. kez = keyex;
  1916. }
  1917. }
  1918. }
  1919. if(kez == -1)
  1920. {
  1921. if(IsPoliceCar(playerid)) {
  1922. if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  1923. {
  1924. kez = GetPoliceCarID(playerid);
  1925. }
  1926. else if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
  1927. {
  1928. kez = GetPlayerVehicleID(playerid);
  1929. }
  1930. }
  1931. }
  1932.  
  1933. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
  1934. {
  1935. kez = GetPlayerVehicleID(playerid);
  1936. }
  1937.  
  1938. if(kez == -1) return true;
  1939.  
  1940. if(!response) return true;
  1941.  
  1942. StorePlayerItemInVehicle(playerid, chose, kez);
  1943. }
  1944. }
  1945.  
  1946. }
  1947. case 3:
  1948. {
  1949. switch(PlayerInfo[playerid][pInvItem][chose])
  1950. {
  1951. case 500, 501, 502, 503, 504, 505, 506, 507:
  1952. {
  1953. new divide_string[128];
  1954. format(divide_string, sizeof(divide_string), "How much would you like to split off from your %s(%i)?", PrintIName(PlayerInfo[playerid][pInvItem][chose]), PlayerInfo[playerid][pInvQ][chose]);
  1955. ShowPlayerDialog(playerid, 562, DIALOG_STYLE_INPUT, "Divivde", divide_string, "Confirm","Close");
  1956.  
  1957. SetPVarInt(playerid, "Dividing", 1);
  1958. SetPVarInt(playerid, "DividingChose", chose);
  1959. }
  1960.  
  1961. default:
  1962. {
  1963. StorePlayerItemInHouse(playerid, chose, GetPVarInt(playerid, "HouseEnter"));
  1964. StorePlayerItemInBusiness(playerid, chose, GetPVarInt(playerid, "BizzEnter"));
  1965.  
  1966. //Vehicle storing
  1967. new kez = -1;
  1968. new keyex = -1;
  1969. if(PlayerToCar(playerid, 1, 4.0)) {
  1970. keyex = PlayerToCar(playerid, 2, 4.0);
  1971. if(IsValidTCar(keyex))
  1972. {
  1973. if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  1974. {
  1975. kez = keyex;
  1976. }
  1977. }
  1978. }
  1979. if(kez == -1)
  1980. {
  1981. if(IsPoliceCar(playerid)) {
  1982. if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  1983. {
  1984. kez = GetPoliceCarID(playerid);
  1985. }
  1986. else if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
  1987. {
  1988. kez = GetPlayerVehicleID(playerid);
  1989. }
  1990. }
  1991. }
  1992.  
  1993. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
  1994. {
  1995. kez = GetPlayerVehicleID(playerid);
  1996. }
  1997.  
  1998. if(kez == -1) return true;
  1999.  
  2000. if(!response) return true;
  2001.  
  2002. StorePlayerItemInVehicle(playerid, chose, kez);
  2003. }
  2004. }
  2005. }
  2006. case 4:
  2007. {
  2008. switch(PlayerInfo[playerid][pInvItem][chose])
  2009. {
  2010. default:
  2011. {
  2012. StorePlayerItemInHouse(playerid, chose, GetPVarInt(playerid, "HouseEnter"));
  2013. StorePlayerItemInBusiness(playerid, chose, GetPVarInt(playerid, "BizzEnter"));
  2014.  
  2015. //Vehicle storing
  2016. new kez = -1;
  2017. new keyex = -1;
  2018. if(PlayerToCar(playerid, 1, 4.0)) {
  2019. keyex = PlayerToCar(playerid, 2, 4.0);
  2020. if(IsValidTCar(keyex) && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  2021. {
  2022. kez = keyex;
  2023. }
  2024. }
  2025. if(kez == -1)
  2026. {
  2027. if(IsPoliceCar(playerid)) {
  2028. if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  2029. {
  2030. kez = GetPoliceCarID(playerid);
  2031. }
  2032. else if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
  2033. {
  2034. kez = GetPlayerVehicleID(playerid);
  2035. }
  2036. }
  2037. }
  2038.  
  2039. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
  2040. {
  2041. kez = GetPlayerVehicleID(playerid);
  2042. }
  2043.  
  2044. if(kez == -1) return true;
  2045.  
  2046. if(!response) return true;
  2047.  
  2048. StorePlayerItemInVehicle(playerid, chose, kez);
  2049. }
  2050. }
  2051. }
  2052. }
  2053. }
  2054. case 35: // LSPD ARMOURY DIALOG
  2055. {
  2056. if(!response) return true;
  2057. if(PDItems[listitem][0] == 1000) return SetPlayerArmourEx(playerid, 99.0);
  2058. if(PDItems[listitem][0] == 1001) return SetPlayerHealth(playerid, 100.0);
  2059. if(!CheckInv(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "Your inventory is currently full!");
  2060. if(listitem == sizeof(PDItems))
  2061. {
  2062. ResetPlayerWeaponsEx(playerid);
  2063. SetPlayerArmourEx(playerid, 0.0);
  2064. for(new p = 0; p < MAX_INV_SLOTS; p++)
  2065. {
  2066. if(PlayerInfo[playerid][pInvItem][p] >= 22 && PlayerInfo[playerid][pInvItem][p] <= 41) // Weapons
  2067. {
  2068. RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][p], 0, p);
  2069. }
  2070.  
  2071. if(PlayerInfo[playerid][pInvItem][p] >= 100 && PlayerInfo[playerid][pInvItem][p] <= 128) // Ammo
  2072. {
  2073. RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][p], 0, p);
  2074. }
  2075. }
  2076. return 1;
  2077. }
  2078. else
  2079. {
  2080. switch(PDItems[listitem][0])
  2081. {
  2082. case 1 .. 99:
  2083. {
  2084. if(CheckInvItem(playerid, PDItems[listitem][0])) return SendClientMessage(playerid, COLOR_WHITE, "You already have this item!");
  2085. if(GetPVarInt(playerid, "ConnectTime") <= 7) return SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient hours played!");
  2086. }
  2087. }
  2088. if(GetPVarInt(playerid, "Rank") >= PDItems[listitem][1])
  2089. {
  2090. if(PDItems[listitem][0] == 3) GiveInvItem(playerid, PDItems[listitem][0], 1, 0);
  2091. else if(PDItems[listitem][0] == 41) GiveInvItem(playerid, PDItems[listitem][0], 1000, 0);
  2092. else GiveInvItem(playerid, PDItems[listitem][0], PrintIQ(PDItems[listitem][0]), 0, PlayerInfo[playerid][pWepSerial]);
  2093. format(string, 128, "%s selected!", PrintIName(PDItems[listitem][0]), PDItems[listitem][1]);
  2094. SendClientMessage(playerid, COLOR_WHITE, string);
  2095. }
  2096. else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient rank!");
  2097. }
  2098. }
  2099. case 36:
  2100. {
  2101. if(GetPVarInt(playerid, "VEHC") == 0) return true;
  2102. if(!response)
  2103. {
  2104. ShowPlayerDialog(playerid,37,DIALOG_STYLE_LIST,"DEALERSHIP","Select Vehicle (FORWARD)\nSelect Vehicle (BACKWARDS)\nPurchase Vehicle","Select", "Exit");
  2105. return true;
  2106. }
  2107. else
  2108. {
  2109. new maxe;
  2110. switch(GetPVarInt(playerid, "VEHMDL"))
  2111. {
  2112. case 1: maxe = sizeof(VehDealership)-1;
  2113. case 2: maxe = sizeof(GrotDealership)-1;
  2114. case 3: maxe = sizeof(BikeDealership)-1;
  2115. case 4: maxe = sizeof(BoatDealership)-1;
  2116. }
  2117. switch(GetPVarInt(playerid, "VEHFOR"))
  2118. {
  2119. case 0:
  2120. {
  2121. if(GetPVarInt(playerid, "VEHID") >= maxe) SetPVarInt(playerid, "VEHID", 0);
  2122. else SetPVarInt(playerid, "VEHID", GetPVarInt(playerid, "VEHID")+1);
  2123. }
  2124. case 1:
  2125. {
  2126. if(GetPVarInt(playerid, "VEHID") <= 0) SetPVarInt(playerid, "VEHID", maxe);
  2127. else SetPVarInt(playerid, "VEHID", GetPVarInt(playerid, "VEHID")-1);
  2128. }
  2129. }
  2130. CallRemoteFunction("VehCreation", "i", playerid);
  2131. }
  2132. }
  2133. case 37:
  2134. {
  2135. new id = GetPVarInt(playerid, "VEHDEAL");
  2136. if(!response)
  2137. {
  2138. DeletePVar(playerid, "VEHC"), DeletePVar(playerid, "VEHMDL");
  2139. DeletePVar(playerid, "VEHID");
  2140. DeletePVar(playerid, "VEHDEAL");
  2141. if(GetPVarInt(playerid, "VEHVEH") >= 1) { DespawnVehicle(GetPVarInt(playerid, "VEHVEH")); }
  2142. DeletePVar(playerid, "VEHVEH");
  2143. SetPlayerPosEx(playerid, Dealerships[id][0], Dealerships[id][1], Dealerships[id][2]);
  2144. SetPlayerVirtualWorld(playerid, 0);
  2145. SetCameraBehindPlayer(playerid);
  2146. TempFreeze(playerid);
  2147. DeletePVar(playerid, "LOADDEAL");
  2148. return true;
  2149. }
  2150. //==========//
  2151. switch(listitem)
  2152. {
  2153. case 0:
  2154. {
  2155. SetPVarInt(playerid, "VEHFOR", 0);
  2156. CallRemoteFunction("VehCreation", "i", playerid);
  2157. }
  2158. case 1:
  2159. {
  2160. SetPVarInt(playerid, "VEHFOR", 1);
  2161. CallRemoteFunction("VehCreation", "i", playerid);
  2162. }
  2163. case 2:
  2164. {
  2165. new id2 = GetPVarInt(playerid, "VEHID"), vehmdl = GetPVarInt(playerid, "VEHMDL"), carmdl, col = 0, id3 = GetPVarInt(playerid, "VEHDEAL"); //tls, col = 0;
  2166. DeletePVar(playerid, "VEHC"), DeletePVar(playerid, "VEHMDL");
  2167. DeletePVar(playerid, "VEHID");
  2168. DeletePVar(playerid, "VEHDEAL");
  2169. if(GetPVarInt(playerid, "VEHVEH") >= 1) { DespawnVehicle(GetPVarInt(playerid, "VEHVEH")); }
  2170. DeletePVar(playerid, "VEHVEH");
  2171. SetPlayerPosEx(playerid, Dealerships[id3][0], Dealerships[id3][1], Dealerships[id3][2]);
  2172. SetPlayerVirtualWorld(playerid, 0);
  2173. SetCameraBehindPlayer(playerid);
  2174. TogglePlayerControllableEx(playerid, true);
  2175. DeletePVar(playerid, "LOADDEAL");
  2176. if(VJB == 1)
  2177. {
  2178. SCM(playerid, -1, "A vehicle has just been bought, please retry!");
  2179. return true;
  2180. }
  2181. switch(vehmdl)
  2182. {
  2183. case 1: // Vehicle NORMAL Dealership
  2184. {
  2185. carmdl=VehDealership[id2][0];
  2186. price=VehDealership[id2][1];
  2187. }
  2188. case 2: // Vehicle GROTTI Dealership
  2189. {
  2190. carmdl=GrotDealership[id2][0];
  2191. price=GrotDealership[id2][1];
  2192. }
  2193. case 3: // Vehicle BIKE Dealership
  2194. {
  2195. carmdl=BikeDealership[id2][0];
  2196. price=BikeDealership[id2][1];
  2197. }
  2198. case 4: // Vehicle BOAT Dealership
  2199. {
  2200. carmdl=BoatDealership[id2][0];
  2201. price=BoatDealership[id2][1];
  2202. }
  2203. }
  2204. if(GetPVarInt(playerid, "CarTicket") >= 1)
  2205. {
  2206. if(price >= 125000) price -=125000, SetPVarInt(playerid, "CTU", 2);
  2207. else price = 0, SetPVarInt(playerid, "CTU", 1);
  2208. }
  2209. if(GetPlayerMoneyEx(playerid) >= price)
  2210. {
  2211. new query[75];
  2212. mysql_format(handlesql, query, sizeof(query), "SELECT NULL FROM `vehicles` WHERE `Owner` = '%e';", PlayerInfo[playerid][pUsername]);
  2213. mysql_tquery(handlesql, query, "OnDealershipVehicleBought", "iiiii", playerid, carmdl, id3, col, price);
  2214. }
  2215. else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds!");
  2216. TempFreeze(playerid);
  2217. }
  2218. }
  2219. }
  2220. case 38: // Cellphone Dialog
  2221. {
  2222. switch(listitem)
  2223. {
  2224. case 0: // Call Number
  2225. {
  2226. if (GetPVarInt(playerid, "Mobile") != INVALID_MAXPL) return SendClientMessage(playerid, COLOR_GREY, "You are already on a call."), cmd_cellphone(playerid, "");
  2227. if (GetPVarInt(playerid, "Cuffed") > 0) return SendClientMessage(playerid, COLOR_GREY, "You can't do this while handcuffed/tazed."), cmd_cellphone(playerid, "");
  2228. if(GetPVarInt(playerid, "Jailed") > 0) return SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while in-jail."), cmd_cellphone(playerid, "");
  2229. if(GetPVarInt(playerid, "Mute") == 1) return SendClientMessage(playerid,COLOR_LIGHTRED,"WARNING: You are currently muted."), cmd_cellphone(playerid, "");
  2230. if(GetPVarInt(playerid, "Dead") > 0) return SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while dead."), cmd_cellphone(playerid, "");
  2231. if(IsPlayerInWater(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while in-water"), cmd_cellphone(playerid, "");
  2232. ShowPlayerDialog(playerid,39,DIALOG_STYLE_INPUT,"Calling","Enter the number you would like to call.","Call", "Go Back");
  2233. }
  2234. case 1: // Contacts
  2235. {
  2236. if (GetPVarInt(playerid, "Mobile") != INVALID_MAXPL) return SendClientMessage(playerid, COLOR_GREY, "You are already on a call."), cmd_cellphone(playerid, "");
  2237. if (GetPVarInt(playerid, "Cuffed") > 0) return SendClientMessage(playerid, COLOR_GREY, "You can't do this while handcuffed/tazed."), cmd_cellphone(playerid, "");
  2238. if(GetPVarInt(playerid, "Jailed") > 0) return SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while in-jail."), cmd_cellphone(playerid, "");
  2239. if(GetPVarInt(playerid, "Mute") == 1) return SendClientMessage(playerid,COLOR_LIGHTRED,"WARNING: You are currently muted."), cmd_cellphone(playerid, "");
  2240. if(GetPVarInt(playerid, "Dead") > 0) return SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while dead."), cmd_cellphone(playerid, "");
  2241. if(IsPlayerInWater(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while in-water"), cmd_cellphone(playerid, "");
  2242. new diatxt[516];
  2243. for(new i = 1; i < 11; i++)
  2244. {
  2245. if(i != 11)
  2246. {
  2247. //Contact system
  2248. new contactname[40], contactnumber[40], cname[50];
  2249. format(contactname, sizeof(contactname), "ContactName%d", i);
  2250. format(contactnumber, sizeof(contactnumber), "ContactNumber%d", i);
  2251. GetPVarString(playerid, contactname, cname, 50);
  2252. if(strlen(cname) < 2) format(cname, sizeof(cname), "None");
  2253. format(diatxt, sizeof(diatxt), "%s\n{FFFFFF}%s {33FF66}(%d)",diatxt, cname, GetPVarInt(playerid, contactnumber));
  2254. }
  2255. }
  2256. ShowPlayerDialog(playerid, 42, DIALOG_STYLE_LIST,"Contacts", diatxt, "Select","Edit");
  2257. }
  2258. case 2: // Text Message
  2259. {
  2260. if (GetPVarInt(playerid, "Mobile") != INVALID_MAXPL) return SendClientMessage(playerid, COLOR_GREY, "You are already on a call."), cmd_cellphone(playerid, "");
  2261. if (GetPVarInt(playerid, "Cuffed") > 0) return SendClientMessage(playerid, COLOR_GREY, "You can't do this while handcuffed/tazed."), cmd_cellphone(playerid, "");
  2262. if(GetPVarInt(playerid, "Jailed") > 0) return SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while in-jail."), cmd_cellphone(playerid, "");
  2263. if(GetPVarInt(playerid, "Mute") == 1) return SendClientMessage(playerid,COLOR_LIGHTRED,"WARNING: You are currently muted."), cmd_cellphone(playerid, "");
  2264. if(GetPVarInt(playerid, "Dead") > 0) return SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while dead."), cmd_cellphone(playerid, "");
  2265. if(IsPlayerInWater(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while in-water"), cmd_cellphone(playerid, "");
  2266. ShowPlayerDialog(playerid,40,DIALOG_STYLE_INPUT,"Texting","Enter the number you would like to text.","Enter", "Go Back");
  2267. }
  2268. case 3: // Pickup Call
  2269. {
  2270. new found = 0;
  2271. foreach(new i : Player)
  2272. {
  2273. if(GetPVarInt(i, "PlayerLogged") == 1)
  2274. {
  2275. if(GetPVarInt(i, "Mobile") == playerid)
  2276. {
  2277. found++;
  2278. SetPVarInt(playerid, "Mobile", i);
  2279. SetPVarInt(playerid, "RingTone", 0);
  2280. SetPVarInt(playerid, "RingPhone", 0);
  2281. SetPVarInt(GetPVarInt(playerid, "Mobile"), "RingPhone", 0);
  2282. SendClientMessage(playerid, COLOR_LIGHTBLUE, "Call picked up.");
  2283. SendClientMessage(i, COLOR_LIGHTBLUE, "They picked up the call.");
  2284. CellphoneState(playerid,1);
  2285. DeletePVar(playerid, "CellMenu");
  2286. CallRemoteFunction("LoadRadios","i", playerid);
  2287. CallRemoteFunction("LoadRadios","i", i);
  2288. break;
  2289. }
  2290. }
  2291. }
  2292. if(found == 0) SendClientMessage(playerid, COLOR_GREY, "You are not on any phone call."), cmd_cellphone(playerid, "");
  2293. }
  2294. case 4: // SPEAKER
  2295. {
  2296. switch(GetPVarInt(playerid, "Speaker"))
  2297. {
  2298. case 0:
  2299. {
  2300. SetPVarInt(playerid, "Speaker", 1);
  2301. GameTextForPlayer(playerid, "~w~Speaker ~g~On", 5000, 6);
  2302. }
  2303. case 1:
  2304. {
  2305. SetPVarInt(playerid, "Speaker", 0);
  2306. GameTextForPlayer(playerid, "~w~Speaker ~r~Off", 5000, 6);
  2307. }
  2308. }
  2309. DeletePVar(playerid, "ContactNum");
  2310. DeletePVar(playerid, "CellMenu");
  2311. CellphoneState(playerid,2);
  2312. }
  2313. case 5: // Pocket Phone
  2314. {
  2315. DeletePVar(playerid, "ContactNum");
  2316. DeletePVar(playerid, "CellMenu");
  2317. if(GetPVarInt(playerid, "Mobile") != INVALID_MAXPL)
  2318. {
  2319. if(GetPVarInt(playerid, "Mobile") < INVALID_MAXPL)
  2320. {
  2321. SendClientMessage(playerid, COLOR_GREY, "You hanged up.");
  2322. SendClientMessage(GetPVarInt(playerid, "Mobile"), COLOR_GREY, "The person on the other line has ended the call.");
  2323. if(GetPVarInt(GetPVarInt(playerid, "Mobile"), "CellMenu") == 0) CellphoneState(GetPVarInt(playerid, "Mobile"),2);
  2324. SetPVarInt(GetPVarInt(playerid, "Mobile"), "Mobile", INVALID_MAXPL);
  2325. SetPVarInt(GetPVarInt(playerid, "Mobile"), "RingTone", 0);
  2326. SetPVarInt(GetPVarInt(playerid, "Mobile"), "RingPhone", 0);
  2327. CellphoneState(playerid,2);
  2328. if(GetPVarInt(GetPVarInt(playerid, "Mobile"), "PayPhone") == 0)
  2329. {
  2330. TogglePlayerControllableEx(GetPVarInt(playerid, "Mobile"),true);
  2331. DeletePVar(GetPVarInt(playerid, "Mobile"),"PayPhone");
  2332. DeletePVar(GetPVarInt(playerid, "Mobile"),"PhoneID");
  2333. }
  2334. CallRemoteFunction("LoadRadios","i", playerid);
  2335. CallRemoteFunction("LoadRadios","i", GetPVarInt(playerid, "Mobile"));
  2336. SetPVarInt(playerid, "Mobile", INVALID_MAXPL); // Disable the phone call.
  2337. SetPVarInt(playerid, "RingPhone", 0);
  2338. return 1;
  2339. }
  2340. }
  2341. foreach(new i : Player)
  2342. {
  2343. if(GetPVarInt(i, "Mobile") == playerid)
  2344. {
  2345. SetPVarInt(i, "RingTone", 0);
  2346. SetPVarInt(i, "RingPhone", 0);
  2347. SetPVarInt(i, "Mobile", INVALID_MAXPL); // Disable the phone call.
  2348. cancelPayphone(i);
  2349. SendClientMessage(i, COLOR_GREY, "They hung up.");
  2350. if(GetPVarInt(i, "CellMenu") == 0)
  2351. {
  2352. CellphoneState(i,2);
  2353. }
  2354. CallRemoteFunction("LoadRadios","i", i);
  2355. }
  2356. }
  2357. SetPVarInt(playerid, "RingTone", 0);
  2358. SetPVarInt(playerid, "RingPhone", 0);
  2359. SetPVarInt(playerid, "Mobile", INVALID_MAXPL); // Disable the phone call.
  2360. CellphoneState(playerid,2);
  2361. CallRemoteFunction("LoadRadios","i", playerid);
  2362. }
  2363. }
  2364. }
  2365. case 39: // Calling
  2366. {
  2367. if(!response) {
  2368. if(GetPVarInt(playerid, "usingPayphone") >= 0) {
  2369. cancelPayphone(playerid);
  2370. return 1;
  2371. }
  2372. return cmd_cellphone(playerid, "");
  2373. }
  2374. CallNumber(playerid, inputtext);
  2375. }
  2376. case 40: // Cellphone Texting FIND NUMBER
  2377. {
  2378. switch(response)
  2379. {
  2380. case 0: cmd_cellphone(playerid, "");
  2381. case 1:
  2382. {
  2383. if(!strlen(inputtext))
  2384. {
  2385. ShowPlayerDialog(playerid,40,DIALOG_STYLE_INPUT,"Texting","Enter the number you would like to text.","Enter", "Go Back");
  2386. return 1;
  2387. }
  2388. if(strlen(inputtext) >= 15)
  2389. {
  2390. SendClientMessage(playerid, COLOR_WHITE, "Number is too long (15 Chars max).");
  2391. ShowPlayerDialog(playerid,40,DIALOG_STYLE_INPUT,"Texting","Enter the number you would like to text.","Enter", "Go Back");
  2392. return 1;
  2393. }
  2394. foreach(new i : Player)
  2395. {
  2396. if(GetPVarInt(i, "PlayerLogged") == 1 && i != playerid)
  2397. {
  2398. format(string, 128, "%d", GetPVarInt(i, "PhoneNum"));
  2399. if(strcmp(string, inputtext, true) == 0)
  2400. {
  2401. if (i == playerid) ShowPlayerDialog(playerid,110,DIALOG_STYLE_INPUT,"Texting","Enter the number you would like to text.","Enter", "Go Back");
  2402. format(sendername, sizeof(sendername), "%s", PlayerNameEx(i));
  2403. GiveNameSpace(sendername);
  2404. format(string, sizeof(string),"Enter the message you would like to send to %s.", sendername);
  2405. ShowPlayerDialog(playerid,41,DIALOG_STYLE_INPUT,"Texting",string,"Enter", "Go Back");
  2406. strmid(PlayerInfo[playerid][pCellname], inputtext, 0, strlen(inputtext), 255);
  2407. return true;
  2408. }
  2409. }
  2410. }
  2411. SendClientMessage(playerid, COLOR_GREY, "Could not find anyone with that number."), ShowPlayerDialog(playerid,110,DIALOG_STYLE_INPUT,"Texting","Enter the number you would like to text.","Enter", "Go Back");
  2412. }
  2413. }
  2414. }
  2415. case 41: // Cellphone Texting SEND MESSAGE
  2416. {
  2417. if(!response) return cmd_cellphone(playerid, "");
  2418. SmsNumber(playerid, inputtext);
  2419. }
  2420. case 42: //Contact selected
  2421. {
  2422. if(response)
  2423. {
  2424. SetPVarInt(playerid, "SelectedContact", listitem + 1);
  2425. ShowPlayerDialog(playerid, 43, DIALOG_STYLE_MSGBOX, "Contacts", "Select your option.","Call","Text");
  2426. }
  2427. else
  2428. {
  2429. SetPVarInt(playerid, "SelectedContact", listitem + 1);
  2430. ShowPlayerDialog(playerid, 44, DIALOG_STYLE_MSGBOX, "Contacts", "What would you like to edit?","Name","Number");
  2431. }
  2432. }
  2433. case 43: //Call or text contact
  2434. {
  2435. if(!response)
  2436. {
  2437. new contactnumber[40], i = GetPVarInt(playerid, "SelectedContact"), number[50];
  2438. format(contactnumber, sizeof(contactnumber), "ContactNumber%d", i);
  2439. format(number, sizeof(number), "%d", GetPVarInt(playerid, contactnumber));
  2440. new found = 0;
  2441. foreach(new ip : Player)
  2442. {
  2443. if(GetPVarInt(ip, "PlayerLogged") == 1 && ip != playerid)
  2444. {
  2445. format(string, 128, "%d", GetPVarInt(ip, "PhoneNum"));
  2446. if(strcmp(string, number, true) == 0)
  2447. {
  2448. found++;
  2449. if (ip == playerid) ShowPlayerDialog(playerid,41,DIALOG_STYLE_INPUT,"Texting","Enter the number you would like to text.","Enter", "Go Back");
  2450. format(sendername, sizeof(sendername), "%s", PlayerNameEx(ip));
  2451. GiveNameSpace(sendername);
  2452. format(string, sizeof(string),"Enter the message you would like to send to %s.", sendername);
  2453. ShowPlayerDialog(playerid,41,DIALOG_STYLE_INPUT,"Texting",string,"Enter", "Go Back");
  2454. strmid(PlayerInfo[playerid][pCellname], number, 0, strlen(number), 255);
  2455. return true;
  2456. }
  2457. }
  2458. }
  2459. if(found == 0)
  2460. {
  2461. SendClientMessage(playerid, COLOR_GREY, "Could not find anyone with that number.");
  2462. ShowPlayerDialog(playerid,41,DIALOG_STYLE_INPUT,"Texting","Enter the number you would like to text.","Enter", "Go Back");
  2463. }
  2464. }
  2465. else
  2466. {
  2467. new contactnumber[40], i, number[50];
  2468. i = GetPVarInt(playerid, "SelectedContact");
  2469. format(contactnumber, sizeof(contactnumber), "ContactNumber%d", i);
  2470. format(number, sizeof(number), "%d", GetPVarInt(playerid, contactnumber));
  2471. CallNumber(playerid, number);
  2472. }
  2473. }
  2474. case 44: //Edit contact
  2475. {
  2476. if(!response) //Number
  2477. {
  2478. ShowPlayerDialog(playerid, 45, DIALOG_STYLE_INPUT, "Contact", "Insert the number you'd like to assign to this slot.", "Select","Cancel");
  2479. }
  2480. if(response) //Name
  2481. {
  2482. ShowPlayerDialog(playerid, 46, DIALOG_STYLE_INPUT, "Contact", "Insert the name you'd like to assign to this slot.","Select","Cancel");
  2483. }
  2484. }
  2485. case 45: //Edit number
  2486. {
  2487. if(!response) return cmd_cellphone(playerid, "");
  2488. new number = strval(inputtext), i = GetPVarInt(playerid, "SelectedContact"), slot[50];
  2489. format(slot, sizeof(slot), "ContactNumber%d", i);
  2490. SetPVarInt(playerid, slot, number);
  2491. SCM(playerid, -1, "Contact Editted!.");
  2492. cmd_cellphone(playerid, "");
  2493. }
  2494. case 46: //Edit name
  2495. {
  2496. if(!response) return cmd_cellphone(playerid, "");
  2497. new name[50], i = GetPVarInt(playerid, "SelectedContact"), slot[50];
  2498. format(name, 50, "%s", inputtext);
  2499. format(slot, sizeof(slot), "ContactName%d", i);
  2500. SetPVarString(playerid, slot, name);
  2501. SCM(playerid, -1, "Contact Editted!.");
  2502. cmd_cellphone(playerid, "");
  2503. }
  2504. case 54: // Hospital Floor
  2505. {
  2506. new Float:X = 0.0, Float:Y = 0.0, Float:Z = 0.0;
  2507. switch(listitem)
  2508. {
  2509. case 0:
  2510. {
  2511. X=2038.4750;
  2512. Y-=1365.0499;
  2513. Z=1271.5000;
  2514. }
  2515. case 1:
  2516. {
  2517. X=2055.4756;
  2518. Y-=673.1822;
  2519. Z=1478.8860;
  2520. }
  2521. case 2:
  2522. {
  2523. X=1994.9702;
  2524. Y-=1534.0613;
  2525. Z=1174.6000;
  2526. }
  2527. }
  2528. TogglePlayerControllableEx(playerid, false);
  2529. SetPlayerPosEx(playerid, X, Y, Z+1.0);
  2530. SetTimerEx("TogglePlayerControllableEx", 3000, false, "ii", playerid, true);
  2531. Streamer_Update(playerid);
  2532. }
  2533. case 55: // BZIZ RADIO
  2534. {
  2535. if(!response) return true;
  2536. switch(listitem)
  2537. {
  2538. case 0: // Radio Stations
  2539. {
  2540. new result[2048];
  2541. for(new i = 0; i < sizeof(CarRadio); i++)
  2542. {
  2543. if(i == 0) { format(result, 2048, "%s", CarRadio[i][cName]); }
  2544. else { format(result, 2048, "%s\n%s", result, CarRadio[i][cName]); }
  2545. }
  2546. ShowPlayerDialog(playerid,56,DIALOG_STYLE_LIST,"Radio Stations", result, "Select", "Go Back");
  2547. }
  2548. case 1: // Direct Link
  2549. {
  2550. ShowPlayerDialog(playerid, 57, DIALOG_STYLE_INPUT, "Direct URL", "Enter the .mp3 URL you would like to play.", "Enter", "Go Back");
  2551. }
  2552. case 2: // Turn Off
  2553. {
  2554. strmid(BizInfo[GetPVarInt(playerid, "BizzKey")][bRadio], "None", 0, strlen("None"), 255);
  2555. GameTextForPlayer(playerid, "~w~Radio~n~~r~OFF", 4000, 3);
  2556. foreach(new i : Player)
  2557. {
  2558. if(GetPVarInt(i, "BizzEnter") == GetPVarInt(playerid, "BizzKey"))
  2559. {
  2560. StopAudioStreamForPlayerEx(i);
  2561. }
  2562. }
  2563. }
  2564. }
  2565. }
  2566. case 56:
  2567. {
  2568. if(!response) return cmd_biz(playerid, "radio");
  2569. if(listitem != 0) {
  2570. PlayBizzRadio(GetPVarInt(playerid, "BizzKey"), CarRadio[listitem][cURL]);
  2571. } else {
  2572. PlayBizzRadio(GetPVarInt(playerid, "BizzKey"), RadioLSStream, 1);
  2573. BizInfo[GetPVarInt(playerid, "BizzKey")][bOnRLS] = 1;
  2574. }
  2575. }
  2576. case 57:
  2577. {
  2578. if(!response) return cmd_biz(playerid, "radio");
  2579. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 57, DIALOG_STYLE_INPUT, "Direct URL", "Enter the .mp3 URL you would like to play.", "Enter", "Go Back");
  2580. if(strlen(inputtext) > 256) return ShowPlayerDialog(playerid, 57, DIALOG_STYLE_INPUT, "Direct URL", "Enter the .mp3 URL you would like to play.", "Enter", "Go Back");
  2581. PlayBizzRadio(GetPVarInt(playerid, "BizzKey"), inputtext);
  2582. }
  2583. case 58:
  2584. {
  2585. if(response != 1) return DeletePVar(playerid, "RadioInfoID");
  2586. new id = GetPVarInt(playerid, "RadioInfoID");
  2587. switch(listitem)
  2588. {
  2589. case 0: ShowPlayerDialog(playerid,59,DIALOG_STYLE_INPUT,"BOOMBOX URL LINK","Enter in a direct .mp3 link and it will play on the radio\n{FF0000}Do not enter a link that will not respond.","Enter", "Close");
  2590. case 1: // Radio Stations
  2591. {
  2592. new result[2048];
  2593. for(new i = 0; i < sizeof(CarRadio); i++) {
  2594. if(i == 0) { format(result, 2048, "%s", CarRadio[i][cName]); }
  2595. else { format(result, 2048, "%s\n%s", result, CarRadio[i][cName]); }
  2596. }
  2597. ShowPlayerDialog(playerid, 60, DIALOG_STYLE_LIST, "Radio Stations", result, "Select", "Go Back");
  2598. }
  2599. case 2:
  2600. {
  2601. DeletePVar(playerid, "RadioInfoID");
  2602. switch(RadioInfo[id][rStatus])
  2603. {
  2604. case 0:
  2605. {
  2606. if(strcmp(RadioInfo[id][rURL],"NULL", true) == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You must enter a URL before turning the radio on!");
  2607. SendClientMessage(playerid, COLOR_LIGHTBLUE, "Boombox on!");
  2608. RadioInfo[id][rStatus]=1;
  2609. foreach(new i : Player)
  2610. {
  2611. if(GetPlayerZone(i) == RadioInfo[id][rAreaID])
  2612. {
  2613. PlayAudioStreamForPlayerEx(i, RadioInfo[id][rURL], RadioInfo[id][rX], RadioInfo[id][rY], RadioInfo[id][rZ], 50.0, 1);
  2614. }
  2615. }
  2616. }
  2617. case 1:
  2618. {
  2619. SendClientMessage(playerid, COLOR_LIGHTBLUE, "Boombox off!");
  2620. RadioInfo[id][rStatus]=0;
  2621. foreach(new i : Player)
  2622. {
  2623. if(GetPlayerZone(i) == RadioInfo[id][rAreaID])
  2624. {
  2625. StopAudioStreamForPlayerEx(i);
  2626. }
  2627. }
  2628. }
  2629. }
  2630. }
  2631. case 3:
  2632. {
  2633. if(!CheckInv(playerid)) {
  2634. DeletePVar(playerid, "RadioInfoID");
  2635. return SendClientMessage(playerid, COLOR_WHITE, "Your inventory is full!");
  2636. }
  2637. DeletePVar(playerid, "RadioInfoID");
  2638. SendClientMessage(playerid, COLOR_LIGHTBLUE, "Boombox picked up!");
  2639. if(RadioInfo[id][rStatus] != 0)
  2640. {
  2641. foreach(new ia : Player)
  2642. {
  2643. if(GetPlayerZone(ia) == RadioInfo[id][rAreaID])
  2644. {
  2645. StopAudioStreamForPlayerEx(ia);
  2646. }
  2647. }
  2648. }
  2649. RadioInfo[id][rX] = 0.0;
  2650. RadioInfo[id][rY] = 0.0;
  2651. RadioInfo[id][rZ] = 0.0;
  2652. RadioInfo[id][rStatus] = 0;
  2653. RadioInfo[id][rAreaID] = 0;
  2654. strmid(RadioInfo[id][rOwner], "None", 0, strlen("None"), 255);
  2655. strmid(RadioInfo[id][rURL], "None", 0, strlen("None"), 255);
  2656. if(IsValidDynamicObject(RadioInfo[id][rObject])) DestroyDynamicObject(RadioInfo[id][rObject]);
  2657. DestroyDynamic3DTextLabel(RadioInfo[id][rText]);
  2658. GiveInvItem(playerid, 1003, 1, 0);
  2659. }
  2660. }
  2661. }
  2662. case 59:
  2663. {
  2664. if(response != 1) return DeletePVar(playerid, "RadioInfoID");
  2665. new id = GetPVarInt(playerid, "RadioInfoID");
  2666. for(new i=0;i<sizeof(RadioInfo);i++)
  2667. {
  2668. if(strcmp(RadioInfo[i][rURL], inputtext, true) == 0)
  2669. {
  2670. if(RadioInfo[i][rAreaID] > 0 && i != id)
  2671. {
  2672. SendClientMessage(playerid, COLOR_WHITE, "You cannot use the same URL as another radio!");
  2673. DeletePVar(playerid, "RadioInfoID");
  2674. return true;
  2675. }
  2676. }
  2677. }
  2678. DeletePVar(playerid, "RadioInfoID");
  2679. SendClientMessage(playerid, COLOR_LIGHTBLUE, "Boombox URL set!");
  2680. RadioInfo[id][rOnRLS] = 0;
  2681. format(RadioInfo[id][rURL], 128, "%s", inputtext);
  2682. if(RadioInfo[id][rStatus] == 0) return true;
  2683. foreach(new i : Player)
  2684. {
  2685. if(GetPlayerZone(i) == RadioInfo[id][rAreaID])
  2686. {
  2687. PlayAudioStreamForPlayerEx(i, inputtext, RadioInfo[id][rX], RadioInfo[id][rY], RadioInfo[id][rZ], 50.0, 1);
  2688. }
  2689. }
  2690. }
  2691. case 60:
  2692. {
  2693. if(!response) return DeletePVar(playerid, "RadioInfoID");
  2694. new id = GetPVarInt(playerid, "RadioInfoID");
  2695. if(listitem != 0) {
  2696. format(RadioInfo[id][rURL], 128, "%s", CarRadio[listitem][cURL]);
  2697. RadioInfo[id][rOnRLS] = 0;
  2698. } else {
  2699. format(RadioInfo[id][rURL], 128, "%s", RadioLSStream);
  2700. RadioInfo[id][rOnRLS] = 1;
  2701. }
  2702. SendClientMessage(playerid, COLOR_LIGHTBLUE, "Boombox station set!");
  2703. if(RadioInfo[id][rStatus] == 0) return true;
  2704. foreach(new i : Player) {
  2705. if(GetPlayerZone(i) == RadioInfo[id][rAreaID]) {
  2706. PlayAudioStreamForPlayerEx(i, RadioInfo[id][rURL], RadioInfo[id][rX], RadioInfo[id][rY], RadioInfo[id][rZ], 50.0, 1);
  2707. }
  2708. }
  2709. DeletePVar(playerid, "RadioInfoID");
  2710. }
  2711. case 64: // /holdo dialog
  2712. {
  2713. switch(response)
  2714. {
  2715. case 1:
  2716. {
  2717. SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: Make sure the object is properly roleplayed or you will be ajailed.");
  2718. switch(listitem)
  2719. {
  2720. case 0: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 2114, 6, 0.075940, 0.160764, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
  2721. case 1: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 1210, 6, 0.291194, 0.091378, 0.058045, 4.921525, 258.763824, 0.0, 1.0, 1.0, 1.0);
  2722. case 2: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 1212, 6, 0.105605, 0.043076, 0.019798, 0.0, 265.589691, 0.0, 1.0, 1.0, 1.0);
  2723. case 3: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 2881, 6, -0.028293, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
  2724. case 4: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 2880, 6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
  2725. case 5: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 18632, 6, 0.087079, 0.048070, 0.031638, 185.621994, 0.0, 0.0, 1.0, 1.0, 1.0);
  2726. case 6: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 338, 6, 0.0, 0.0, 0.0);
  2727. case 7: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 366, 6, 0.0, 0.0, 0.0);
  2728. case 8: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 1277, 6, 0.074097, 0.016038, 0.009600, 359.580230, 350.386047, 14.481473, 0.250683, 1.0, 0.250702);
  2729. case 9: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 2103, 6, 0.347276, 0.018217, 0.056332, 15.577089, 265.794799, 0.0, 0.719023, 1.0, 0.554738);
  2730. case 10: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 19078, 4, -0.054276, 0.0, 0.028016, 195.591888, 204.274688, 0.0, 0.748166, 1.0, 0.740877);
  2731. case 11: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 18641, 5, 0.091820, 0.024471, -0.033493, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
  2732. case 12: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 18644, 6, 0.077635, 0.014523, 0.0, 174.836212, 7.079411, 0.0, 1.008414, 1.0, 0.747666);
  2733. case 13: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 18635, 6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
  2734. case 14: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 19087, 6, 0.058083, 0.008219, 0.472783, 0.0, 0.0, 0.0, 1.674143, 1.0, 0.327090);
  2735. case 15: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 339, 6, 0.0, 0.0, 0.0);
  2736. case 16: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 341, 6, 0.0, 0.0, 0.0);
  2737. case 17: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 932, 1, -0.780373, 0.043744, 0.089657, 188.440246, 92.957847, 355.417968, 1.0, 1.0, 1.0);
  2738. case 18: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 18634, 6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
  2739. case 19: SetPlayerAttachedObject(playerid, HOLDOBJECT_BENCH, 18633, 6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
  2740. }
  2741. }
  2742. }
  2743. }
  2744. case 65:
  2745. {
  2746. if(!response) return true;
  2747. switch(listitem)
  2748. {
  2749. case 0:
  2750. {
  2751. if(GetPVarInt(playerid, "Rank") >= 3) CreateEMSVehicle(playerid, 544, 3, 3);
  2752. else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
  2753. }
  2754. case 1:
  2755. {
  2756. if(GetPVarInt(playerid, "Rank") >= 3) CreateEMSVehicle(playerid, 407, 3, 3);
  2757. else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
  2758. }
  2759. case 2:
  2760. {
  2761. if(GetPVarInt(playerid, "Rank") >= 3) CreateEMSVehicle(playerid, 407, 6, 3);
  2762. else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
  2763. }
  2764. case 3: CreateEMSVehicle(playerid, 416, 1, 3);
  2765. case 4: CreateEMSVehicle(playerid, 416, 3, 1);
  2766. case 5: CreateEMSVehicle(playerid, 416, 3, 3);
  2767. case 6: CreateEMSVehicle(playerid, 416, 1, 1);
  2768. case 7:
  2769. {
  2770. if(GetPVarInt(playerid, "Rank") >= 3) CreateEMSVehicle(playerid, 599, 3, 1);
  2771. else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
  2772. }
  2773. case 8:
  2774. {
  2775. if(GetPVarInt(playerid, "Rank") >= 8) CreateEMSVehicle(playerid, 427, 6, 6);
  2776. else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
  2777. }
  2778. case 9:
  2779. {
  2780. if(GetPVarInt(playerid, "Rank") >= 8) CreateEMSVehicle(playerid, 490, 3, 3);
  2781. else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
  2782. }
  2783. case 10:
  2784. {
  2785. if(GetPVarInt(playerid, "Rank") >= 3) CreateEMSVehicle(playerid, 442, 1, 0);
  2786. else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
  2787. }
  2788. case 11: CreateEMSVehicle(playerid, 525, 3, 3);
  2789. case 12:
  2790. {
  2791. if(GetPVarInt(playerid, "Rank") >= 4) CreateEMSVehicle(playerid, 563, 3, 1);
  2792. else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
  2793. }
  2794. case 13:
  2795. {
  2796. if(GetPVarInt(playerid, "Rank") >= 3) CreateEMSVehicle(playerid, 497, 3, 1);
  2797. else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
  2798. }
  2799. case 14:
  2800. {
  2801. if(GetPVarInt(playerid, "Rank") >= 5) CreateEMSVehicle(playerid, 427, 3, 3);
  2802. else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
  2803. }
  2804. case 15:
  2805. {
  2806. if(GetPVarInt(playerid, "Rank") >= 13) CreateEMSVehicle(playerid, 596, 3, 1);
  2807. else SendClientMessage(playerid,COLOR_GREY,"You are not high enough rank to do this.");
  2808. }
  2809. }
  2810. }
  2811. case 66: // SEXSHOP DIALOG
  2812. {
  2813. if(!response) return true;
  2814. SetPVarInt(playerid, "PDBT", 7), SetPVarInt(playerid, "PDBTLI", listitem);
  2815. format(string, sizeof(string), "Would you like to purchase this item?~n~Cost: $%d~n~Cash: $%d - Bank: $%d", SexItems[listitem][1], GetPlayerMoneyEx(playerid), GetPVarInt(playerid, "Bank"));
  2816. ConfigPayment(playerid, 1, string);
  2817. }
  2818. case 67: // WAREHOUSE DIALOG
  2819. {
  2820. if(!response) return true;
  2821. if(listitem == sizeof(WarItems)) {
  2822. if(!CheckInvItem(playerid, 404)) return SendClientMessage(playerid, COLOR_WHITE, "You don't have a watch to pawn.");
  2823. RemoveInvItem(playerid, 404);
  2824. GivePlayerMoneyEx(playerid,150);
  2825. scm(playerid, COLOR_WHITE, "You've pawned a watch for $150.");
  2826. return true;
  2827. }
  2828. if(listitem == (sizeof(WarItems)+1)) {
  2829. if(!CheckInvItem(playerid, 405)) return SendClientMessage(playerid, COLOR_WHITE, "You don't have a cellphone to pawn.");
  2830. RemoveInvItem(playerid, 405);
  2831. GivePlayerMoneyEx(playerid,300);
  2832. scm(playerid, COLOR_WHITE, "You've pawned a cellphone for $300.");
  2833. return true;
  2834. }
  2835. if(listitem == (sizeof(WarItems)+2)) {
  2836. if(!CheckInvItem(playerid, 408)) return SendClientMessage(playerid, COLOR_WHITE, "You don't have a MP3 player to pawn.");
  2837. RemoveInvItem(playerid, 408);
  2838. GivePlayerMoneyEx(playerid,75);
  2839. scm(playerid, COLOR_WHITE, "You've pawned a MP3 player for $75.");
  2840. return true;
  2841. }
  2842. SetPVarInt(playerid, "PDBT", 8), SetPVarInt(playerid, "PDBTLI", listitem);
  2843. format(string, sizeof(string), "Would you like to purchase this item?~n~Cost: $%d~n~Cash: $%d - Bank: $%d", WarItems[listitem][1], GetPlayerMoneyEx(playerid), GetPVarInt(playerid, "Bank"));
  2844. ConfigPayment(playerid, 1, string);
  2845. }
  2846. case 68: // HOUSE RADIO
  2847. {
  2848. if(!response) return true;
  2849. switch(listitem)
  2850. {
  2851. case 0: // Radio Stations
  2852. {
  2853. new result[2048];
  2854. for(new i = 0; i < sizeof(CarRadio); i++)
  2855. {
  2856. if(i == 0) { format(result, 2048, "%s", CarRadio[i][cName]); }
  2857. else { format(result, 2048, "%s\n%s", result, CarRadio[i][cName]); }
  2858. }
  2859. ShowPlayerDialog(playerid,69,DIALOG_STYLE_LIST,"Radio Stations", result, "Select", "Go Back");
  2860. }
  2861. case 1: // Direct Link
  2862. {
  2863. ShowPlayerDialog(playerid, 70, DIALOG_STYLE_INPUT, "Direct URL", "Enter the .mp3 URL you would like to play.", "Enter", "Go Back");
  2864. }
  2865. case 2: // Turn Off
  2866. {
  2867. strmid(HouseInfo[GetPVarInt(playerid, "HouseKey")][hRadioU], "None", 0, strlen("None"), 255);
  2868. GameTextForPlayer(playerid, "~w~Radio~n~~r~OFF", 4000, 3);
  2869. foreach(new i : Player)
  2870. {
  2871. if(GetPVarInt(i, "HouseEnter") == GetPVarInt(playerid, "HouseKey"))
  2872. {
  2873. StopAudioStreamForPlayerEx(i);
  2874. }
  2875. }
  2876. }
  2877. }
  2878. }
  2879. case 69:
  2880. {
  2881. if(!response) return cmd_house(playerid, "radio");
  2882. if(listitem != 0) {
  2883. PlayHouseRadio(GetPVarInt(playerid, "HouseKey"), CarRadio[listitem][cURL]);
  2884. } else {
  2885. PlayHouseRadio(GetPVarInt(playerid, "HouseKey"), RadioLSStream, 1);
  2886. HouseInfo[GetPVarInt(playerid, "HouseKey")][hOnRLS] = 1;
  2887. }
  2888. }
  2889. case 70:
  2890. {
  2891. if(!response) return cmd_house(playerid, "radio");
  2892. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 70, DIALOG_STYLE_INPUT, "Direct URL", "Enter the .mp3 URL you would like to play.", "Enter", "Go Back");
  2893. if(strlen(inputtext) > 256) return ShowPlayerDialog(playerid, 70, DIALOG_STYLE_INPUT, "Direct URL", "Enter the .mp3 URL you would like to play.", "Enter", "Go Back");
  2894. PlayHouseRadio(GetPVarInt(playerid, "HouseKey"), inputtext);
  2895. }
  2896. case 72: // Walkstyle dialog
  2897. {
  2898. switch(response)
  2899. {
  2900. case 0: cmd_options(playerid, "");
  2901. case 1: // Selecting
  2902. {
  2903. cmd_options(playerid, "");
  2904. switch(listitem)
  2905. {
  2906. case 0: SetPlayerWalkStyle(playerid,WALKSTYLE_GANG1);
  2907. case 1: SetPlayerWalkStyle(playerid,WALKSTYLE_GANG2);
  2908. case 2: SetPlayerWalkStyle(playerid,WALKSTYLE_NORMAL);
  2909. case 3: SetPlayerWalkStyle(playerid,WALKSTYLE_SEXY);
  2910. case 4: SetPlayerWalkStyle(playerid,WALKSTYLE_OLD);
  2911. case 5: SetPlayerWalkStyle(playerid,WALKSTYLE_SNEAK);
  2912. case 6: SetPlayerWalkStyle(playerid,WALKSTYLE_BLIND);
  2913. case 7: SetPlayerWalkStyle(playerid,WALKSTYLE_ARMED);
  2914. case 8: SetPlayerWalkStyle(playerid,WALKSTYLE_POLICE);
  2915. case 9: RemovePlayerWalkStyle(playerid);
  2916. }
  2917. }
  2918. }
  2919. }
  2920. case 73: {
  2921. if(GetPVarInt(playerid, "RentKey") != 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: You already rent a vehicle, (/unrent)!");
  2922. if(GetPlayerMoneyEx(playerid) >= 50) {
  2923. if(GetPlayerScore(playerid) > 8){
  2924. GivePlayerMoneyEx(playerid, -50);
  2925. SendClientMessage(playerid, COLOR_WHITE, "Congratulations on your $50 purchase !");
  2926. }
  2927.  
  2928. SendClientMessage(playerid, COLOR_WHITE, "To unrent your rental vehicle type (/unrent).");
  2929. new found = 0, foundid = 0;
  2930. for(new r = 0; r < sizeof(RentalSpot); r++) {
  2931. if(IsPlayerInRangeOfPoint(playerid, 20.0, RentalSpot[r][0], RentalSpot[r][1], RentalSpot[r][2])) {
  2932. if(found == 0) {
  2933. found++;
  2934. foundid=r;
  2935. }
  2936. }
  2937. }
  2938.  
  2939. new veh;
  2940. new rancol = random(200) + 1;
  2941. veh = CreateVehicle(gRentalIDs[listitem][0], RentalSpot[foundid][3], RentalSpot[foundid][4], RentalSpot[foundid][5], RentalSpot[foundid][6], rancol,rancol, -1);
  2942. Iter_Add(Vehicle, veh);
  2943. VehicleInfo[veh][vFuel]=100, VehicleInfo[veh][vEngine]=0;
  2944. VehicleInfo[veh][vWindows]=0, VehicleInfo[veh][vID]=0;
  2945. VehicleInfo[veh][vLights]=0, VehicleInfo[veh][vCreated]=1;
  2946. VehicleInfo[veh][vType] = VEHICLE_RENTAL, VehicleInfo[veh][vJob]=0;
  2947. VehicleInfo[veh][vLights] = 0, VehicleInfo[veh][vLock] = 0;
  2948. SetVehicleNumberPlate(veh, "RENTAL");
  2949. new engine, lights, alarm, doors, bonnet, boot, objective;
  2950. GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
  2951. SetVehicleParamsEx(veh,engine,lights,alarm,0,bonnet,boot,objective);
  2952. SetVehicleToRespawn(veh);
  2953. SetPVarInt(playerid, "RentKey", veh);
  2954. PutPlayerInVehicleEx(playerid, veh, 0);
  2955. }
  2956. else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds !");
  2957. }
  2958. /*case 74: // House Furniture Dialog
  2959. {
  2960. if(!response) return true;
  2961. new objectid=FurnitureObject[listitem][fmodel], Float:X, Float:Y, Float:Z, obj = 0;
  2962. GetPlayerPos(playerid, X, Y, Z);
  2963. obj = CreatePlayerObject(playerid, objectid, X+1.0, Y+1.0, Z, 0.0, 0.0, 0.0, 100.0);
  2964. SetPVarInt(playerid, "FurnObject", obj);
  2965. SetPVarInt(playerid, "EditorMode", 1);
  2966. SetPVarInt(playerid, "Mute", 1);
  2967. SetPVarInt(playerid, "FurnID", listitem);
  2968. EditPlayerObject(playerid, obj);
  2969. format(string, sizeof(string),"%d selected, use the SPRINT key to navigate.", );
  2970. SendClientMessage(playerid, COLOR_WHITE, string);
  2971. }*/
  2972. case 75: // House Furniture AGREEMENT Dialog
  2973. {
  2974. if(!response) return true;
  2975. new keyex = FurnRight(playerid, 1);
  2976. if(keyex == -1) return true;
  2977. new cost = 250;
  2978. if(GetPVarInt(playerid, "MonthDon") > 0) { cost = 0; }
  2979. if(GetPlayerMoneyEx(playerid) >= cost) {
  2980. if(GetPlayerInterior(playerid) == 0) {
  2981. new Float:distance = GetDistanceFromPointToPoint(PlayerInfo[playerid][pFurn][0], PlayerInfo[playerid][pFurn][1], PlayerInfo[playerid][pFurn][2], HouseInfo[keyex][hXo], HouseInfo[keyex][hYo], HouseInfo[keyex][hZo]);
  2982. if(distance > HOUSE_PLANT_DISTANCE) {
  2983. scm(playerid, COLOR_LIGHTRED, "WARNING: Object is too far from the property and could not be planted!");
  2984. return 1;
  2985. } else {
  2986. new found = 0;
  2987. for(new i = 0; i < sizeof(FurnObjs); i++) {
  2988. if(PlayerInfo[playerid][pFurnID] == FurnObjs[i]) {
  2989. found++;
  2990. break;
  2991. }
  2992. }
  2993. if(found == 0) {
  2994. if(GetCount() > GetPVarInt(playerid, "OutDelay")) {
  2995. format(string, sizeof(string), "AdmWarn: %s has planted objectid: %d(%s) outside of houseid: %d.", PlayerInfo[playerid][pUsername], PlayerInfo[playerid][pFurnID], GetObjName(PlayerInfo[playerid][pFurnID]), keyex);
  2996. SendAdminMessage(COLOR_YELLOW, string);
  2997. scm(playerid, COLOR_LIGHTRED, "WARNING: Abusing the outdoor objects system will result in a permanent ban!");
  2998. SetPVarInt(playerid, "OutDelay", GetCount()+10000);
  2999. } else scm(playerid, COLOR_LIGHTRED, "You can only place 1 outdoor object every 10 seconds!");
  3000. }
  3001. }
  3002. }
  3003. format(string, sizeof(string),"~r~-$%d", cost);
  3004. GameTextForPlayer(playerid, string, 5000, 1);
  3005. GivePlayerMoneyEx(playerid, -cost);
  3006. BuildHouseObject(playerid, PlayerInfo[playerid][pFurnID], PlayerInfo[playerid][pFurn][0], PlayerInfo[playerid][pFurn][1], PlayerInfo[playerid][pFurn][2], PlayerInfo[playerid][pFurnR][0], PlayerInfo[playerid][pFurnR][1], PlayerInfo[playerid][pFurnR][2]);
  3007. }
  3008. else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds!");
  3009. }
  3010. case 76:
  3011. {
  3012. if(response)
  3013. {
  3014. new furnid = 0, furnitname[100];
  3015. key = FurnRight(playerid, 1);
  3016. furnitname="N/A";
  3017. for(new xe;xe<sizeof(FurnObjs);xe++)
  3018. {
  3019. if(HouseInfo[key][hoID][GetPVarInt(playerid, "FurnEditH")] == FurnObjs[xe])
  3020. {
  3021. format(furnitname, 100, "%d", FurnObjs[xe]);
  3022. furnid=xe;
  3023. break;
  3024. }
  3025. }
  3026. //new priceex = 100;
  3027. switch(listitem)
  3028. {
  3029. case 0: // Edit Object
  3030. {
  3031. new obj = 0, h = GetPVarInt(playerid, "FurnEditH"), key2 = FurnRight(playerid, 1);
  3032. obj = CreatePlayerObject(playerid, HouseInfo[key2][hoID][h], HouseInfo[key2][hoX][h], HouseInfo[key2][hoY][h], HouseInfo[key2][hoZ][h], HouseInfo[key2][horX][h], HouseInfo[key2][horY][h], HouseInfo[key2][horZ][h], 100.0);
  3033. SetPVarInt(playerid, "FurnObject", obj);
  3034. SetPVarInt(playerid, "EditorMode", 2);
  3035. SetPVarInt(playerid, "Mute", 1);
  3036. PlayerInfo[playerid][pFurnID]=furnid;
  3037. EditPlayerObject(playerid, obj);
  3038. format(string, sizeof(string),"%s selected, use the SPRINT key to navigate.", furnitname);
  3039. SendClientMessage(playerid, COLOR_WHITE, string);
  3040. }
  3041. case 1: // Input Position
  3042. {
  3043. if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
  3044. ShowPlayerDialog(playerid, 539, DIALOG_STYLE_LIST, "What axis do you want to edit?", "X-pos\nY-pos\nZ-pos\nX-rotation\nY-rotation\nZ-rotation", "Continue", "Close");
  3045. }
  3046. case 2: // Select Material
  3047. {
  3048. if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
  3049. SendClientMessage(playerid,COLOR_LIGHTRED,"WARNING: Editing an invalid-layer MAY cause parts of the object to turn invisible, resetting the layers material will fix this.");
  3050. SendClientMessage(playerid,COLOR_LIGHTBLUE,"When you choose a layer to edit, that layer becomes highlighted in red.");
  3051. ShowPlayerDialog(playerid, 503, DIALOG_STYLE_LIST, "What layer do you want to edit?", "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12", "Select", "Close");
  3052. }
  3053. case 3: // Reset Material
  3054. {
  3055. if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
  3056. new i = GetPVarInt(playerid, "FurnEditH"), key2 = FurnRight(playerid, 1);
  3057. if(IsValidDynamicObject(HouseInfo[key2][hObject][i])) DestroyDynamicObject(HouseInfo[key2][hObject][i]);
  3058. HouseInfo[key2][hObject][i] = CreateDynamicObject(HouseInfo[key2][hoID][i], HouseInfo[key2][hoX][i], HouseInfo[key2][hoY][i], HouseInfo[key2][hoZ][i], HouseInfo[key2][horX][i], HouseInfo[key2][horY][i], HouseInfo[key2][horZ][i], key2);
  3059. Streamer_Update(playerid);
  3060. SendClientMessage(playerid,COLOR_LIGHTBLUE,"You've reset the selected objects material.");
  3061. for(new v=0; v < 13; v++) {
  3062. HouseMInfo[key2][i][v] = 0;
  3063. }
  3064. SaveFurnObj(key2, i);
  3065. }
  3066. case 4: // Remove Object
  3067. {
  3068. if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
  3069. new h = GetPVarInt(playerid, "FurnEditH"), key2 = FurnRight(playerid, 1), priceex = 100;
  3070. if(IsValidDynamicObject(HouseInfo[key2][hObject][h])) DestroyDynamicObject(HouseInfo[key2][hObject][h]);
  3071. HouseInfo[key2][hObject][h]=0;
  3072. HouseInfo[key2][hoID][h]=0;
  3073. HouseInfo[key2][hoX][h] = 0.0;
  3074. HouseInfo[key2][hoY][h] = 0.0;
  3075. HouseInfo[key2][hoZ][h] = 0.0;
  3076. HouseInfo[key2][horX][h] = 0.0;
  3077. HouseInfo[key2][horY][h] = 0.0;
  3078. HouseInfo[key2][horZ][h] = 0.0;
  3079. HouseInfo[key2][hoInt][h]--;
  3080. format(string, 128, "%s removed.", furnitname);
  3081. SendClientMessage(playerid,COLOR_WHITE,string);
  3082. GivePlayerMoneyEx(playerid, priceex);
  3083. SaveFurnObj(key2, h);
  3084. }
  3085. }
  3086. }
  3087. }
  3088. case 78:
  3089. {
  3090. if(!response) return true;
  3091. switch(listitem)
  3092. {
  3093. case 0: CreateGovVehicle(playerid, 560, 0, 0);
  3094. case 1: CreateGovVehicle(playerid, 426, 0, 0);
  3095. case 2: CreateGovVehicle(playerid, 490, 0, 0);
  3096. case 3: CreateGovVehicle(playerid, 409, 0, 0);
  3097. case 4: CreateGovVehicle(playerid, 487, 0, 0);
  3098. }
  3099. }
  3100. case 79: // GOV ARMOURY DIALOG
  3101. {
  3102. if(!response) return true;
  3103. if(GovItems[listitem][0] == 1000) return SetPlayerArmourEx(playerid, 99.0);
  3104. if(GovItems[listitem][0] == 1001) return SetPlayerHealth(playerid, 100.0);
  3105. if(!CheckInv(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "Your inventory is currently full!");
  3106. if(listitem == sizeof(GovItems))
  3107. {
  3108. ResetPlayerWeaponsEx(playerid);
  3109. SetPlayerArmourEx(playerid, 0.0);
  3110. for(new p = 0; p < MAX_INV_SLOTS; p++)
  3111. {
  3112. if(PlayerInfo[playerid][pInvItem][p] >= 22 && PlayerInfo[playerid][pInvItem][p] <= 41) // Weapons
  3113. {
  3114. RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][p], 0, p);
  3115. }
  3116.  
  3117. if(PlayerInfo[playerid][pInvItem][p] >= 100 && PlayerInfo[playerid][pInvItem][p] <= 128) // Armmo
  3118. {
  3119. RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][p], 0, p);
  3120. }
  3121. }
  3122. return 1;
  3123. }
  3124. else
  3125. {
  3126. switch(GovItems[listitem][0])
  3127. {
  3128. case 1 .. 99:
  3129. {
  3130. if(CheckInvItem(playerid, GovItems[listitem][0])) return SendClientMessage(playerid, COLOR_WHITE, "You already have this item!");
  3131. if(GetPVarInt(playerid, "ConnectTime") <= 7) return SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient hours played!");
  3132. }
  3133. }
  3134. if(GetPVarInt(playerid, "Rank") >= GovItems[listitem][1])
  3135. {
  3136. if(GovItems[listitem][0] == 3) GiveInvItem(playerid, GovItems[listitem][0], 1, 0);
  3137. else if(GovItems[listitem][0] == 41) GiveInvItem(playerid, GovItems[listitem][0], 1000, 0);
  3138. else if(GovItems[listitem][0] == 43) GiveInvItem(playerid, GovItems[listitem][0], 50, 0);
  3139. else GiveInvItem(playerid, GovItems[listitem][0], PrintIQ(GovItems[listitem][0]), 0, PlayerInfo[playerid][pWepSerial]);
  3140. format(string, 128, "%s selected!", PrintIName(GovItems[listitem][0]), GovItems[listitem][1]);
  3141. SendClientMessage(playerid, COLOR_WHITE, string);
  3142. }
  3143. else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient rank!");
  3144. }
  3145. }
  3146. case 80:
  3147. {
  3148. if(!response) return EnableUCP(playerid, 0);
  3149. switch(listitem)
  3150. {
  3151. case 0: ShowPlayerDialog(playerid, 81, DIALOG_STYLE_INPUT, "Chat Style", "Select a preferred chat-style animation for your character\nChoose from numbers (1-8)", "Enter", "Go Back");
  3152. case 1: ShowPlayerDialog(playerid,72,DIALOG_STYLE_LIST,"Walk Style","Gang 1\nGang 2\nNormal\nSexy\nOld\nSneaking\nBlind\nArmed\nPolice\nRemove","Select", "Go Back");
  3153. case 2:
  3154. {
  3155. cmd_options(playerid, "");
  3156. switch(GetPVarInt(playerid, "TogPM"))
  3157. {
  3158. case 0:
  3159. {
  3160. SetPVarInt(playerid, "TogPM", 1);
  3161. SendClientMessage(playerid, COLOR_GREY, "Private Messages disabled!");
  3162. }
  3163. case 1:
  3164. {
  3165. SetPVarInt(playerid, "TogPM", 0);
  3166. SendClientMessage(playerid, COLOR_GREY, "Private Messages enabled!");
  3167. }
  3168. }
  3169. }
  3170. case 3:
  3171. {
  3172. cmd_options(playerid, "");
  3173. switch(GetPVarInt(playerid, "TogHud"))
  3174. {
  3175. case 0:
  3176. {
  3177. SetPVarInt(playerid, "TogHud", 1);
  3178. SendClientMessage(playerid, COLOR_GREY, "HUD disabled!");
  3179. TextDrawHideForPlayer(playerid,MoneyDraw[playerid]);
  3180. TextDrawHideForPlayer(playerid,MoneyDraw2);
  3181. TextDrawHideForPlayer(playerid,LocationDraw[playerid]);
  3182. }
  3183. case 1:
  3184. {
  3185. SetPVarInt(playerid, "TogHud", 0);
  3186. SendClientMessage(playerid, COLOR_GREY, "HUD enabled!");
  3187. TextDrawShowForPlayer(playerid,MoneyDraw[playerid]);
  3188. TextDrawShowForPlayer(playerid,MoneyDraw2);
  3189. TextDrawShowForPlayer(playerid,LocationDraw[playerid]);
  3190. }
  3191. }
  3192. }
  3193. case 4:
  3194. {
  3195. cmd_options(playerid, "");
  3196. if(GetPVarInt(playerid, "AudioT") == 0)
  3197. {
  3198. SetPVarInt(playerid, "AudioT", 1);
  3199. SCM(playerid, -1, "Audio toggled off.");
  3200. }
  3201. else
  3202. {
  3203. SetPVarInt(playerid, "AudioT", 0);
  3204. SCM(playerid, -1, "Audio toggled on.");
  3205. }
  3206. }
  3207. case 5:
  3208. {
  3209. cmd_options(playerid, "");
  3210. if(GetPVarInt(playerid, "AutoReload") == 0)
  3211. {
  3212. SetPVarInt(playerid, "AutoReload", 1);
  3213. SCM(playerid, -1, "Auto-reload toggled OFF.");
  3214. }
  3215. else
  3216. {
  3217. SetPVarInt(playerid, "AutoReload", 0);
  3218. SCM(playerid, -1, "Auto-reload toggled ON.");
  3219. }
  3220. }
  3221. case 6: ShowPlayerDialog(playerid,82,DIALOG_STYLE_LIST,"Money Bar Color","Green\nRed\nWhite\nYellow\nPink\nBlue","Select", "Go Back");
  3222. case 7: ShowPlayerDialog(playerid,88,DIALOG_STYLE_LIST,"Cellphone Color","Dark Orange\nBlue\nLight Orange\nBlack\nPink\nRed\nGreen\nDark Blue\nYellow\nGrey\nWhite","Select", "Go Back");
  3223. case 8:
  3224. {
  3225. cmd_options(playerid, "");
  3226. if(GetPVarInt(playerid, "TogNews") == 0)
  3227. {
  3228. SetPVarInt(playerid, "TogNews", 1);
  3229. SCM(playerid, -1, "San News Radio toggled OFF.");
  3230. }
  3231. else
  3232. {
  3233. SetPVarInt(playerid, "TogNews", 0);
  3234. SCM(playerid, -1, "San News Radio toggled ON.");
  3235. }
  3236. }
  3237. case 9:
  3238. {
  3239. cmd_options(playerid, "");
  3240. if(GetPVarInt(playerid, "TogRadio") == 0)
  3241. {
  3242. SetPVarInt(playerid, "TogRadio", 1);
  3243. SCM(playerid, -1, "RLS Radio toggled OFF.");
  3244. }
  3245. else
  3246. {
  3247. SetPVarInt(playerid, "TogRadio", 0);
  3248. SCM(playerid, -1, "RLS Radio toggled ON.");
  3249. }
  3250. }
  3251. case 10:
  3252. {
  3253. cmd_options(playerid, "");
  3254. if(GetPVarInt(playerid, "TogB") == 0)
  3255. {
  3256. SetPVarInt(playerid, "TogB", 1);
  3257. SCM(playerid, -1, "Local-OOC Chat toggled OFF.");
  3258. }
  3259. else
  3260. {
  3261. SetPVarInt(playerid, "TogB", 0);
  3262. SCM(playerid, -1, "Local-OOC Chat toggled ON.");
  3263. }
  3264. }
  3265. case 11:
  3266. {
  3267. cmd_options(playerid, "");
  3268. if(PlayerInfo[playerid][pBuyDialog] == 0) {
  3269. PlayerInfo[playerid][pBuyDialog] = 1;
  3270. SCM(playerid, -1, "Payment type textdraw disabled.");
  3271. format(string, sizeof(string), "UPDATE `accounts` SET `BuyDialog`=1 WHERE Name='%s'", PlayerName(playerid));
  3272. mysql_tquery(handlesql, string);
  3273. } else {
  3274. PlayerInfo[playerid][pBuyDialog] = 0;
  3275. SCM(playerid, -1, "Payment type textdraw enabled.");
  3276. format(string, sizeof(string), "UPDATE `accounts` SET `BuyDialog`=0 WHERE Name='%s'", PlayerName(playerid));
  3277. mysql_tquery(handlesql, string);
  3278. }
  3279. }
  3280. }
  3281. }
  3282. case 81:
  3283. {
  3284. cmd_options(playerid, "");
  3285. if(!response) return true;
  3286. if(!strlen(inputtext)) return true;
  3287. if(strlen(inputtext) >= 7) return true;
  3288. new amount = strval(inputtext);
  3289. if(amount <= 0) return true;
  3290. if(amount > 8) return true;
  3291. format(string, sizeof(string), "Chatstyle set to [%d].", amount);
  3292. SCM(playerid, COLOR_WHITE, string);
  3293. SetPVarInt(playerid, "ChatStyle", amount);
  3294. }
  3295. case 82:
  3296. {
  3297. cmd_options(playerid, "");
  3298. if(!response) return true;
  3299. new result[50];
  3300. switch(listitem)
  3301. {
  3302. case 0: result="green";
  3303. case 1: result="red";
  3304. case 2: result="white";
  3305. case 3: result="yellow";
  3306. case 4: result="pink";
  3307. case 5: result="blue";
  3308. }
  3309. format(string, sizeof(string), "Moneybar color set to [%s].", result);
  3310. SCM(playerid, COLOR_WHITE, string);
  3311. SetPVarInt(playerid, "HudCol", listitem);
  3312. SetSlidedMoneyBar(playerid);
  3313. }
  3314. case 86:
  3315. {
  3316. if(!response) return true;
  3317. format(string, sizeof(string),"GPS marker set on lcoation [%s]." , Locations[listitem][lname]);
  3318. SCM(playerid, COLOR_WHITE, string);
  3319. SetPlayerCheckpoint(playerid, Locations[listitem][lx], Locations[listitem][ly], Locations[listitem][lz], 1.5);
  3320. }
  3321. case 87:
  3322. {
  3323. if(!response) return 1;
  3324. new i, text[128];
  3325. i = listitem;
  3326. format(text, sizeof(text), "Government: You took skin '%s'", Govskin[i][Name]);
  3327. SetPlayerSkinEx(playerid, Govskin[i][SkinID]);
  3328. SCM(playerid, -1, text);
  3329. }
  3330. case 88:
  3331. {
  3332. cmd_options(playerid, "");
  3333. if(!response) return 1;
  3334. new object = 0;
  3335. switch(listitem)
  3336. {
  3337. case 0: object=18865;
  3338. case 1: object=18866;
  3339. case 2: object=18867;
  3340. case 3: object=18868;
  3341. case 4: object=18869;
  3342. case 5: object=18870;
  3343. case 6: object=18871;
  3344. case 7: object=18872;
  3345. case 8: object=18873;
  3346. case 9: object=18874;
  3347. case 10: object=19513;
  3348. }
  3349. SCM(playerid, COLOR_WHITE, "Cellphone color changed!");
  3350. SetPVarInt(playerid, "CellCol", object);
  3351. }
  3352. case 89:
  3353. {
  3354. new option[5], optionname[5][128];
  3355. option[0]=1, optionname[0]="Last Location";
  3356. if(GetPVarInt(playerid,"HouseKey") != 0) option[1]=1, optionname[1]="Property";
  3357. if(GetPVarInt(playerid,"BizzKey") != 0) option[2]=1, optionname[2]="Business";
  3358. if(GetPVarInt(playerid,"Member") == 1 || GetPVarInt(playerid,"Member") == 2) option[3]=1, optionname[3]="Faction HQ";
  3359. for(new i = 1; i < 4; i++)
  3360. {
  3361. if(listitem == i && option[i] == 0)
  3362. {
  3363. listitem=i+1;
  3364. }
  3365. }
  3366. format(string, sizeof(string), "Selected Spawnpoint: %s!", optionname[listitem]);
  3367. SCM(playerid, COLOR_WHITE, string);
  3368. switch(listitem)
  3369. {
  3370. /*case 0: // Last Location
  3371. {
  3372. }*/
  3373. case 1: // Property
  3374. {
  3375. key = GetPVarInt(playerid,"HouseKey");
  3376. SetPVarFloat(playerid, "PosX", HouseInfo[key][hXi]);
  3377. SetPVarFloat(playerid, "PosY", HouseInfo[key][hYi]);
  3378. SetPVarFloat(playerid, "PosZ", HouseInfo[key][hZi]);
  3379. SetPVarInt(playerid, "World", key);
  3380. SetPVarInt(playerid, "Interior", HouseInfo[key][hIntIn]);
  3381. }
  3382. case 2: // Business
  3383. {
  3384. key = GetPVarInt(playerid,"BizzKey");
  3385. SetPVarFloat(playerid, "PosX", BizInfo[key][Xi]);
  3386. SetPVarFloat(playerid, "PosY", BizInfo[key][Xi]);
  3387. SetPVarFloat(playerid, "PosZ", BizInfo[key][Xi]);
  3388. SetPVarInt(playerid, "World", key);
  3389. SetPVarInt(playerid, "Interior", BizInfo[key][IntIn]);
  3390. }
  3391. case 3:
  3392. {
  3393. switch(GetPVarInt(playerid,"Member"))
  3394. {
  3395. case 1: // LSPD
  3396. {
  3397. SetPVarFloat(playerid, "PosX", 1553.4929);
  3398. SetPVarFloat(playerid, "PosY", -1675.7034);
  3399. SetPVarFloat(playerid, "PosZ", 16.1953);
  3400. SetPVarInt(playerid, "World", 0);
  3401. SetPVarInt(playerid, "Interior", 0);
  3402. }
  3403. case 2: // LSFD
  3404. {
  3405. SetPVarFloat(playerid, "PosX", 1182.5016);
  3406. SetPVarFloat(playerid, "PosY", -1321.9572);
  3407. SetPVarFloat(playerid, "PosZ", 13.5788);
  3408. SetPVarInt(playerid, "World", 0);
  3409. SetPVarInt(playerid, "Interior", 0);
  3410. }
  3411. }
  3412. }
  3413. }
  3414. SetPVarInt(playerid, "SpawnLocation", 0);
  3415. SetTimerEx("OnLoginInit", 500, false, "ii", playerid, 1);
  3416. }
  3417. case 90: // FACTION SHIPMENT
  3418. {
  3419. // Options
  3420. ShowPlayerDialog(playerid, 91, DIALOG_STYLE_LIST, "Shipment Options", "Order Info\nSelect Items\nProceed", "Select", "Close");
  3421. }
  3422. case 91:
  3423. {
  3424. if(!response) return true;
  3425. new member = GetPVarInt(playerid, "Member");
  3426. switch(listitem)
  3427. {
  3428. case 0: PrintShipment(playerid);
  3429. case 1:
  3430. {
  3431. if(FactionInfo[member][fShipment] > 0)
  3432. {
  3433. SCM(playerid, COLOR_LIGHTRED, "Your faction is currently in a shipping process already!");
  3434. PrintShipment(playerid);
  3435. return true;
  3436. }
  3437. new result[624];
  3438. for(new i=0; i < MAX_SHIPMENT_SLOTS; i++) {
  3439. if(FactionInfo[member][fShipmentID][i] > 0) {
  3440. if(FactionInfo[member][fShipmentA][i] > 1 || IsQuantityItem(FactionInfo[member][fShipmentID][i])) {
  3441. format(result, sizeof(result), "%s\n%s (%d)", result, PrintIName(FactionInfo[member][fShipmentID][i]), FactionInfo[member][fShipmentA][i]);
  3442. } else format(result, sizeof(result), "%s\n%s", result, PrintIName(FactionInfo[member][fShipmentID][i]));
  3443. } else format(result, sizeof(result), "%s\nEMPTY SLOT", result);
  3444. }
  3445. ShowPlayerDialog(playerid, 93, DIALOG_STYLE_LIST, "Select Slot", result, "Select", "Back");
  3446. }
  3447. case 2:
  3448. {
  3449. DeletePVar(playerid, "ShipmentSlot");
  3450. if(FactionInfo[member][fShipment] > 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Your faction is currently waiting for a shipment to be delivered!");
  3451. new priceex = 0, added = 0, wepcount, drugcount;
  3452. FactionInfo[member][fShipment] = 0;
  3453. FactionInfo[member][fShipmentApproved] = 1;
  3454. for(new i=0; i < MAX_SHIPMENT_SLOTS; i++) {
  3455. if(FactionInfo[member][fShipmentID][i] < 1) continue;
  3456. if(IsQuantityItem(FactionInfo[member][fShipmentID][i])) {
  3457. priceex += (GetItemPrice(FactionInfo[member][fShipmentID][i])*FactionInfo[member][fShipmentA][i]);
  3458. } else priceex += GetItemPrice(FactionInfo[member][fShipmentID][i]);
  3459. switch(FactionInfo[member][fShipmentID][i])
  3460. {
  3461. case 22 .. 34:
  3462. {
  3463. if(added == 0) {
  3464. added = 1;
  3465. FactionInfo[member][fShipment] += 15;
  3466. }
  3467. wepcount++;
  3468. FactionInfo[member][fShipment] += 15;
  3469. if(FactionInfo[member][fShipmentID][i] > 27 && FactionInfo[member][fShipmentID][i] < 33) { FactionInfo[member][fShipmentApproved] = 0; }
  3470. }
  3471. case 100 .. 150:
  3472. {
  3473. if(added == 0) {
  3474. added = 1;
  3475. FactionInfo[member][fShipment] += 15;
  3476. }
  3477. FactionInfo[member][fShipment] += FactionInfo[member][fShipmentA][i];
  3478. }
  3479. case 409:
  3480. {
  3481. FactionInfo[member][fShipment] += 10;
  3482. }
  3483. case 500 .. 550:
  3484. {
  3485. drugcount += FactionInfo[member][fShipmentA][i];
  3486. FactionInfo[member][fShipment] += (FactionInfo[member][fShipmentA][i]/2);
  3487. }
  3488. case 1002 .. 1020:
  3489. {
  3490. FactionInfo[member][fShipment] += FactionInfo[member][fShipmentA][i];
  3491. if(FactionInfo[member][fShipmentID][i] == 1004) { FactionInfo[member][fShipmentApproved] = 0; }
  3492. }
  3493. }
  3494. }
  3495. if(FactionInfo[member][fShipment] < 1) {
  3496. SendClientMessage(playerid, COLOR_LIGHTRED, "You have to select at least one item before ordering a faction shipment.");
  3497. return PrintShipment(playerid);
  3498. }
  3499. if((FactionInfo[member][fWepCount]+wepcount) > FACTION_WEAPON_LIMIT || (FactionInfo[member][fDrugCount]+drugcount) > FACTION_DRUG_LIMIT) {
  3500. format(string, sizeof(string), "Your faction can only order %d weapons and %d grams of drugs at this time.", (FACTION_WEAPON_LIMIT-FactionInfo[member][fWepCount]), (FACTION_DRUG_LIMIT-FactionInfo[member][fDrugCount]));
  3501. SendFactionMessage(member, COLOR_LIGHTRED, string);
  3502. SendFactionMessage(member, COLOR_BLUE, "[TIP] {FFFFFF}Every hour your faction can order 1 extra gun, and 100 grams more of any/all drugs.");
  3503. FactionInfo[member][fShipment] = 0;
  3504. return PrintShipment(playerid);
  3505. }
  3506. new Float:Pos[3];
  3507. if(FactionInfo[member][fShipmentApproved] == 0) {
  3508. if(ShipmentCache[member][sUsed] == 1) SendClientMessage(playerid, COLOR_WHITE, "You've replaced your existing shipment request with a new one.");
  3509. ShipmentCache[member][sUsed] = 1;
  3510. ShipmentCache[member][sTime] = FactionInfo[member][fShipment];
  3511. FactionInfo[member][fShipment] = 0;
  3512. ShipmentCache[member][sPrice] = priceex;
  3513. ShipmentCache[member][sWepCount] = wepcount;
  3514. ShipmentCache[member][sDrugCount] = drugcount;
  3515. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  3516. ShipmentCache[member][sPosX] = Pos[0];
  3517. ShipmentCache[member][sPosY] = Pos[1];
  3518. ShipmentCache[member][sPosZ] = Pos[2];
  3519. format(ShipmentCache[member][sName], MAX_PLAYER_NAME, "%s", PlayerName(playerid));
  3520. for(new i=0; i < MAX_SHIPMENT_SLOTS; i++) {
  3521. ShipmentCache[member][sShipmentID][i] = FactionInfo[member][fShipmentID][i];
  3522. ShipmentCache[member][sShipmentA][i] = FactionInfo[member][fShipmentA][i];
  3523. }
  3524. SendClientMessage(playerid, COLOR_ORANGE, "[NOTICE] {FFFFFF}Your shipment request has been sent to online administrators for approval. If approved the shipment will spawn where you ordered it after the time listed has passed.");
  3525. format(string, sizeof(string), "[NOTICE] {FFFFFF}The faction '%s' has submitted a shipment order that requires administrative approval. (/viewshipment %i)", FactionInfo[member][fName], member);
  3526. SendAdminMessage(COLOR_ORANGE, string);
  3527. SendFactionMessage(member, COLOR_ORANGE, "[NOTICE] {FFFFFF}Your faction has submitted a shipment order that requires administrative approval.");
  3528. } else {
  3529. if(GetPlayerMoneyEx(playerid) >= priceex)
  3530. {
  3531. FactionInfo[member][fWepCount] += wepcount;
  3532. FactionInfo[member][fDrugCount] += drugcount;
  3533. SaveFactionShipment(member);
  3534. GivePlayerMoneyEx(playerid, -priceex);
  3535. format(string, sizeof(string), "~r~-$%d", priceex);
  3536. GameTextForPlayer(playerid, string, 5000, 1);
  3537. SCM(playerid, COLOR_WHITE, "Shipment has been ordered!");
  3538. format(string, sizeof(string), "Estimated Time: %d minutes.", FactionInfo[member][fShipment]);
  3539. SCM(playerid, COLOR_WHITE, string);
  3540. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  3541. FactionInfo[member][fObj] = CreateDynamicObject(19606, Pos[0], Pos[1], Pos[2] + 0.05, 0.0, 0.0, 0.0, 0);
  3542. format(string, sizeof(string), "Your faction can order %d more weapons and %d more grams of drugs at this time.", (FACTION_WEAPON_LIMIT-FactionInfo[member][fWepCount]), (FACTION_DRUG_LIMIT-FactionInfo[member][fDrugCount]));
  3543. SendFactionMessage(member, COLOR_LIGHTBLUE, string);
  3544. }
  3545. else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds!"), PrintShipment(playerid);
  3546. }
  3547. }
  3548. }
  3549. }
  3550. case 92:
  3551. {
  3552. if(!response) return PrintShipment(playerid);
  3553. new member = GetPVarInt(playerid, "Member"), slot = GetPVarInt(playerid, "ShipmentSlot");
  3554.  
  3555. if(listitem == 0) {
  3556. FactionInfo[member][fShipmentID][slot]=0;
  3557. FactionInfo[member][fShipmentA][slot]=0;
  3558. } else {
  3559. new index = listitem-1;
  3560. switch(FactionInfo[member][fRights])
  3561. {
  3562. case 1:
  3563. {
  3564. FactionInfo[member][fShipmentID][slot]=FactGuns[index][0];
  3565. if(FactGuns[index][0] > 27 && FactGuns[index][0] < 33) {
  3566. SendClientMessage(playerid, COLOR_BLUE, "[TIP] {FFFFFF}Adding automatic weapons to this shipment will make it require administrative approval.");
  3567. } else if(FactGuns[index][0] == 1004) { SendClientMessage(playerid, COLOR_BLUE, "[TIP] {FFFFFF}Adding car bombs to this shipment will make it require administrative approval."); }
  3568. switch(FactGuns[index][0])
  3569. {
  3570. case 100 .. 199: { FactionInfo[member][fShipmentA][slot] = PrintIQ(FactGuns[index][0]); }
  3571. default: { FactionInfo[member][fShipmentA][slot] = 0; }
  3572. }
  3573. }
  3574. case 2:
  3575. {
  3576. FactionInfo[member][fShipmentID][slot]=FactDrug1[index][0];
  3577. FactionInfo[member][fShipmentA][slot]=1;
  3578. }
  3579. case 3:
  3580. {
  3581. FactionInfo[member][fShipmentID][slot]=FactDrug2[index][0];
  3582. FactionInfo[member][fShipmentA][slot]=1;
  3583. }
  3584. }
  3585. }
  3586. if(IsQuantityItem(FactionInfo[member][fShipmentID][slot])) {
  3587. ShowPlayerDialog(playerid, DIALOG_SHIPMENT_QUANTITY, DIALOG_STYLE_INPUT, "Enter a quantity. (1-100)", "How much of this item would you like to order?", "Enter", "Back");
  3588. } else {
  3589. new result[624];
  3590. for(new i=0; i < MAX_SHIPMENT_SLOTS; i++) {
  3591. if(FactionInfo[member][fShipmentID][i] > 0) {
  3592. if(FactionInfo[member][fShipmentA][i] > 1 || IsQuantityItem(FactionInfo[member][fShipmentID][i])) {
  3593. format(result, sizeof(result), "%s\n%s (%d)", result, PrintIName(FactionInfo[member][fShipmentID][i]), FactionInfo[member][fShipmentA][i]);
  3594. } else format(result, sizeof(result), "%s\n%s", result, PrintIName(FactionInfo[member][fShipmentID][i]));
  3595. } else format(result, sizeof(result), "%s\nEMPTY SLOT", result);
  3596. }
  3597. ShowPlayerDialog(playerid, 93, DIALOG_STYLE_LIST, "Select Slot", result, "Select", "Back");
  3598. }
  3599. }
  3600. case 93: //Shipment slot-selection.
  3601. {
  3602. if(!response) return ShowPlayerDialog(playerid, 91, DIALOG_STYLE_LIST, "Shipment Options", "Order Info\nSelect Item\nProceed", "Select", "Close");
  3603. SetPVarInt(playerid, "ShipmentSlot", listitem);
  3604. if(FactionInfo[GetPVarInt(playerid, "Member")][fShipmentID][listitem] > 0 && IsQuantityItem(FactionInfo[GetPVarInt(playerid, "Member")][fShipmentID][listitem])) {
  3605. ShowPlayerDialog(playerid, DIALOG_SHIPMENT_SLOTSELECTED, DIALOG_STYLE_LIST, "Shipment Options", "Select Item\nSelect Quantity", "Select", "Back");
  3606. } else {
  3607. ShowShipmentSelection(playerid);
  3608. }
  3609. }
  3610. case DIALOG_SHIPMENT_SLOTSELECTED:
  3611. {
  3612. if(!response) {
  3613. DeletePVar(playerid, "ShipmentSlot");
  3614. return ShowPlayerDialog(playerid, 91, DIALOG_STYLE_LIST, "Shipment Options", "Order Info\nSelect Items\nProceed", "Select", "Close");
  3615. }
  3616. if(listitem == 0) {
  3617. ShowShipmentSelection(playerid);
  3618. } else {
  3619. ShowPlayerDialog(playerid, DIALOG_SHIPMENT_QUANTITY, DIALOG_STYLE_INPUT, "Enter a quantity. (1-100)", "How much of this item would you like to order?", "Enter", "Back");
  3620. }
  3621. }
  3622. case DIALOG_SHIPMENT_QUANTITY:
  3623. {
  3624. if(!response) {
  3625. DeletePVar(playerid, "ShipmentSlot");
  3626. return ShowPlayerDialog(playerid, 91, DIALOG_STYLE_LIST, "Shipment Options", "Order Info\nSelect Items\nProceed", "Select", "Close");
  3627. }
  3628. new amt = strval(inputtext);
  3629. if(!amt || amt < 1 || amt > 100) {
  3630. SendClientMessage(playerid, COLOR_WHITE, "You can only enter a quantity between 1 and 100 for this item.");
  3631. return ShowPlayerDialog(playerid, DIALOG_SHIPMENT_QUANTITY, DIALOG_STYLE_INPUT, "Enter a quantity. (1-100)", "How much of this item would you like to order?", "Enter", "Back");
  3632. }
  3633. new member = GetPVarInt(playerid, "Member"), slot = GetPVarInt(playerid, "ShipmentSlot");
  3634. if(IsQuantityItem(FactionInfo[member][fShipmentID][slot])) { FactionInfo[member][fShipmentA][slot] = amt; }
  3635. DeletePVar(playerid, "ShipmentSlot");
  3636. new result[624];
  3637. for(new i=0; i < MAX_SHIPMENT_SLOTS; i++) {
  3638. if(FactionInfo[member][fShipmentID][i] > 0) {
  3639. if(FactionInfo[member][fShipmentA][i] > 1 || IsQuantityItem(FactionInfo[member][fShipmentID][i])) {
  3640. format(result, sizeof(result), "%s\n%s (%d)", result, PrintIName(FactionInfo[member][fShipmentID][i]), FactionInfo[member][fShipmentA][i]);
  3641. } else format(result, sizeof(result), "%s\n%s", result, PrintIName(FactionInfo[member][fShipmentID][i]));
  3642. } else format(result, sizeof(result), "%s\nEMPTY SLOT", result);
  3643. }
  3644. ShowPlayerDialog(playerid, 93, DIALOG_STYLE_LIST, "Select Slot", result, "Select", "Back");
  3645. }
  3646. case DIALOG_SHIPMENT_AVIEW:
  3647. {
  3648. if(!response) {
  3649. DeletePVar(playerid, "ShipmentAdmin");
  3650. return 1;
  3651. }
  3652. ShowPlayerDialog(playerid, DIALOG_SHIPMENT_APPROVAL, DIALOG_STYLE_MSGBOX, "Shipment Request", "Would you like to approve or deny this factions request?", "Approve", "Deny");
  3653. }
  3654. case DIALOG_SHIPMENT_APPROVAL:
  3655. {
  3656. new factionid = GetPVarInt(playerid, "ShipmentAdmin");
  3657. DeletePVar(playerid, "ShipmentAdmin");
  3658. if(ShipmentCache[factionid][sUsed] == 0) return SendClientMessage(playerid, COLOR_WHITE, "There is no longer a pending shipment request from this faction.");
  3659. if(!response) {
  3660. format(string, sizeof(string), "[NOTICE] {FFFFFF}%s has denied your factions shipment request.", AdminName(playerid));
  3661. SendFactionMessage(factionid, COLOR_ORANGE, string);
  3662. ClearShipmentCache(factionid);
  3663. } else {
  3664. if(FactionInfo[factionid][fShipment] > 0) {
  3665. SendFactionMessage(factionid, COLOR_ORANGE, "[NOTICE] {FFFFFF}Your pending faction shipment request has been cancelled since your faction is already waiting for an order to be delivered.");
  3666. ClearShipmentCache(factionid);
  3667. return 1;
  3668. }
  3669. new found = -1;
  3670. foreach(new i : Player) {
  3671. if(strcmp(PlayerName(i), ShipmentCache[factionid][sName], true) == 0) {
  3672. found = i;
  3673. break;
  3674. }
  3675. }
  3676. if(found == -1) {
  3677. SendFactionMessage(factionid, COLOR_ORANGE, "[NOTICE] {FFFFFF}Your pending faction shipment request has been cancelled as the buyer is offline.");
  3678. ClearShipmentCache(factionid);
  3679. return SendClientMessage(playerid, COLOR_ORANGE, "[NOTICE] {FFFFFF}The player who ordered the shipment is no longer online, so the shipment has been cancelled.");
  3680. }
  3681. new wepcount = ShipmentCache[factionid][sWepCount], drugcount = ShipmentCache[factionid][sDrugCount];
  3682. if((FactionInfo[factionid][fWepCount]+wepcount) > FACTION_WEAPON_LIMIT || (FactionInfo[factionid][fDrugCount]+drugcount) > FACTION_DRUG_LIMIT) {
  3683. format(string, sizeof(string), "Pending shipment cancelled. Your faction can only order %d weapons and %d grams of drugs at this time.", (FACTION_WEAPON_LIMIT-FactionInfo[factionid][fWepCount]), (FACTION_DRUG_LIMIT-FactionInfo[factionid][fDrugCount]));
  3684. SendFactionMessage(factionid, COLOR_LIGHTRED, string);
  3685. SendFactionMessage(factionid, COLOR_BLUE, "[TIP] {FFFFFF}Every hour your faction can order 1 extra gun, and 100 grams more of any/all drugs.");
  3686. return PrintShipment(playerid);
  3687. }
  3688. for(new i=0; i < MAX_SHIPMENT_SLOTS; i++) {
  3689. FactionInfo[factionid][fShipmentID][i] = ShipmentCache[factionid][sShipmentID][i];
  3690. FactionInfo[factionid][fShipmentA][i] = ShipmentCache[factionid][sShipmentA][i];
  3691. }
  3692. new priceex = ShipmentCache[factionid][sPrice];
  3693. if(GetPlayerMoneyEx(found) >= priceex) {
  3694. FactionInfo[factionid][fShipment] = ShipmentCache[factionid][sTime];
  3695. FactionInfo[factionid][fWepCount] += wepcount;
  3696. FactionInfo[factionid][fDrugCount] += drugcount;
  3697. SaveFactionShipment(factionid);
  3698. GivePlayerMoneyEx(found, -priceex);
  3699. format(string, sizeof(string), "~r~-$%d", priceex);
  3700. GameTextForPlayer(found, string, 5000, 1);
  3701. SCM(found, COLOR_WHITE, "Shipment has been ordered!");
  3702. format(string, sizeof(string), "Estimated Time: %d minutes.", FactionInfo[factionid][fShipment]);
  3703. SCM(found, COLOR_WHITE, string);
  3704. FactionInfo[factionid][fObj] = CreateDynamicObject(19606, ShipmentCache[factionid][sPosX], ShipmentCache[factionid][sPosY], ShipmentCache[factionid][sPosZ] + 0.05, 0.0, 0.0, 0.0, 0);
  3705. format(string, sizeof(string), "[NOTICE] {FFFFFF}Admin %s has approved your factions pending shipment request, and the shipment has been ordered. Estimated Time: %d minutes.", AdminName(playerid), FactionInfo[factionid][fShipment]);
  3706. SendFactionMessage(factionid, COLOR_ORANGE, string);
  3707. format(string, sizeof(string), "Your faction can order %d more weapons and %d more grams of drugs at this time.", (FACTION_WEAPON_LIMIT-FactionInfo[factionid][fWepCount]), (FACTION_DRUG_LIMIT-FactionInfo[factionid][fDrugCount]));
  3708. SendFactionMessage(factionid, COLOR_LIGHTBLUE, string);
  3709. } else {
  3710. format(string, sizeof(string), "[NOTICE] {FFFFFF}Admin %s has approved your factions pending shipment request, but the buyer couldn't afford it.", AdminName(playerid));
  3711. SendFactionMessage(factionid, COLOR_ORANGE, string);
  3712. }
  3713. ClearShipmentCache(factionid);
  3714. }
  3715. }
  3716. case 94: // CRATE OPTIONS
  3717. {
  3718. if(!response) return true;
  3719. new id = GetPVarInt(playerid, "CrateID");
  3720. switch(listitem)
  3721. {
  3722. case 0:
  3723. {
  3724. new result[1000], found;
  3725. for(new i = 0; i < MAX_SHIPMENT_SLOTS; i++)
  3726. {
  3727. if(CrateInfo[id][cInvID][i] > 0)
  3728. {
  3729. found++;
  3730. if(CrateInfo[id][cInvA][i] > 1 || IsQuantityItem(CrateInfo[id][cInvID][i])) {
  3731. format(result, 1000, "%s\n%d: %s (%d)", result, i, PrintIName(CrateInfo[id][cInvID][i]), CrateInfo[id][cInvA][i]);
  3732. } else format(result, 1000, "%s\n%d: %s", result, i, PrintIName(CrateInfo[id][cInvID][i]));
  3733. }
  3734. else
  3735. {
  3736. format(result, 1000, "%s\n%d: EMPTY SLOT", result, i);
  3737. }
  3738. }
  3739. if(found == 0) return SCM(playerid, COLOR_LIGHTRED, "This crate is empty!");
  3740. ShowPlayerDialog(playerid, 95, DIALOG_STYLE_LIST, "Crate Options", result, "Take", "Close");
  3741. }
  3742. case 1:
  3743. {
  3744. if(CrateInfo[id][cVeh] != 0) return SendClientMessage(playerid,COLOR_GREY,"This crate is currently bugged.");
  3745. new vehid = PlayerToCar(playerid,2,8.0);
  3746. if (vehid == INVALID_VEHICLE_ID) return SendClientMessage(playerid, COLOR_WHITE, "No nearby vehicle found.");
  3747. if (VehicleInfo[vehid][vType] != VEHICLE_PERSONAL) return SendClientMessage(playerid, COLOR_WHITE, "Crates can only be stored in personal vehicles.");
  3748. if (!IsTrunkCar(GetVehicleModel(vehid))) return SendClientMessage(playerid, COLOR_WHITE, "This vehicle doesn't have an appropriate trunk.");
  3749. if (VehicleInfo[vehid][vTrunk] == 0) return SendClientMessage(playerid, COLOR_GREY, "The vehicles trunk must be opened.");
  3750. new weight = 0; // max weight 300 for non-heavy carry.
  3751. for(new i = 0; i < MAX_SHIPMENT_SLOTS; i++)
  3752. {
  3753. if(CrateInfo[id][cInvID][i] > 0) {
  3754. switch(CrateInfo[id][cInvID][i]) {
  3755. case 22 .. 34: { weight += 20; }
  3756. case 100 .. 150: { weight += 10; }
  3757. case 409: { weight += 2; }
  3758. case 500 .. 550: { weight += (CrateInfo[id][cInvA][i]*1); }
  3759. case 1004: { weight += 30; }
  3760. default: { weight += 2; }
  3761. }
  3762. }
  3763. }
  3764. if(weight > 300 && !IsHeavyCar(vehid)) { //Too heavy for this car!
  3765. format(string, sizeof(string), "This vehicle can't carry more than 300lbs! (Crate weight: %dlbs.)", weight);
  3766. SendClientMessage(playerid, COLOR_WHITE, string);
  3767. }
  3768. CrateInfo[id][cVeh]=vehid;
  3769. if(IsValidDynamicObject(CrateInfo[id][cObject])) DestroyDynamicObject(CrateInfo[id][cObject]);
  3770. CrateInfo[id][cObject]=0;
  3771. DestroyDynamic3DTextLabel(CrateInfo[id][cText]);
  3772. SendClientMessage(playerid, COLOR_WHITE, "Crate stored in your vehicle, type (/v crate) to unload it.");
  3773. }
  3774. }
  3775. }
  3776. case 95:
  3777. {
  3778. if(!response) return true;
  3779. new id = GetPVarInt(playerid, "CrateID");
  3780. if(CrateInfo[id][cInvID][listitem] == 0) return true;
  3781. if(!CheckInv(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "Your inventory is currently full!");
  3782. format(string, sizeof(string), "'%s' taken!", PrintIName(CrateInfo[id][cInvID][listitem]));
  3783. SendClientMessage(playerid, COLOR_WHITE, string);
  3784. GiveInvItem(playerid, CrateInfo[id][cInvID][listitem], CrateInfo[id][cInvA][listitem], 0);
  3785. RemoveFromCrate(id, listitem);
  3786. }
  3787. case 96:
  3788. {
  3789. if(!response) return true;
  3790. switch(listitem)
  3791. {
  3792. case 0: // Radio Stations
  3793. {
  3794. new result[2048];
  3795. for(new i = 0; i < sizeof(CarRadio); i++)
  3796. {
  3797. if(i == 0) { format(result, 2048, "%s", CarRadio[i][cName]); }
  3798. else { format(result, 2048, "%s\n%s", result, CarRadio[i][cName]); }
  3799. }
  3800. ShowPlayerDialog(playerid,97,DIALOG_STYLE_LIST,"Radio Stations", result, "Select", "Go Back");
  3801. }
  3802. case 1: // Direct Link
  3803. {
  3804. ShowPlayerDialog(playerid, 98, DIALOG_STYLE_INPUT, "Direct URL", "Enter the .mp3 URL you would like to play.", "Enter", "Go Back");
  3805. }
  3806. case 2: // Turn Off
  3807. {
  3808. GameTextForPlayer(playerid, "~w~MP3~n~~r~OFF", 4000, 3);
  3809. StopAudioStreamForPlayerEx(playerid);
  3810. }
  3811. }
  3812. }
  3813. case 97:
  3814. {
  3815. if(!response) return cmd_mp3(playerid, "");
  3816. PlayAudioStreamForPlayerEx(playerid, CarRadio[listitem][cURL]);
  3817. }
  3818. case 98:
  3819. {
  3820. if(!response) return cmd_mp3(playerid, "");
  3821. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 98, DIALOG_STYLE_INPUT, "Direct URL", "Enter the .mp3 URL you would like to play.", "Enter", "Go Back");
  3822. if(strlen(inputtext) > 256) return ShowPlayerDialog(playerid, 98, DIALOG_STYLE_INPUT, "Direct URL", "Enter the .mp3 URL you would like to play.", "Enter", "Go Back");
  3823. PlayAudioStreamForPlayerEx(playerid, inputtext);
  3824. }
  3825. case 99:
  3826. {
  3827. switch(response)
  3828. {
  3829. case 0:
  3830. {
  3831. format(string,sizeof(string),"%s denied your marriage offer.",PlayerName(playerid));
  3832. SendClientMessage(GetPVarInt(playerid, "MarriagePlayer"),COLOR_WHITE,string);
  3833. DeletePVar(GetPVarInt(playerid, "MarriagePlayer"),"MarriagePlayer");
  3834. DeletePVar(playerid,"MarriagePlayer");
  3835. }
  3836. case 1:
  3837. {
  3838. strmid(PlayerInfo[playerid][pMarriedTo], PlayerName(GetPVarInt(playerid, "MarriagePlayer")), 0, strlen(PlayerName(GetPVarInt(playerid, "MarriagePlayer"))), 255);
  3839. strmid(PlayerInfo[GetPVarInt(playerid, "MarriagePlayer")][pMarriedTo], PlayerName(playerid), 0, strlen(PlayerName(playerid)), 255);
  3840. format(string,sizeof(string),"Marriage News: We have a new lovely couple, %s & %s have been married.",PlayerName(playerid),PlayerName(GetPVarInt(playerid, "MarriagePlayer")));
  3841. SendClientMessage(playerid, COLOR_WHITE,string);
  3842. SendClientMessage(GetPVarInt(playerid, "MarriagePlayer"), COLOR_WHITE,string);
  3843. DeletePVar(GetPVarInt(playerid, "MarriagePlayer"),"MarriagePlayer");
  3844. DeletePVar(playerid,"MarriagePlayer");
  3845. }
  3846. }
  3847. }
  3848. //=========//
  3849. case 100:
  3850. {
  3851. switch(response)
  3852. {
  3853. case 0: // NO
  3854. {
  3855. DeletePVar(playerid, "PDBT");
  3856. }
  3857. case 1: // YES
  3858. {
  3859. CallRemoteFunction("PurchaseItem","iiii", playerid, GetPVarInt(playerid, "PDBT"), GetPVarInt(playerid, "PDBTLI"), 1);
  3860. }
  3861. }
  3862. }
  3863. case 101: // Fire Dialog
  3864. {
  3865. switch(listitem)
  3866. {
  3867. case 0:
  3868. {
  3869. switch(GetPVarInt(playerid, "FDDUTY"))
  3870. {
  3871. case 0:
  3872. {
  3873. SetPVarInt(playerid, "FDDUTY", 1);
  3874. SetPlayerColor(playerid, 0xFF800096);
  3875. SendClientMessage(playerid, COLOR_WHITE, "You are now on fire duty!");
  3876. DeletePVar(playerid, "SubaGear");
  3877. }
  3878. case 1:
  3879. {
  3880. SetPVarInt(playerid, "FDDUTY", 0);
  3881. SetPlayerColor(playerid,0xFF8282AA);
  3882. RemovePlayerAttachedObject(playerid, HOLDOBJECT_CLOTH1);
  3883. RemovePlayerAttachedObject(playerid, HOLDOBJECT_CLOTH2);
  3884. RemovePlayerAttachedObject(playerid, HOLDOBJECT_CLOTH3);
  3885. RemovePlayerAttachedObject(playerid, HOLDOBJECT_CLOTH4);
  3886. SendClientMessage(playerid, COLOR_WHITE, "You are now off fire duty!");
  3887. DeletePVar(playerid, "SubaGear");
  3888. }
  3889. }
  3890. }
  3891. case 1:
  3892. {
  3893. if(GetPVarInt(playerid, "FDDUTY") == 0) return SendClientMessage(playerid, COLOR_GREY, "You aren't on duty!");
  3894. GiveInvItem(playerid, 42, 9999, 0);
  3895. SetPlayerAttachedObject(playerid, HOLDOBJECT_CLOTH1, 366, 1, 0.39999988, -0.33199998, -0.07199998, 102.39997863, 132.00007629, -4.30000448, 1.07200002, 1.42599999, 1.25799977);
  3896. SetPlayerAttachedObject(playerid, HOLDOBJECT_CLOTH2, 19472, 2, 0.000, 0.14700001, 0.00300004, 4.09999942, 87.90000915, 90.80001831, 0.48099988, 1.32099997, 1.07500040);
  3897. SetPlayerAttachedObject(playerid, HOLDOBJECT_CLOTH3, 19033, 2, 0.08499999, 0.05699998, 0.00099998, 81.90000152, 85.39998626, 7.69999837, 1.00500023, 1.14899992, 1.03999996);
  3898. SetPlayerAttachedObject(playerid, HOLDOBJECT_CLOTH4, 18641, 2, 0.17600002, 0.04700000, 0.08900001, 84.69998168, -5.49999904, 0.000, 0.88199973, 0.98299992, 0.79199993);
  3899. SendClientMessage(playerid, COLOR_GREY, "Fire fighter items equiped!");
  3900. DeletePVar(playerid, "SubaGear");
  3901. }
  3902. case 2:
  3903. {
  3904. if(GetPVarInt(playerid, "FDDUTY") == 0) return SendClientMessage(playerid, COLOR_GREY, "You aren't on duty!");
  3905. SetPlayerSkin(playerid, 285);
  3906. SetPlayerAttachedObject(playerid, HOLDOBJECT_CLOTH1, 19514, 2, 0.11199998, 0.01800000, 0.00600000, 0.000, 0.000, 0.000, 1.05900001, 1.03100013, 1.09200048);
  3907. SetPlayerAttachedObject(playerid, HOLDOBJECT_CLOTH2, 19515, 1, 0.08199999, 0.03599999, 0.01700007, 0.000, 0.000, 0.000, 1.02300012, 1.03900003, 1.02300000);
  3908. SetPlayerAttachedObject(playerid, HOLDOBJECT_CLOTH3, 19472, 2, 0.01000000, 0.12899997, 0.00600000, -18.59999847, 91.19998931, 102.59998321, 1.01100003, 1.14500010, 1.000);
  3909. SetPlayerAttachedObject(playerid, HOLDOBJECT_CLOTH4, 19163, 2, 0.06099998, 0.04099998, 0.00699991, -5.59999370, 93.79998779, -175.49990844, 0.92300033, 0.94700014, 0.88500010);
  3910. SendClientMessage(playerid, COLOR_GREY, "Scuba gear equiped!");
  3911. SetPVarInt(playerid, "SubaGear", 1);
  3912. }
  3913. }
  3914. }
  3915. case 102: // BIZZ Furniture AGREEMENT Dialog
  3916. {
  3917. if(!response) return true;
  3918. new keyex = FurnRight(playerid, 2);
  3919. if(keyex == -1) return true;
  3920. new cost = 250;
  3921. if(GetPVarInt(playerid, "MonthDon") > 0) { cost = 0; }
  3922. if(GetPlayerMoneyEx(playerid) >= cost)
  3923. {
  3924. if(GetPlayerInterior(playerid) == 0) {
  3925. new Float:distance = GetDistanceFromPointToPoint(PlayerInfo[playerid][pFurn][0], PlayerInfo[playerid][pFurn][1], PlayerInfo[playerid][pFurn][2], BizInfo[keyex][Xo], BizInfo[keyex][Yo], BizInfo[keyex][Zo]);
  3926. if(distance > BUSINESS_PLANT_DISTANCE) {
  3927. scm(playerid, COLOR_LIGHTRED, "WARNING: Object is too far from the business and could not be planted!");
  3928. return 1;
  3929. } else {
  3930. new found = 0;
  3931. for(new i = 0; i < sizeof(FurnObjs); i++) {
  3932. if(PlayerInfo[playerid][pFurnID] == FurnObjs[i]) {
  3933. found++;
  3934. break;
  3935. }
  3936. }
  3937. if(found == 0) {
  3938. if(GetCount() > GetPVarInt(playerid, "OutDelay")) {
  3939. format(string, sizeof(string), "AdmWarn: %s has planted objectid: %d(%s) outside of business ID: %d.", PlayerInfo[playerid][pUsername], PlayerInfo[playerid][pFurnID], GetObjName(PlayerInfo[playerid][pFurnID]), keyex);
  3940. SendAdminMessage(COLOR_YELLOW,string);
  3941. scm(playerid, COLOR_LIGHTRED, "WARNING: Abusing the outdoor objects will result in a permanent ban!");
  3942. SetPVarInt(playerid, "OutDelay", GetCount()+10000);
  3943. } else scm(playerid, COLOR_LIGHTRED, "You can only place 1 outdoor object every 10 seconds!");
  3944. }
  3945. }
  3946. }
  3947. format(string, sizeof(string),"~r~-$%d", cost);
  3948. GameTextForPlayer(playerid, string, 5000, 1);
  3949. GivePlayerMoneyEx(playerid, -cost);
  3950. BuildBizzObject(playerid, PlayerInfo[playerid][pFurnID], PlayerInfo[playerid][pFurn][0], PlayerInfo[playerid][pFurn][1], PlayerInfo[playerid][pFurn][2], PlayerInfo[playerid][pFurnR][0], PlayerInfo[playerid][pFurnR][1], PlayerInfo[playerid][pFurnR][2]);
  3951. }
  3952. else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds!");
  3953. }
  3954. case 103:
  3955. {
  3956. if(response)
  3957. {
  3958. new furnid = 0, furnitname[100];
  3959. key = FurnRight(playerid, 2);
  3960. furnitname="N/A";
  3961. for(new xe;xe<sizeof(FurnObjs);xe++)
  3962. {
  3963. if(BizInfo[key][boID][GetPVarInt(playerid, "FurnEditH")] == FurnObjs[xe])
  3964. {
  3965. format(furnitname, 100, "%d", FurnObjs[xe]);
  3966. furnid=xe;
  3967. break;
  3968. }
  3969. }
  3970. //new priceex = 100;
  3971. switch(listitem)
  3972. {
  3973. case 0: // Edit Object
  3974. {
  3975. new obj = 0, h = GetPVarInt(playerid, "FurnEditH"), key2 = FurnRight(playerid, 2);
  3976. obj = CreatePlayerObject(playerid, BizInfo[key2][boID][h], BizInfo[key2][boX][h], BizInfo[key2][boY][h], BizInfo[key2][boZ][h], BizInfo[key2][borX][h], BizInfo[key2][borY][h], BizInfo[key2][borZ][h], 100.0);
  3977. SetPVarInt(playerid, "FurnObject", obj);
  3978. SetPVarInt(playerid, "EditorMode", 4);
  3979. SetPVarInt(playerid, "Mute", 1);
  3980. PlayerInfo[playerid][pFurnID]=furnid;
  3981. EditPlayerObject(playerid, obj);
  3982. format(string, sizeof(string),"%s selected, use the SPRINT key to navigate.", furnitname);
  3983. SendClientMessage(playerid, COLOR_WHITE, string);
  3984. }
  3985. case 1: // Input Position
  3986. {
  3987. if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
  3988. ShowPlayerDialog(playerid, 541, DIALOG_STYLE_LIST, "What axis do you want to edit?", "X-pos\nY-pos\nZ-pos\nX-rotation\nY-rotation\nZ-rotation", "Continue", "Close");
  3989. }
  3990. case 2: // Select Material
  3991. {
  3992. if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
  3993. SendClientMessage(playerid,COLOR_LIGHTRED,"WARNING: Editing an invalid-layer MAY cause parts of the object to turn invisible, resetting the layers material will fix this.");
  3994. SendClientMessage(playerid,COLOR_LIGHTBLUE,"When you choose a layer to edit, that layer becomes highlighted in red.");
  3995. ShowPlayerDialog(playerid, 501, DIALOG_STYLE_LIST, "What layer do you want to edit?", "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12", "Select", "Close");
  3996. }
  3997. case 3: // Reset Material
  3998. {
  3999. if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
  4000. new h = GetPVarInt(playerid, "FurnEditH"), key2 = FurnRight(playerid, 2);
  4001. if(IsValidDynamicObject(BizInfo[key2][bObject][h])) DestroyDynamicObject(BizInfo[key2][bObject][h]);
  4002. BizInfo[key2][bObject][h] = CreateDynamicObject(BizInfo[key2][boID][h], BizInfo[key2][boX][h], BizInfo[key2][boY][h], BizInfo[key2][boZ][h], BizInfo[key2][borX][h], BizInfo[key2][borY][h], BizInfo[key2][borZ][h], key2);
  4003. Streamer_Update(playerid);
  4004. SendClientMessage(playerid,COLOR_LIGHTBLUE,"You've reset the selected objects material.");
  4005. for(new v=0; v < 13; v++) {
  4006. BizMInfo[key2][h][v] = 0;
  4007. }
  4008. SaveBizzObj(key2, h);
  4009. }
  4010. case 4: // Remove Object
  4011. {
  4012. if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
  4013. new h = GetPVarInt(playerid, "FurnEditH"), key2 = FurnRight(playerid, 2);
  4014. if(IsValidDynamicObject(BizInfo[key2][bObject][h])) DestroyDynamicObject(BizInfo[key2][bObject][h]);
  4015. BizInfo[key2][bObject][h]=0;
  4016. BizInfo[key2][boID][h]=0;
  4017. BizInfo[key2][boX][h] = 0.0;
  4018. BizInfo[key2][boY][h] = 0.0;
  4019. BizInfo[key2][boZ][h] = 0.0;
  4020. BizInfo[key2][borX][h] = 0.0;
  4021. BizInfo[key2][borY][h] = 0.0;
  4022. BizInfo[key2][borZ][h] = 0.0;
  4023. BizInfo[key2][boInt][h]--;
  4024. format(string, 128, "%s removed.", furnitname);
  4025. SendClientMessage(playerid,COLOR_WHITE,string);
  4026. SaveBizzObj(key2, h);
  4027. }
  4028. }
  4029. }
  4030. }
  4031. case 104: // TREATWOUND DIALOG
  4032. {
  4033. if(!response) return true;
  4034. new priceex = GetPVarInt(playerid,"WoundC");
  4035. if(GetPlayerMoneyEx(playerid) >= priceex)
  4036. {
  4037. PlayerPlaySound(playerid,1054, 0.0, 0.0, 0.0);
  4038. format(string, sizeof(string),"~r~-$%d",priceex);
  4039. GameTextForPlayer(playerid, string, 5000, 1);
  4040. GivePlayerMoneyEx(playerid,-priceex);
  4041. DeathPlayer(playerid, "You need to rest to heal your wounds!");
  4042. }
  4043. else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds!");
  4044. }
  4045. //====200 - 250 house system==//
  4046. //
  4047. //===========================//
  4048. case 200: //House buy dialog
  4049. {
  4050. if(!response) return true;
  4051. new foundid = 0;
  4052. for(new h = 1; h < MAX_HOUSES; h++)
  4053. {
  4054. if(HouseInfo[h][hID] != 0)
  4055. {
  4056. if(IsPlayerInRangeOfPoint(playerid, 2.0, HouseInfo[h][hXo], HouseInfo[h][hYo], HouseInfo[h][hZo]) && GetPlayerVirtualWorld(playerid) == HouseInfo[h][hVwOut])
  4057. {
  4058. if(HouseInfo[h][hOwned] == 0)
  4059. {
  4060. foundid=h;
  4061. break;
  4062. }
  4063. }
  4064. }
  4065. }
  4066. if(foundid == -1) return true;
  4067. format(string, sizeof(string), "Do you want to buy this house?\nPrice: $%d \nBank Account: $%d", HouseInfo[foundid][hBuyValue], GetPVarInt(playerid, "Bank"));
  4068. ShowPlayerDialog(playerid, 207, DIALOG_STYLE_MSGBOX, "Payment Type", string, "Buy", "Close");
  4069. }
  4070. case 201: //Business inventory
  4071. {
  4072. if(!response) return SCM(playerid, -1, "You didn't take anything from the business.");
  4073. new hid = GetPVarInt(playerid, "BizzEnter");
  4074. if(hid != 0 && GetPlayerVirtualWorld(playerid) == hid)
  4075. {
  4076. if(GetCloseBizzSafe(playerid, hid) && BizInfo[hid][sLocked] != 1)
  4077. {
  4078. new stri2[84];
  4079. if(response)
  4080. {
  4081. if(CheckInv(playerid) == 0) return error(playerid, "Your inventory is full.");
  4082. if(BizInfo[hid][InvID][listitem] == 0) return error(playerid, "Slot is empty.");
  4083. GiveInvItem(playerid, BizInfo[hid][InvID][listitem], BizInfo[hid][InvQ][listitem], BizInfo[hid][InvE][listitem], BizInfo[hid][InvS][listitem]);
  4084. format(stri2, sizeof(stri2), "You took a (%s) from the business.", PrintIName(BizInfo[hid][InvID][listitem]));
  4085. scm(playerid, -1, stri2);
  4086. format(stri2, sizeof(stri2), "takes a %s from the business.", PrintIName(BizInfo[hid][InvID][listitem]));
  4087. ForceAME(playerid, stri2);
  4088. BizInfo[hid][InvID][listitem] = 0;
  4089. BizInfo[hid][InvQ][listitem] = 0;
  4090. BizInfo[hid][InvE][listitem] = 0;
  4091. BizInfo[hid][InvS][listitem] = 0;
  4092. SaveBiz(hid);
  4093. }
  4094. }
  4095. }
  4096. }
  4097. case 202: //House inventory
  4098. {
  4099. if(!response) return SCM(playerid, -1, "You didn't take anything from the property.");
  4100. new hid = GetPVarInt(playerid, "HouseEnter");
  4101. if(hid != 0)
  4102. {
  4103. if(GetPlayerVirtualWorld(playerid) == hid)
  4104. {
  4105. if(GetCloseHouseSafe(playerid, hid) && HouseInfo[hid][sLocked] != 1)
  4106. {
  4107. new stri2[84];
  4108. if(response)
  4109. {
  4110. if(CheckInv(playerid) == 0) return error(playerid, "Your inventory is full.");
  4111. if(HouseInfo[hid][hInvID][listitem] == 0) return error(playerid, "Slot is empty.");
  4112. GiveInvItem(playerid, HouseInfo[hid][hInvID][listitem], HouseInfo[hid][hInvQ][listitem], HouseInfo[hid][hInvE][listitem], HouseInfo[hid][hInvS][listitem]);
  4113. format(stri2, sizeof(stri2), "You took a (%s) from the property.", PrintIName(HouseInfo[hid][hInvID][listitem]));
  4114. scm(playerid, -1, stri2);
  4115. format(stri2, sizeof(stri2), "takes a %s from the property.", PrintIName(HouseInfo[hid][hInvID][listitem]));
  4116. ForceAME(playerid, stri2);
  4117. HouseInfo[hid][hInvID][listitem] = 0;
  4118. HouseInfo[hid][hInvQ][listitem] = 0;
  4119. HouseInfo[hid][hInvE][listitem] = 0;
  4120. HouseInfo[hid][hInvS][listitem] = 0;
  4121. SaveHouse(hid);
  4122. }
  4123. }
  4124. }
  4125. }
  4126. }
  4127. case 203: //Vehicle inventory
  4128. {
  4129. new kez = -1, keyex = -1;
  4130. if(PlayerToCar(playerid, 1, 4.0)) {
  4131. keyex = PlayerToCar(playerid, 2, 4.0);
  4132. if(IsValidTCar(keyex)) {
  4133. kez = keyex; }
  4134. }
  4135.  
  4136. if(kez == -1) {
  4137. if(IsPoliceCar(playerid)) {
  4138. kez = GetPoliceCarID(playerid); }
  4139. }
  4140.  
  4141. if(kez == -1) return SendClientMessage(playerid, COLOR_GREY, "You are not around any valid vehicle!");
  4142. if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return scm(playerid, -1, "You must be on foot to use this!");
  4143. if(VehicleInfo[kez][vType] == VEHICLE_PERSONAL || VehicleInfo[kez][vType] == VEHICLE_LSPD)
  4144. {
  4145. new Float:xx,Float:yy,Float:zz;
  4146. GetVehiclePos(kez,xx,yy,zz);
  4147. if(IsPlayerInRangeOfPoint(playerid,10.0,xx,yy,zz))
  4148. {
  4149. new stri2[84];
  4150. if(response)
  4151. {
  4152. if(CheckInv(playerid) == 0) return error(playerid, "Your inventory is full.");
  4153. if(DisabledWeapon(GetPVarInt(playerid, "ConnectTime"), VehicleInfo[kez][vGBID][listitem])) return error(playerid, "You need 8 hours played to use take this.");
  4154. if(VehicleInfo[kez][vInvID][listitem] == 0) return error(playerid, "Slot is empty.");
  4155. if(VehicleInfo[kez][vInvID][listitem] <= 800 || VehicleInfo[kez][vInvID][listitem] >= 1002) {
  4156. GiveInvItem(playerid, VehicleInfo[kez][vInvID][listitem], VehicleInfo[kez][vInvQ][listitem], VehicleInfo[kez][vInvE][listitem], VehicleInfo[kez][vInvS][listitem]); }
  4157. format(stri2, sizeof(stri2), "You took a (%s) from your vehicle.", PrintIName(VehicleInfo[kez][vInvID][listitem]));
  4158. scm(playerid, -1, stri2);
  4159. format(stri2, sizeof(stri2), "takes a %s from the vehicle.", PrintIName(VehicleInfo[kez][vInvID][listitem]));
  4160. ForceAME(playerid, stri2);
  4161. VehicleInfo[kez][vInvID][listitem] = 0;
  4162. VehicleInfo[kez][vInvQ][listitem] = 0;
  4163. VehicleInfo[kez][vInvE][listitem] = 0;
  4164. VehicleInfo[kez][vInvS][listitem] = 0;
  4165. //LoadCarIDObjects(kez);
  4166. }
  4167. }
  4168. }
  4169. }
  4170. case 204:
  4171. {
  4172. if(!response) return 1;
  4173. if(listitem == 0)
  4174. {
  4175. PrintInv(playerid);
  4176. }
  4177. if(listitem == 1)
  4178. {
  4179. new hh = GetPVarInt(playerid, "HouseEnter");
  4180. new bh = GetPVarInt(playerid, "BizzEnter");
  4181. if(hh != 0 && GetCloseHouseSafe(playerid, hh) && HouseInfo[hh][sLocked] != 1)
  4182. {
  4183. PrintHouseInv(playerid);
  4184. }
  4185. else if(bh != 0 && GetCloseBizzSafe(playerid, bh) && BizInfo[bh][sLocked] != 1)
  4186. {
  4187. PrintBizInv(playerid);
  4188. }
  4189. else
  4190. {
  4191. if(!IsPlayerInAnyVehicle(playerid)) {
  4192. key = -1;
  4193. new keyex = -1;
  4194. if(PlayerToCar(playerid, 1, 4.0)) {
  4195. keyex = PlayerToCar(playerid, 2, 4.0);
  4196. if(IsValidTCar(keyex)) {
  4197. key = keyex; }
  4198. }
  4199. if(key == -1) {
  4200. if(IsPoliceCar(playerid)) {
  4201. key = GetPoliceCarID(playerid); }
  4202. }
  4203. if(key == -1) return 1;
  4204. if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) {
  4205. PrintVehInv(playerid, key);
  4206. }
  4207. } else {
  4208. PrintVehGB(playerid, GetPlayerVehicleID(playerid));
  4209. }
  4210. }
  4211. }
  4212. }
  4213. case 205:
  4214. {
  4215. if(!response) return 1;
  4216. new text[128];
  4217. format(text, sizeof(text), "LSPD: You took skin '%s'", LSPDskin[listitem][Name]);
  4218. if(GetPVarInt(playerid, "Rank") < LSPDskin[listitem][Rank]) return error(playerid, "You are not allowed to wear this skin.");
  4219. SetPlayerSkinEx(playerid, LSPDskin[listitem][SkinID]);
  4220. SCM(playerid, -1, text);
  4221. }
  4222. case 206:
  4223. {
  4224. if(response)
  4225. {
  4226. new pmtext[128], targetid;
  4227. GetPVarString(playerid, "APMMSG", pmtext, 128);
  4228. targetid = GetPVarInt(playerid, "APMID");
  4229. format(string, sizeof(string), "(( PM from [%d] %s: %s ))", playerid, PlayerName(playerid), pmtext);
  4230. SendClientMessage(targetid, 0xF9F900FF, string);
  4231. format(string, sizeof(string), "(( PM sent to [%d]%s: %s ))", targetid, PlayerName(targetid), pmtext);
  4232. SendClientMessage(playerid, 0xE5C43EAA, string);
  4233. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  4234. SetPVarInt(playerid, "APMWRN", 1);
  4235. }
  4236. }
  4237. case 207: // Property Buy Dialog
  4238. {
  4239. if(response) {
  4240. foreach(new h : HouseIterator) {
  4241. if(GetPVarInt(playerid, "OnRoute") != 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are currently on a route!");
  4242. if(HouseInfo[h][hID] != 0)
  4243. {
  4244. if(GetPlayerVirtualWorld(playerid) == HouseInfo[h][hVwOut] && GetPlayerInterior(playerid) == HouseInfo[h][hIntOut] && IsPlayerInRangeOfPoint(playerid, 2.0, HouseInfo[h][hXo], HouseInfo[h][hYo], HouseInfo[h][hZo]))
  4245. {
  4246. if(HouseInfo[h][hOwned] == 0)
  4247. {
  4248. if(GetPVarInt(playerid, "HouseKey") == 0)
  4249. {
  4250. if(GetPVarInt(playerid, "Bank") < HouseInfo[h][hBuyValue])
  4251. {
  4252. error(playerid, "Insufficient funds.");
  4253. }
  4254. else
  4255. {
  4256. SetPVarInt(playerid, "Bank", GetPVarInt(playerid, "Bank") - HouseInfo[h][hBuyValue]);
  4257. SendClientMessage(playerid, -1, "Congratulations on your property!");
  4258. SetPVarInt(playerid, "HouseKey", h);
  4259. HouseInfo[h][hOwned] = 1;
  4260. format(HouseInfo[h][hOwner], 25, "%s", PlayerName(playerid));
  4261. HouseInfo[h][hCombo] = 1000+random(8999);
  4262. SaveHouse(h);
  4263. OnPlayerDataSave(playerid);
  4264. return 1;
  4265. }
  4266. }
  4267. else { error(playerid, "You already own a property."); }
  4268. }
  4269. else { error(playerid, "Property not for sale."); }
  4270. }
  4271. }
  4272. }
  4273. }
  4274. }
  4275. case 280: //Toys
  4276. {
  4277. if(!response) return 1;
  4278. SetPVarInt(playerid, "ToyModelC", AttachmentObjects[listitem][attachmodel]);
  4279. ShowPlayerDialog(playerid, 294, DIALOG_STYLE_LIST, "Select bone", "Spine\nHead\nLeft Upper Arm\nRight Upper Arm\nLeft Hand\nRight Hand\nLeft Thigh\nRight Thigh\nLeft foot\nRight Foot\nRight Calf\nLeft Calf\nLeftForearm\nRight Forearm\nLeft Shoulder\nRight Shoulder\nNeck\nJaw", "Select","Cancel");
  4280. }
  4281. case 281: //MDC
  4282. {
  4283. if(!response) return 1;
  4284. switch(listitem)
  4285. {
  4286. /*case 0: ShowPlayerDialog(playerid, 282, DIALOG_STYLE_INPUT, "Mobile data computer", "Insert the name.", "Continue","Back");
  4287. case 1: ShowPlayerDialog(playerid, 287, DIALOG_STYLE_INPUT, "Mobile data computer", "Insert the vehicle plate.", "Continue","Back");*/
  4288. case 2: ShowPlayerDialog(playerid, 433, DIALOG_STYLE_INPUT, "Mobile data computer", "Insert a serial ID.", "Insert","Cancel");
  4289. /*case 3: ShowPlayerDialog(playerid, 289, DIALOG_STYLE_INPUT, "Mobile data computer", "Insert the Case ID.", "Continue","Back");
  4290. case 4:
  4291. {
  4292. if(GetPVarInt(playerid, "Member") == 1) ShowPlayerDialog(playerid, 297, DIALOG_STYLE_INPUT, "Mobile data computer", "Insert the phone number.", "Continue","Back");
  4293. else nal(playerid);
  4294. }*/
  4295. }
  4296. }
  4297. case 282: //MDC - Person
  4298. {
  4299. if(!response) return ShowPlayerDialog(playerid, 281, DIALOG_STYLE_LIST, "Mobile data computer", "Check Person\nCheck Vehicle\nCheck Serial ID\nCase ID\nTrace Phone", "Select","Close");
  4300. new input[500], query[400];
  4301. mysql_escape_string(inputtext, input); //Protecting the database.
  4302. format(MDCinfo[playerid][1][mChecking], 25, "%s", input);
  4303. format(query, sizeof(query), "SELECT `PhoneNum`, `Name`, `Sex`, `Age`, `DriveLic` `GunLic`, `HouseKey`, `BizzKey` FROM `accounts` LEFT JOIN `vehicles` ON `accounts`.`Name` = `vehicles`.`Owner` WHERE `accounts`.`Name` = '%s'", input);
  4304. mysql_function_query(handlesql, query, true, "MDCPlayer", "d", playerid);
  4305. }
  4306. case 283: //MDC - Check criminal record
  4307. {
  4308. new query[128];
  4309. if(!response) return 1;
  4310.  
  4311. switch(listitem)
  4312. {
  4313. /*case 5 .. 7: //Vehicle
  4314. {
  4315. if(MDCinfo[playerid][listitem - 4][mVID] == 0)
  4316. {
  4317. format(query, sizeof(query), "SELECT * FROM accounts WHERE Name='%s'", MDCinfo[playerid][1][mChecking]);
  4318. mysql_function_query(handlesql, query, true, "MDCPlayer", "d", playerid);
  4319. }
  4320. else
  4321. {
  4322. format(query, sizeof(query), "SELECT * FROM vehicles WHERE ID=%d", MDCinfo[playerid][listitem - 4][mVID]);
  4323. mysql_function_query(handlesql, query, true, "MDCPlayer4", "d", playerid);
  4324. }
  4325. }*/
  4326. case 11: //Criminal record
  4327. {
  4328. format(query, sizeof(query), "SELECT * FROM criminals WHERE player='%s' AND type=1 ORDER BY ID DESC", MDCinfo[playerid][1][mChecking]);
  4329. mysql_function_query(handlesql, query, true, "MDCPlayer2", "d", playerid);
  4330. }
  4331. case 12: //Ticket record
  4332. {
  4333. format(query, sizeof(query), "SELECT * FROM tickets WHERE player='%s' AND paid=0 ORDER BY ID DESC", MDCinfo[playerid][1][mChecking]);
  4334. mysql_function_query(handlesql, query, true, "MDCPlayer5", "d", playerid);
  4335. }
  4336. }
  4337. }
  4338. case 284: //MDC - Check crime in detail
  4339. {
  4340. new query[128];
  4341. if(!response)
  4342. {
  4343. format(query, sizeof(query), "SELECT * FROM accounts WHERE Name='%s'", MDCinfo[playerid][1][mChecking]);
  4344. mysql_function_query(handlesql, query, true, "MDCPlayer", "d", playerid);
  4345. }
  4346. else
  4347. {
  4348. format(query, sizeof(query), "SELECT * FROM criminals WHERE time='%e' AND type=1", MDCinfo[playerid][listitem][mTime]);
  4349. mysql_function_query(handlesql, query, true, "MDCPlayer3", "d", playerid);
  4350. }
  4351. }
  4352. case 285: //MDC - Check crime in detail (selected)
  4353. {
  4354. new query[128];
  4355. format(query, sizeof(query), "SELECT * FROM criminals WHERE player='%s' AND type=1 ORDER BY ID DESC", MDCinfo[playerid][1][mChecking]);
  4356. mysql_function_query(handlesql, query, true, "MDCPlayer2", "d", playerid);
  4357. }
  4358. case 286: //MDC - Check vehicle in detail (selected)
  4359. {
  4360. new query[128];
  4361. format(query, sizeof(query), "SELECT * FROM accounts WHERE Name='%s'", MDCinfo[playerid][1][mChecking]);
  4362. mysql_function_query(handlesql, query, true, "MDCPlayer5", "d", playerid);
  4363. }
  4364. case 287: //MDC - Vehicle
  4365. {
  4366. if(!response) return ShowPlayerDialog(playerid, 281, DIALOG_STYLE_LIST, "Mobile data computer", "Check Person\nCheck Vehicle\nCheck Serial ID\nCase ID\nTrace Phone", "Select","Close");
  4367. new input[500], query[128];
  4368. mysql_escape_string(inputtext, input); //Protecting the database.
  4369. format(MDCinfo[playerid][1][mChecking], 25, "%s", input);
  4370. format(query, sizeof(query), "SELECT * FROM vehicles WHERE Plate='%e'", input);
  4371. mysql_function_query(handlesql, query, true, "MDCVehicle", "d", playerid);
  4372. }
  4373. case 288: //MDC - Vehicle in detail from vehicle (selected)
  4374. {
  4375. ShowPlayerDialog(playerid, 287, DIALOG_STYLE_INPUT, "Mobile data computer", "Insert the vehicle plate.", "Continue","Back");
  4376. }
  4377. case 289: //MDC - Case ID
  4378. {
  4379. if(!response) return ShowPlayerDialog(playerid, 281, DIALOG_STYLE_LIST, "Mobile data computer", "Check Person\nCheck Vehicle\nCheck Serial ID\nCase ID\nTrace Phone", "Select","Close");
  4380. new input[500], query[128], inputid;
  4381. mysql_escape_string(inputtext, input); //Protecting the database.
  4382. format(MDCinfo[playerid][1][mChecking], 25, "%s", input);
  4383. inputid = strval(input);
  4384. format(query, sizeof(query), "SELECT * FROM criminals WHERE ID=%d", inputid - 900);
  4385. mysql_function_query(handlesql, query, true, "MDCCase", "d", playerid);
  4386. }
  4387. case 290: //MDC - Case in detail from case ID (selected)
  4388. {
  4389. ShowPlayerDialog(playerid, 289, DIALOG_STYLE_INPUT, "Mobile data computer", "Insert the Case ID.", "Continue","Back");
  4390. }
  4391. case 291: //MDC - Check crime in detail
  4392. {
  4393. new query[128];
  4394. if(!response)
  4395. {
  4396. format(query, sizeof(query), "SELECT * FROM accounts WHERE Name='%s'", MDCinfo[playerid][1][mChecking]);
  4397. mysql_function_query(handlesql, query, true, "MDCPlayer", "d", playerid);
  4398. }
  4399. else
  4400. {
  4401. format(query, sizeof(query), "SELECT * FROM tickets WHERE time='%e'", MDCinfo[playerid][listitem][mTime]);
  4402. mysql_function_query(handlesql, query, true, "MDCPlayer6", "d", playerid);
  4403. }
  4404. }
  4405. case 292:
  4406. {
  4407. new query[128];
  4408. format(query, sizeof(query), "SELECT * FROM tickets WHERE player='%s' ORDER BY ID DESC", MDCinfo[playerid][1][mChecking]);
  4409. mysql_function_query(handlesql, query, true, "MDCPlayer5", "d", playerid);
  4410. }
  4411. //==========================================================//
  4412. case 293: // Using /tickets
  4413. {
  4414. new query[128];
  4415. if(response)
  4416. {
  4417. format(query, sizeof(query), "SELECT * FROM tickets WHERE time='%s'", MDCinfo[playerid][listitem][mTime]);
  4418. mysql_function_query(handlesql, query, true, "GetTicketsP2", "i", playerid);
  4419. }
  4420. }
  4421. //==========================================================//
  4422. case 294: //Toys
  4423. {
  4424. if(!response) return 1;
  4425. SetPVarInt(playerid, "ToyBoneC", listitem + 1);
  4426. new countid = -1;
  4427. for(new i = 0; i < 5; i++) {
  4428. if(ToyInfo[playerid][i][tModel] == 0) {
  4429. countid = i;
  4430. break;
  4431. }
  4432. }
  4433. if(countid == -1) {
  4434. SetPVarInt(playerid, "ToyBoneC", 0);
  4435. return SendClientMessage(playerid, COLOR_RED, "No free toy slots!");
  4436. }
  4437. new modelid = GetPVarInt(playerid,"ToyModelC");
  4438. new boneid = GetPVarInt(playerid,"ToyBoneC");
  4439. SetPlayerAttachedObject(playerid, countid, modelid, boneid, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1, 1, 1);
  4440. EditAttachedObject(playerid, countid);
  4441. }
  4442. case 295: //Toys buying
  4443. {
  4444. new countid = -1;
  4445. for(new i = 0; i < 5; i++) {
  4446. if(ToyInfo[playerid][i][tModel] == 0) {
  4447. countid = i;
  4448. break;
  4449. }
  4450. }
  4451. if(countid == -1) {
  4452. SetPVarInt(playerid, "ToyBoneC", 0);
  4453. SetPVarInt(playerid, "ToyModelC", 0);
  4454. return SendClientMessage(playerid, COLOR_RED, "No free toy slots!");
  4455. }
  4456. if(!response) {
  4457. RemovePlayerAttachedObject(playerid, countid);
  4458. SetPVarInt(playerid, "ToyBoneC", 0);
  4459. SetPVarInt(playerid, "ToyModelC", 0);
  4460. } else {
  4461. if(GetPVarInt(playerid, "ToyModelC") > 0) //to avoid crashes.
  4462. {
  4463. ToyInfo[playerid][countid][tID] = countid;
  4464. ToyInfo[playerid][countid][tBone] = GetPVarInt(playerid, "ToyBoneC");
  4465. ToyInfo[playerid][countid][tModel] = GetPVarInt(playerid, "ToyModelC");
  4466. ToyInfo[playerid][countid][toX] = GetPVarFloat(playerid, "ToyoX");
  4467. ToyInfo[playerid][countid][toY] = GetPVarFloat(playerid, "ToyoY");
  4468. ToyInfo[playerid][countid][toZ] = GetPVarFloat(playerid, "ToyoZ");
  4469. ToyInfo[playerid][countid][trX] = GetPVarFloat(playerid, "ToyrX");
  4470. ToyInfo[playerid][countid][trY] = GetPVarFloat(playerid, "ToyrY");
  4471. ToyInfo[playerid][countid][trZ] = GetPVarFloat(playerid, "ToyrZ");
  4472. ToyInfo[playerid][countid][tsX] = GetPVarFloat(playerid, "ToysX");
  4473. ToyInfo[playerid][countid][tsY] = GetPVarFloat(playerid, "ToysY");
  4474. ToyInfo[playerid][countid][tsZ] = GetPVarFloat(playerid, "ToysZ");
  4475. if(IsPlayerAttachedObjectSlotUsed(playerid,countid)) {
  4476. RemovePlayerAttachedObject(playerid, countid);
  4477. }
  4478. scm(playerid, -1, "Item bought - use /items to put it on.");
  4479. new query[516];
  4480. format(query, sizeof(query), "INSERT INTO toys (`PlayerName`, `indexID`,`modelid`,`bone`) VALUES ('%s',%d,%d,%d)", PlayerName(playerid), countid, ToyInfo[playerid][countid][tModel], ToyInfo[playerid][countid][tBone]);
  4481. mysql_tquery(handlesql, query);
  4482. SaveToys(playerid);
  4483. }
  4484. }
  4485. }
  4486. case 296: //Edit/Take off/Delete items
  4487. {
  4488. if(!response) return 1;
  4489. new diatxt[255], count = 0;
  4490. for(new i = 0; i < 5; i++) {
  4491. if(ToyInfo[playerid][i][tModel] != 0) {
  4492. count++;
  4493. format(diatxt, sizeof(diatxt), "%s Slot %d: %s\n", diatxt, i,GetAttachmentName(ToyInfo[playerid][i][tModel]));
  4494. } else {
  4495. format(diatxt, sizeof(diatxt), "%s Slot %d: NONE\n", diatxt, i);
  4496. }
  4497. }
  4498. if(count == 0) { ShowPlayerDialog(playerid, 400, DIALOG_STYLE_MSGBOX, "Items", "No items found", "Close", " "); }
  4499. switch(listitem)
  4500. {
  4501. case 0: //Edit
  4502. {
  4503. ShowPlayerDialog(playerid, 401, DIALOG_STYLE_LIST, "Items", diatxt, "Select","Cancel");
  4504. }
  4505. case 1: //Edit Color
  4506. {
  4507. ShowPlayerDialog(playerid, 563, DIALOG_STYLE_LIST, "Items", diatxt, "Select","Cancel");
  4508. }
  4509. case 2: //Take off
  4510. {
  4511. ShowPlayerDialog(playerid, 402, DIALOG_STYLE_LIST, "Items", diatxt, "Select","Cancel");
  4512. }
  4513. case 3: //Put on
  4514. {
  4515. ShowPlayerDialog(playerid, 403, DIALOG_STYLE_LIST, "Items", diatxt, "Select","Cancel");
  4516. }
  4517. case 4: //Remove
  4518. {
  4519. ShowPlayerDialog(playerid, 404, DIALOG_STYLE_LIST, "Items", diatxt, "Select","Cancel");
  4520. }
  4521. }
  4522. }
  4523. case 297:
  4524. {
  4525. new found = 0;
  4526. foreach(new i : Player)
  4527. {
  4528. if(GetPVarInt(i, "PlayerLogged") == 1)
  4529. {
  4530. format(string, 128, "%d", GetPVarInt(i, "PhoneNum"));
  4531. if(strcmp(string, inputtext, true) == 0)
  4532. {
  4533. found++;
  4534. if(GetPVarInt(i, "OnPhone") > 60)
  4535. {
  4536. format(string, sizeof(string), "HQ: Officer %s requested a trace of (%d)",PlayerName(playerid), inputtext);
  4537. SendFactionMessage(1, COLOR_BLUE, string);
  4538. format(string, sizeof(string), "HQ: Location: %s",GetPlayerArea(i));
  4539. SendFactionMessage(1, COLOR_BLUE, string);
  4540. }
  4541. else return scm(playerid, COLOR_BLUE, "HQ: Sorry, number could not be localized. It hasn't been in use for sixty seconds.");
  4542. }
  4543. }
  4544. }
  4545. if(found == 0) return scm(playerid, COLOR_BLUE, "HQ: Phone Number unknown.");
  4546. }
  4547. //==========================================================//
  4548. case 300: //Bizz buy dialog
  4549. {
  4550. if(response)
  4551. {
  4552. foreach(new h : BizIterator) {
  4553. if(GetPVarInt(playerid, "OnRoute") != 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are currently on a route!");
  4554. if(BizInfo[h][ID] != 0) {
  4555. if(IsPlayerInRangeOfPoint(playerid, 2.0, BizInfo[h][Xo], BizInfo[h][Yo], BizInfo[h][Zo]))
  4556. {
  4557. if(BizInfo[h][Owned] == 0)
  4558. {
  4559. if(GetPVarInt(playerid, "BizzKey") == 0)
  4560. {
  4561. if(GetPVarInt(playerid, "Bank") < BizInfo[h][Value])
  4562. {
  4563. error(playerid, "Insufficient funds.");
  4564. }
  4565. else
  4566. {
  4567. SetPVarInt(playerid, "Bank", GetPVarInt(playerid, "Bank") - BizInfo[h][Value]);
  4568. SendClientMessage(playerid, -1, "Congratulations on your property!");
  4569. SetPVarInt(playerid, "BizzKey", h);
  4570. BizInfo[h][Owned] = 1;
  4571. format(BizInfo[h][Owner], 25, PlayerName(playerid));
  4572. BizInfo[h][Combo] = 1000+random(8999);
  4573. SaveBiz(h);
  4574. OnPlayerDataSave(playerid);
  4575. return 1;
  4576. }
  4577. }
  4578. else
  4579. {
  4580. error(playerid, "You already own a business.");
  4581. }
  4582. }
  4583. else
  4584. {
  4585. error(playerid, "Property not for sale.");
  4586. }
  4587. }
  4588. }
  4589. }
  4590. }
  4591. }
  4592. case 301:
  4593. {
  4594. if(!response) return 1;
  4595. if(strlen(inputtext) > 80) return error(playerid, "Slogan is too long.");
  4596. new bid = GetPVarInt(playerid, "BizzKey");
  4597. format(BizInfo[bid][Slogan], 80, inputtext);
  4598. scm(playerid, -1, "Slogan has been changed.");
  4599. SaveBiz(bid);
  4600. OnPlayerDataSave(playerid);
  4601. }
  4602. case 302:
  4603. {
  4604. if(!response) return 1;
  4605. if(strval(inputtext) > 100 || strval(inputtext) < 1) return error(playerid, "Invalid number.");
  4606. new bid = GetPVarInt(playerid, "BizzKey");
  4607. BizInfo[bid][EnterPrice] = strval(inputtext);
  4608. scm(playerid, -1, "Entrance Fee has been changed.");
  4609. SaveBiz(bid);
  4610. OnPlayerDataSave(playerid);
  4611. }
  4612. case 303:
  4613. {
  4614. if(!response) return 1;
  4615. if(strlen(inputtext) > 14) return error(playerid, "Name is too long.");
  4616. new slg[128], bid = GetPVarInt(playerid, "BizzKey");
  4617. mysql_escape_string(inputtext, slg);
  4618. format(BizInfo[bid][Name], 80, slg);
  4619. scm(playerid, -1, "Name has been changed.");
  4620. SaveBiz(bid);
  4621. OnPlayerDataSave(playerid);
  4622. }
  4623. case 401: //Edit item
  4624. {
  4625. if(!response) return 1;
  4626. if(ToyInfo[playerid][listitem][tModel] != 0 && IsPlayerAttachedObjectSlotUsed(playerid, listitem))
  4627. {
  4628. EditAttachedObject(playerid, listitem);
  4629. }
  4630. else
  4631. {
  4632. error(playerid, "You have no equipped item in this slot.");
  4633. }
  4634. }
  4635. case 402: //Take off item
  4636. {
  4637. if(!response) return 1;
  4638. if(ToyInfo[playerid][listitem][tModel] != 0 && IsPlayerAttachedObjectSlotUsed(playerid, listitem))
  4639. {
  4640. RemovePlayerAttachedObject(playerid, listitem);
  4641. }
  4642. else
  4643. {
  4644. error(playerid, "You have no equipped item in this slot.");
  4645. }
  4646. }
  4647. case 403: //Put on item
  4648. {
  4649. if(!response) return 1;
  4650. if(ToyInfo[playerid][listitem][tModel] == 0) return error(playerid, "You have no item in this slot.");
  4651. if(IsPlayerAttachedObjectSlotUsed(playerid, listitem) == 0)
  4652. {
  4653. if(IsValidClothing(ToyInfo[playerid][listitem][tModel]))
  4654. {
  4655. SetPlayerAttachedObject(playerid, ToyInfo[playerid][listitem][tID], ToyInfo[playerid][listitem][tModel], ToyInfo[playerid][listitem][tBone],
  4656. ToyInfo[playerid][listitem][toX],ToyInfo[playerid][listitem][toY],ToyInfo[playerid][listitem][toZ],
  4657. ToyInfo[playerid][listitem][trX],ToyInfo[playerid][listitem][trY],ToyInfo[playerid][listitem][trZ],
  4658. ToyInfo[playerid][listitem][tsX],ToyInfo[playerid][listitem][tsY],ToyInfo[playerid][listitem][tsZ],
  4659. ARGBColors[ToyInfo[playerid][listitem][tColor]][Hex], ARGBColors[ToyInfo[playerid][listitem][tColor2]][Hex]);
  4660. }
  4661. }
  4662. else
  4663. {
  4664. error(playerid, "You are already wearing this item.");
  4665. }
  4666. }
  4667. case 404: //Delete item
  4668. {
  4669. if(!response) return 1;
  4670. if(ToyInfo[playerid][listitem][tModel] != 0)
  4671. {
  4672. if(IsPlayerAttachedObjectSlotUsed(playerid, listitem))RemovePlayerAttachedObject(playerid, listitem);
  4673. new query[255];
  4674. format(query, sizeof(query), "DELETE FROM `toys` WHERE PlayerName='%s' AND indexID=%d", PlayerName(playerid), listitem);
  4675. mysql_tquery(handlesql, query);
  4676. ToyInfo[playerid][listitem][tID] = 0;
  4677. ToyInfo[playerid][listitem][tModel] = 0;
  4678. }
  4679. else
  4680. {
  4681. error(playerid, "You have no item in this slot.");
  4682. }
  4683. }
  4684. case 405:
  4685. {
  4686. if(!response) return 1;
  4687. new diatxt[1028];
  4688. if(listitem == 0) //View
  4689. {
  4690. for(new i = 0; i < 19; i++)
  4691. {
  4692. format(diatxt, sizeof(diatxt), "%s{cccccc}APB %d:{8BE0DF} %s\n", diatxt, i + 1, APB[i]);
  4693. }
  4694. ShowPlayerDialog(playerid, 406, DIALOG_STYLE_LIST, "APB", diatxt, "Close","");
  4695. }
  4696. if(listitem == 1) //Add
  4697. {
  4698. new found = 0;
  4699. for(new i = 0; i < 19; i++)
  4700. {
  4701. if(strlen(APB[i]) > 3) found++;
  4702. }
  4703. if(found < 19) ShowPlayerDialog(playerid, 407, DIALOG_STYLE_INPUT, "APB", "Enter your APB", "Add","Cancel");
  4704. else error(playerid, "No free spots.");
  4705. }
  4706. if(listitem == 2) //Remove
  4707. {
  4708. for(new i = 0; i < 19; i++)
  4709. {
  4710. format(diatxt, sizeof(diatxt), "%s{cccccc}APB %d:{8BE0DF} %s\n", diatxt, i + 1, APB[i]);
  4711. }
  4712. ShowPlayerDialog(playerid, 408, DIALOG_STYLE_LIST, "APB", diatxt, "Remove APB","Cancel");
  4713. }
  4714. }
  4715. case 407: //Add APB
  4716. {
  4717. if(!response) return 1;
  4718. if(strlen(inputtext) > 80) return error(playerid, "APB too long.");
  4719. new found = -1;
  4720. for(new i = 0; i < 19; i++)
  4721. {
  4722. if(found == -1)
  4723. {
  4724. if(strlen(APB[i]) < 3) found = i;
  4725. }
  4726. }
  4727. if(found != -1)
  4728. {
  4729. format(APB[found], 80, "%s",inputtext);
  4730. scm(playerid, -1, "APB placed!");
  4731. }
  4732. }
  4733. case 408:
  4734. {
  4735. format(APB[listitem], 80, "");
  4736. scm(playerid, -1, "APB removed!");
  4737. }
  4738. case 409: //Clothing store
  4739. {
  4740. if(!response) return 1;
  4741. if(listitem == 0) //Buy attachment
  4742. {
  4743. new countid = -1;
  4744. for(new i = 0; i < 5; i++) {
  4745. if(ToyInfo[playerid][i][tModel] == 0) {
  4746. countid = i;
  4747. break;
  4748. }
  4749. }
  4750. if(countid == -1) return error(playerid, "You have no free slots left.");
  4751. new oblist[sizeof(AttachmentObjects)];
  4752. for(new i = 0; i < sizeof(AttachmentObjects); i++)
  4753. {
  4754. oblist[i] = AttachmentObjects[i][attachmodel];
  4755. }
  4756. ShowModelSelectionMenuEx(playerid, oblist, sizeof(AttachmentObjects), "Select item", 1, 16.0, 0.0, -55.0);
  4757. }
  4758. if(listitem == 1)
  4759. {
  4760. switch(GetPVarInt(playerid,"Sex"))
  4761. {
  4762. case 1: ShowModelSelectionMenuEx(playerid, MaleSkins, sizeof(MaleSkins), "[UCP] Select skin (Male)", 5, 0.0, 0.0, 0.0);
  4763. case 2: ShowModelSelectionMenuEx(playerid, FemaleSkins, sizeof(FemaleSkins), "[UCP] Select skin (Female)", 5, 0.0, 0.0, 0.0);
  4764. default: ShowModelSelectionMenuEx(playerid, MaleSkins, sizeof(MaleSkins), "[UCP] Select skin (Male)", 5, 0.0, 0.0, 0.0);
  4765. }
  4766. }
  4767. }
  4768. case 410: //new house int
  4769. {
  4770. if(!response) return 1;
  4771. new keyh = GetPVarInt(playerid, "HouseKey");
  4772. scm(playerid, COLOR_ORANGE, "Don't forget to '/house removeall' to clean-up old house objects. This isn't automated in-case you didn't mean to change the interior.");
  4773. new count = -1;
  4774. new Houseclass = HouseInfo[keyh][hClass];
  4775. for(new i = 0; i < sizeof(HouseCor); i++)
  4776. {
  4777. if(HouseCor[i][Class] == Houseclass)
  4778. {
  4779. if(count != listitem)
  4780. {
  4781. count++;
  4782. HouseInfo[keyh][hXi] = HouseCor[i][mbX];
  4783. HouseInfo[keyh][hYi] = HouseCor[i][mbY];
  4784. HouseInfo[keyh][hZi] = HouseCor[i][mbZ];
  4785. HouseInfo[keyh][hIntIn] = HouseCor[i][Houseint];
  4786. }
  4787. }
  4788. }
  4789. scm(playerid, -1, "Interior changed.");
  4790. SaveHouse(keyh);
  4791. }
  4792. case 411: //PCR - index
  4793. {
  4794. if(!response) return 1;
  4795. if(strlen(inputtext) < 3) return error(playerid, "Invalid entry");
  4796. new name[24], query[200];
  4797. mysql_escape_string(inputtext, name);
  4798. SetPVarString(playerid, "PCR-name", name);
  4799. //ShowPlayerDialog(playerid, 412, DIALOG_STYLE_LIST, "Patient Care Report", "View record\nAdd record","Continue","Close");
  4800. format(query, sizeof(query), "SELECT * FROM pcr WHERE player='%s'", name);
  4801. mysql_function_query(handlesql, query, true, "PCRPlayer", "ii", playerid, 1);
  4802. }
  4803. case 412: //PCR - Name selected - NOT IN USE.
  4804. {
  4805. if(!response) return 1;
  4806. if(strlen(inputtext) < 3) return error(playerid, "Invalid entry");
  4807. new query[200], name[24];
  4808. GetPVarString(playerid, "PCR-name", name, 24);
  4809. switch(listitem)
  4810. {
  4811. case 0:
  4812. {
  4813. format(query, sizeof(query), "SELECT * FROM pcr WHERE player='%s'", name);
  4814. mysql_function_query(handlesql, query, true, "PCRPlayer", "ii", playerid, 1);
  4815. }
  4816. }
  4817. }
  4818. case 413: //PCR - See record
  4819. {
  4820. new query[128], name[24];
  4821. GetPVarString(playerid, "PCR-name", name, 24);
  4822. if(!response)
  4823. {
  4824. format(query, sizeof(query), "SELECT * FROM pcr WHERE player='%s'", name);
  4825. mysql_function_query(handlesql, query, true, "PCRPlayer", "ii", playerid, 1);
  4826. }
  4827. else
  4828. {
  4829. if(listitem == 0)
  4830. {
  4831. ShowPlayerDialog(playerid, 414, DIALOG_STYLE_INPUT, "Patient Care Report", "Insert a short title/summary of the file.","Continue","");
  4832. }
  4833. else
  4834. {
  4835. format(query, sizeof(query), "SELECT * FROM pcr WHERE time='%s'", MDCinfo[playerid][listitem -1][mTime]);
  4836. mysql_function_query(handlesql, query, true, "PCRPlayer", "ii", playerid,2);
  4837. }
  4838. }
  4839. }
  4840. case 414: //PCR - Insert Name
  4841. {
  4842. if(strlen(inputtext) < 3) return error(playerid, "Invalid entry");
  4843. new title[50];
  4844. mysql_escape_string(inputtext, title);
  4845. SetPVarString(playerid, "PCR-insert-title", title);
  4846. ShowPlayerDialog(playerid, 415, DIALOG_STYLE_LIST, "Patient Care Report - Select impact", "{33A0FF}Check-up\n{33FF66}Casual\n{FFCC33}Normal\n{FF0000}Severe","Continue","");
  4847. }
  4848. case 415: //PCR - Insert Severity
  4849. {
  4850. SetPVarInt(playerid, "PCR-insert-critic", listitem);
  4851. ShowPlayerDialog(playerid, 416, DIALOG_STYLE_INPUT, "Patient Care Report", "Insert the detailed text of the incident (max 400 words)","Continue","");
  4852. }
  4853. case 416: //PCR- Insert Text
  4854. {
  4855. if(strlen(inputtext) < 3) return error(playerid, "Invalid entry");
  4856. new text[400];
  4857. mysql_escape_string(inputtext, text);
  4858. SetPVarString(playerid, "PCR-insert-text", text);
  4859.  
  4860. new query[1024], year, month, day, hour, minute, second;
  4861. getdate(year, month, day);
  4862. gettime(hour,minute,second);
  4863. new datum[64], time[64];
  4864. new name[24], title[50];
  4865. GetPVarString(playerid, "PCR-name", name, 24);
  4866. GetPVarString(playerid, "PCR-insert-title", title, 50);
  4867.  
  4868. format(time, sizeof(time), "%d:%d:%d", hour, minute, second);
  4869. format(datum, sizeof(datum), "%d-%d-%d", year, month, day);
  4870. format(query, sizeof(query), "INSERT INTO `pcr`(`player`, `medic`, `date`, `time`, `text`, `title`, `critic`) VALUES ('%s','%s','%s','%s','%s','%s','%d')",
  4871. name, PlayerName(playerid), datum, time, text, title, GetPVarInt(playerid, "PCR-insert-critic"));
  4872. mysql_tquery(handlesql, query);
  4873. GetPVarString(playerid, "PCR-name", name, 24);
  4874. format(query, sizeof(query), "SELECT * FROM pcr WHERE player='%s'", name);
  4875. mysql_function_query(handlesql, query, true, "PCRPlayer", "ii", playerid, 1);
  4876.  
  4877. }
  4878. case 417: //PCR - See in detail
  4879. {
  4880. new query[128], name[24];
  4881. GetPVarString(playerid, "PCR-name", name, 24);
  4882. format(query, sizeof(query), "SELECT * FROM pcr WHERE player='%s'", name);
  4883. mysql_function_query(handlesql, query, true, "PCRPlayer", "ii", playerid, 1);
  4884. }
  4885. case 418: //Lottery
  4886. {
  4887. if(strval(inputtext) < 1 || strval(inputtext) > 500) return ShowPlayerDialog(playerid, 418, DIALOG_STYLE_INPUT, "Lottery ticket", "What number would you like your ticket to be? \nInsert any number between 1-500", "Buy","");
  4888. new number = strval(inputtext);
  4889. new query[500];
  4890. format(query, sizeof(query), "SELECT * FROM lottery WHERE Number=%d AND Active=1", number);
  4891. mysql_function_query(handlesql, query, true, "LotteryCheck", "iii", playerid, 1, number);
  4892. }
  4893. case 419: // Using /lottery
  4894. {
  4895.  
  4896. }
  4897. case 423: //Ingame UCP
  4898. {
  4899. if(!response) {
  4900. SendClientMessage(playerid, COLOR_ORANGE, "Did you know? You can use 'N' to access your inventory, or the inventory of buildings/objects.");
  4901. return 1;
  4902. }
  4903. switch(listitem)
  4904. {
  4905. case 0: ShowPlayerDialog(playerid,424,DIALOG_STYLE_LIST,"[UCP] Player Options", "Change in-game name\nChange player model\nChange player age\nChange player gender\nChange password\nChange email", "Select", "Back");
  4906. case 1: ShowPlayerDialog(playerid,80,DIALOG_STYLE_LIST,"[UCP] Settings","Select Chatstyle\nSelect Walkstyle\nToggle Private Messages\nToggle HUD\nToggle Basic Audios\nToggle Auto Reload\nMoney Bar Color\nCellphone Color\nToggle San News\nToggle RLS Radio\nToggle L-OOC Chat\nToggle Payment TD","Select", "Back");
  4907. case 2:
  4908. {
  4909. if(GetPVarInt(playerid,"Admin") < 8)
  4910. {
  4911. new mymem = GetPVarInt(playerid, "Member");
  4912. if(mymem == 0 || (GetPVarInt(playerid,"Rank") < MaxRank(mymem)))
  4913. {
  4914. SendClientMessage(playerid,COLOR_LIGHTRED,"You don't have access to Faction Management.");
  4915. }
  4916. else
  4917. {
  4918. ShowPlayerDialog(playerid,425,DIALOG_STYLE_LIST,"[UCP] Faction Options", "Faction management", "Select", "Back");
  4919. }
  4920. }
  4921. else
  4922. {
  4923. ShowPlayerDialog(playerid,425,DIALOG_STYLE_LIST,"[UCP] Faction Options", "Faction management\nCreate a faction\nDelete a Faction", "Select", "Back");
  4924. }
  4925. }
  4926. case 3: ShowPlayerDialog(playerid,427,DIALOG_STYLE_LIST,"[UCP] Staff Options", "Change staff name", "Select", "Back");
  4927. case 4:
  4928. {
  4929. if(GetPVarInt(playerid,"Admin") > 2)
  4930. {
  4931. curPopVar[playerid] = 0;
  4932. curPopVarEx[playerid] = 0;
  4933. ShowPlayerDialog(playerid,430,DIALOG_STYLE_LIST,"[UCP] Admin Options", "Ban list\nSearch ban list", "Select", "Back");
  4934. }
  4935. else
  4936. {
  4937. //ShowPlayerDialog(playerid,430,DIALOG_STYLE_LIST,"[UCP] Admin Options", "No options", "Select", "Back");
  4938. SendClientMessage(playerid,COLOR_YELLOW,"No options currently available for your admin-level.");
  4939. }
  4940. }
  4941. }
  4942. }
  4943. case 424: //UCPRelated Player Options
  4944. {
  4945. if(!response) return EnableUCP(playerid, 0);
  4946. switch(listitem)
  4947. {
  4948. case 0: //UCPRelated Change ingame name (dialogid: 426)
  4949. {
  4950. if(GetPVarInt(playerid,"UCPMode") != 1) {
  4951. ShowPlayerDialog(playerid,426,DIALOG_STYLE_INPUT,"[UCP] Choose your name","Firstname_Lastname ($10,000 or NC Ticket)","Continue", "Cancel");
  4952. } else { return SendClientMessage(playerid,COLOR_LIGHTRED,"You cannot change your name during your first use of the UCP."); }
  4953. }
  4954. case 1: //UCPRelated Change player model (dialogid: 427)
  4955. {
  4956. new myint = GetPlayerInterior(playerid);
  4957. if((myint != 1 && myint != 5 && myint != 15 && myint != 18 && myint != 14) && GetPVarInt(playerid,"UCPMode") != 1)
  4958. {
  4959. SendClientMessage(playerid, COLOR_LIGHTRED, "You must be inside a clothing store to change your clothes.");
  4960. }
  4961. else
  4962. {
  4963. switch(GetPVarInt(playerid,"Sex"))
  4964. {
  4965. case 1: ShowModelSelectionMenuEx(playerid, MaleSkins, sizeof(MaleSkins), "[UCP] Select skin (Male)", 5, 0.0, 0.0, 0.0);
  4966. case 2: ShowModelSelectionMenuEx(playerid, FemaleSkins, sizeof(FemaleSkins), "[UCP] Select skin (Female)", 5, 0.0, 0.0, 0.0);
  4967. default: ShowModelSelectionMenuEx(playerid, MaleSkins, sizeof(MaleSkins), "[UCP] Select skin (Male)", 5, 0.0, 0.0, 0.0);
  4968. }
  4969. }
  4970. }
  4971. case 2: //UCPRelated Change player age (dialogid: 428)
  4972. {
  4973. ShowPlayerDialog(playerid,428,DIALOG_STYLE_INPUT,"[UCP] Choose your age","Age must be between 10 and 110.","Continue", "Cancel");
  4974. }
  4975. case 3: //UCPRelated Change player gender (dialogid: 429)
  4976. {
  4977. ShowPlayerDialog(playerid,429,DIALOG_STYLE_LIST,"[UCP] Choose your gender", "Male\nFemale", "Select", "Cancel");
  4978. }
  4979. case 4: //UCPRelated Change player password (dialogid: 442)
  4980. {
  4981. ShowPlayerDialog(playerid,442,DIALOG_STYLE_INPUT,"[UCP] Choose a new password","Enter your new password below","Continue", "Cancel");
  4982. }
  4983. case 5: //UCPRelated Change player email (dialogid: 516)
  4984. {
  4985. ShowPlayerDialog(playerid,516,DIALOG_STYLE_INPUT,"[UCP] Choose a new email","Enter your new email below","Continue", "Cancel");
  4986. }
  4987. }
  4988. }
  4989. case 425: //UCPRelated Faction Options
  4990. {
  4991. if(!response) return EnableUCP(playerid, 0);
  4992. switch(listitem)
  4993. {
  4994. case 0: //Faction management
  4995. {
  4996. if(GetPVarInt(playerid,"Admin") < 8)
  4997. {
  4998. new mymem = GetPVarInt(playerid, "Member");
  4999. if(mymem != 1 && (GetPVarInt(playerid, "Rank") >= MaxRank(mymem)))
  5000. {
  5001. new query[64];
  5002. format(query,64,"SELECT Name FROM factions WHERE ID=%d",mymem);
  5003. mysql_function_query(handlesql,query,true,"ManageFaction","d",playerid);
  5004. }
  5005. }
  5006. else
  5007. {
  5008. mysql_function_query(handlesql,"SELECT Name FROM factions",true,"AManageFactions","d",playerid);
  5009. }
  5010. }
  5011. case 1:
  5012. {
  5013. ShowPlayerDialog(playerid,438,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 1)","What is this factions ID? (number)", "Next", "Cancel");
  5014. }
  5015. case 2: //Delete-A-Faction
  5016. {
  5017. ShowPlayerDialog(playerid, 535, DIALOG_STYLE_INPUT, "Delete a faction", "What is the ID of the faction you'd like to delete?", "Go", "Cancel");
  5018. }
  5019. }
  5020. }
  5021. case 426: //UCPRelated Change ingame name
  5022. {
  5023. if(response != 1) return 1;
  5024. if(!strlen(inputtext)) return 1;
  5025. if(strlen(inputtext) < 3 || strlen(inputtext) > 24) return SendClientMessage(playerid,COLOR_LIGHTRED,"Names must be between 3 and 24 characters long.");
  5026. if(!NameIsRP(inputtext)) return SendClientMessage(playerid,COLOR_LIGHTRED,"The name you have selected doesn't qualify as an RP name. (FORMAT: Firstname_Lastname)");
  5027. SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your request is being processed...");
  5028. SetPVarString(playerid, "NCTo", inputtext);
  5029. new query[82];
  5030. mysql_format(handlesql, query, sizeof(query), "SELECT * FROM `accounts` WHERE `Name` = '%s'", inputtext);
  5031. mysql_function_query(handlesql, query, true, "HandleNC", "i", playerid);
  5032. }
  5033. case 427: //Staff member options
  5034. {
  5035. if(!response) return EnableUCP(playerid, 0);
  5036. switch(listitem)
  5037. {
  5038. case 0: ShowPlayerDialog(playerid,431,DIALOG_STYLE_INPUT,"[UCP] Choose your staff-name","Pick your OOC staff-member name","Continue", "Cancel");
  5039. }
  5040. }
  5041. case 428: //UCPRelated Change player age
  5042. {
  5043. if(!response) {
  5044. if(GetPVarInt(playerid,"UCPMode") == 1) {
  5045. SetPVarInt(playerid, "Age", 21);
  5046. ShowPlayerDialog(playerid, 429, DIALOG_STYLE_LIST, "[UCP] Choose your gender", "Male\nFemale", "Select", "Cancel");
  5047. }
  5048. return 1;
  5049. }
  5050. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, 428, DIALOG_STYLE_INPUT,"[UCP] Choose your age","Age must be between 10 and 110.", "Continue", "Cancel");
  5051. new age = strval(inputtext);
  5052. if(age < 10 || age > 110) {
  5053. ShowPlayerDialog(playerid, 428, DIALOG_STYLE_INPUT,"[UCP] Choose your age","Age must be between 19 and 110.", "Continue", "Cancel");
  5054. return SendClientMessage(playerid, COLOR_LIGHTRED, "Your age must be between 10 and 110.");
  5055. }
  5056. SetPVarInt(playerid,"Age",age);
  5057. format(string,sizeof(string),"Your age has been set to %i.",age);
  5058. SendClientMessage(playerid, COLOR_YELLOW, string);
  5059. OnPlayerDataSave(playerid);
  5060. if(GetPVarInt(playerid,"UCPMode") == 1) { ShowPlayerDialog(playerid, 429, DIALOG_STYLE_LIST, "[UCP] Choose your gender", "Male\nFemale", "Select", "Cancel"); }
  5061. }
  5062. case 429: //UCPRelated Change player gender
  5063. {
  5064. if(!response) {
  5065. if(GetPVarInt(playerid,"UCPMode") == 1) { CallRemoteFunction("StartingUCP", "i", playerid); }
  5066. return 1;
  5067. }
  5068. switch(listitem)
  5069. {
  5070. case 0:
  5071. {
  5072. SetPVarInt(playerid, "Sex", 1);
  5073. SendClientMessage(playerid, COLOR_YELLOW, "Your gender has been set to 'Male'.");
  5074. OnPlayerDataSave(playerid);
  5075. }
  5076. case 1:
  5077. {
  5078. SetPVarInt(playerid,"Sex",2);
  5079. SendClientMessage(playerid, COLOR_YELLOW, "Your gender has been set to 'Female'.");
  5080. OnPlayerDataSave(playerid);
  5081. }
  5082. }
  5083. if(GetPVarInt(playerid,"UCPMode") == 1) { CallRemoteFunction("StartingUCP", "i", playerid); }
  5084. }
  5085. case 430: //UCPRelated Admin UCP options
  5086. {
  5087. if(!response) return EnableUCP(playerid, 0);
  5088. switch(listitem)
  5089. {
  5090. case 0:
  5091. {
  5092. mysql_tquery(handlesql,"SELECT bUsername FROM bans","PopulateBanList","i",playerid);
  5093. }
  5094. case 1: ShowPlayerDialog(playerid,437,DIALOG_STYLE_INPUT,"[UCP] Search for ban","Name or part of banned player name.","Continue", "Cancel");
  5095. default: mysql_tquery(handlesql,"SELECT bUsername FROM bans","PopulateBanList","i",playerid);
  5096. }
  5097. }
  5098. case 431: //UCPRelated Change Staff Name
  5099. {
  5100. if(response != 1) return 1;
  5101. if(!strlen(inputtext)) return 1;
  5102. if(strlen(inputtext) < 3 || strlen(inputtext) > 24) return SendClientMessage(playerid,COLOR_LIGHTRED,"Staff names must be between 3 and 24 characters long.");
  5103. new safename[25];
  5104. mysql_real_escape_string(inputtext, safename);
  5105. mysql_format(handlesql, string, sizeof(string), "SELECT NULL FROM accounts WHERE ForumName='%s'", safename);
  5106. mysql_tquery(handlesql, string, "CheckForumName", "is", playerid, inputtext);
  5107. }
  5108. case 432:
  5109. {
  5110. if(response)
  5111. {
  5112. SetPVarString(playerid,"CurBLPlayer",inputtext);
  5113. return ShowPlayerDialog(playerid,433,DIALOG_STYLE_LIST,"Ban list options","Previous page\nView ban info","Select", "Exit");
  5114. }
  5115. else
  5116. {
  5117. if(GetPVarInt(playerid,"EndOfBL") == 1) return 1;
  5118. curPopVar[playerid]++;
  5119. mysql_tquery(handlesql, "SELECT bUsername FROM bans", "PopulateBanList", "i", playerid);
  5120. }
  5121. }
  5122. case 433:
  5123. {
  5124. if(!response) return 1;
  5125. switch(listitem)
  5126. {
  5127. case 0:
  5128. {
  5129. curPopVar[playerid]--;
  5130. if(curPopVar[playerid] < 0) curPopVar[playerid] = 0;
  5131. mysql_tquery(handlesql,"SELECT bUsername FROM bans","PopulateBanList","i",playerid);
  5132. }
  5133. case 1:
  5134. {
  5135. new curBanPly[MAX_PLAYER_NAME];
  5136. GetPVarString(playerid,"CurBLPlayer",curBanPly,MAX_PLAYER_NAME);
  5137. new query[80];
  5138. format(query,80,"SELECT * FROM bans WHERE bUsername='%s'",curBanPly);
  5139. mysql_tquery(handlesql,query,"ShowBanInfo","i",playerid);
  5140. }
  5141. }
  5142. }
  5143. case 434:
  5144. {
  5145. if(response)
  5146. {
  5147. SetPVarString(playerid,"CurBLPlayer",inputtext);
  5148. return ShowPlayerDialog(playerid,435,DIALOG_STYLE_LIST,"Ban list options","Previous page\nView ban info","Select", "Exit");
  5149. }
  5150. else
  5151. {
  5152. if(GetPVarInt(playerid,"EndOfBL") == 1) return 1;
  5153. curPopVarEx[playerid]++;
  5154. new filter[128];
  5155. GetPVarString(playerid,"CurBLFilter",filter,128);
  5156. mysql_tquery(handlesql,"SELECT bUsername FROM bans","PopulateBanListEx","is",playerid,filter);
  5157. }
  5158. }
  5159. case 435:
  5160. {
  5161. if(!response) return 1;
  5162. switch(listitem)
  5163. {
  5164. case 0:
  5165. {
  5166. curPopVarEx[playerid]--;
  5167. if(curPopVarEx[playerid] < 0) curPopVarEx[playerid] = 0;
  5168. new filter[128];
  5169. GetPVarString(playerid,"CurBLFilter",filter,128);
  5170. mysql_tquery(handlesql,"SELECT bUsername FROM bans","PopulateBanListEx","is",playerid,filter);
  5171. }
  5172. case 1:
  5173. {
  5174. new curBanPly[MAX_PLAYER_NAME];
  5175. GetPVarString(playerid,"CurBLPlayer",curBanPly,MAX_PLAYER_NAME);
  5176. new query[80];
  5177. format(query,80,"SELECT * FROM bans WHERE bUsername = '%s'",curBanPly);
  5178. mysql_tquery(handlesql,query,"ShowBanInfo","i",playerid);
  5179. }
  5180. }
  5181. }
  5182. case 436:
  5183. {
  5184. if(!response) return 1;
  5185. new curBanPly[MAX_PLAYER_NAME];
  5186. GetPVarString(playerid,"CurBLPlayer",curBanPly,MAX_PLAYER_NAME);
  5187. new query[128];
  5188. format(query, sizeof(query), "DELETE FROM bans WHERE bUsername = '%s'", curBanPly);
  5189. mysql_tquery(handlesql, query);
  5190. format(string, 128, "AdmCmd: %s was un-banned by %s.", curBanPly, AdminName(playerid));
  5191. SendClientMessageToAll(COLOR_LIGHTRED, string);
  5192. format(string, sizeof(string), "[UNBAN][%s] %s", PlayerName(playerid), string);
  5193. BanLog(string);
  5194. }
  5195. case 437:
  5196. {
  5197. if(!response) return 1;
  5198. if(!strlen(inputtext)) return 1;
  5199. SetPVarString(playerid,"CurBLFilter",inputtext);
  5200. mysql_tquery(handlesql,"SELECT bUsername FROM bans","PopulateBanListEx","is",playerid,inputtext);
  5201. }
  5202. case 438: //Create-A-Faction step1 (Faction ID)
  5203. {
  5204. if(!response)
  5205. {
  5206. DeletePVar(playerid,"NewF_ID");
  5207. DeletePVar(playerid,"NewF_Name");
  5208. DeletePVar(playerid,"NewF_Ranks");
  5209. return SendClientMessage(playerid,COLOR_LIGHTRED,"Faction creation cancelled!");
  5210. }
  5211. if(!strlen(inputtext)) return ShowPlayerDialog(playerid,438,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 1)","What is this factions ID? (number)", "Next", "Cancel");
  5212. new num = strval(inputtext);
  5213. if(num < 1 || num > (MAX_FACTIONS-1)) return ShowPlayerDialog(playerid,439,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 1)","What is this factions ID? (1-49)", "Next", "Cancel");
  5214. if(FactionInfo[num][fUsed] == 1) return SendClientMessage(playerid,COLOR_LIGHTRED,"A faction with this ID already exists.");
  5215. SetPVarInt(playerid,"NewF_ID",num);
  5216. ShowPlayerDialog(playerid,439,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 2)","Pick a name for the faction.", "Next", "Go back");
  5217. }
  5218. case 439: //Create-A-Faction step2 (Pick a name)
  5219. {
  5220. if(!response) return ShowPlayerDialog(playerid,438,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 1)","What is this factions ID? (number)", "Next", "Cancel");
  5221. if(!strlen(inputtext) || strlen(inputtext) < 1) return ShowPlayerDialog(playerid,439,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 2)","Pick a name for the faction.", "Next", "Go back");
  5222. new eStr[128];
  5223. mysql_real_escape_string(inputtext, eStr);
  5224. SetPVarString(playerid,"NewF_Name",eStr);
  5225. ShowPlayerDialog(playerid,440,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 3)","What is the max-rank in this faction?(1-25)", "Next", "Go back");
  5226. }
  5227. case 440: //Create-A-Faction step3 (What is the highest rank in this faction?)
  5228. {
  5229. if(!response) return ShowPlayerDialog(playerid,439,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 2)","Pick a name for the faction.", "Next", "Go back");
  5230. if(!strlen(inputtext)) return ShowPlayerDialog(playerid,440,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 3)","What is the max-rank in this faction?(1-25)", "Next", "Go back");
  5231. new num = strval(inputtext);
  5232. if(num < 1 || num > 25) return ShowPlayerDialog(playerid,440,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 3)","What is the max-rank in this faction?(1-25)", "Next", "Go back");
  5233. SetPVarInt(playerid,"NewF_Ranks",num);
  5234. ShowPlayerDialog(playerid,441,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 4)","Does the faction have weapon/drug rights?\n(0-None/1-Guns/2-Drugs[1]/3-Drugs[2])", "Finish", "Go back");
  5235. }
  5236. case 441: //Create-A-Faction step4 (Should the faction have weapon rights?)
  5237. {
  5238. if(!response) return ShowPlayerDialog(playerid,440,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 3)","What is the max-rank in this faction?(1-25)", "Next", "Go back");
  5239. if(!strlen(inputtext)) return ShowPlayerDialog(playerid,441,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 4)","Does the faction have weapon/drug rights?\n(0-None/1-Guns/2-Drugs[1]/3-Drugs[2])", "Finish", "Go back");
  5240. new num = strval(inputtext);
  5241. if(num < 0 || num > 3) return ShowPlayerDialog(playerid,441,DIALOG_STYLE_INPUT,"Create-A-Faction (Step 4)","Does the faction have weapon/drug rights?\n(0-None/1-Guns/2-Drugs[1]/3-Drugs[2])", "Finish", "Go back");
  5242. new name[48];
  5243. GetPVarString(playerid,"NewF_Name",name,48);
  5244. CreateFaction(playerid,GetPVarInt(playerid,"NewF_ID"),name,GetPVarInt(playerid,"NewF_Ranks"),num);
  5245. }
  5246. case 442: //UCPRelated Change password
  5247. {
  5248. if(response != 1) return 1;
  5249. if(!strlen(inputtext)) return 1;
  5250. if(strlen(inputtext) < 4) return SendClientMessage(playerid,COLOR_LIGHTRED,"Your password must be at least 4 characters long.");
  5251. new newpass[128];
  5252. format(newpass,128,"%s",inputtext);
  5253. SetPVarString(playerid,"NewPass",newpass);
  5254. ShowPlayerDialog(playerid,443,DIALOG_STYLE_INPUT,"Confirm your new password","Enter the same password.", "Finish", "Cancel");
  5255. }
  5256. case 443: //UCPRelated Confirm new password
  5257. {
  5258. if(response != 1)
  5259. {
  5260. DeletePVar(playerid,"NewPass");
  5261. return 1;
  5262. }
  5263. if(!strlen(inputtext))
  5264. {
  5265. DeletePVar(playerid,"NewPass");
  5266. return 1;
  5267. }
  5268. if(strlen(inputtext) < 4)
  5269. {
  5270. DeletePVar(playerid,"NewPass");
  5271. return SendClientMessage(playerid,COLOR_LIGHTRED,"Your password must be at least 4 characters long.");
  5272. }
  5273. new newpass[128];
  5274. GetPVarString(playerid,"NewPass",newpass,128);
  5275. if(!strmatch(newpass,inputtext)) return SendClientMessage(playerid,COLOR_LIGHTRED,"The passwords you have entered do not match!");
  5276. new query[256];
  5277. SHA256_PassHash(newpass, HASH_KEY, newpass, 65);
  5278. format(query,256,"UPDATE accounts SET Pass='%s' WHERE Name='%s'",newpass,PlayerName(playerid));
  5279. mysql_tquery(handlesql, query);
  5280. format(PlayerInfo[playerid][pPass],65,"%s",newpass);
  5281. SendClientMessage(playerid, COLOR_GREEN, "Your password has been successfully changed!");
  5282. DeletePVar(playerid,"NewPass");
  5283. }
  5284. case 447:
  5285. {
  5286. if(!response) return 1;
  5287. new keyex = FurnRight(playerid, 2);
  5288. if(keyex == -1) return 1;
  5289. CallRemoteFunction("SetBizCP", "ii", playerid, keyex);
  5290. }
  5291. case 501: //What layer do you want to change? Material-editing.
  5292. {
  5293. if(!response) return 1;
  5294. SetPVarInt(playerid, "FurnEditL", listitem);
  5295. new h = GetPVarInt(playerid, "FurnEditH"), key2 = FurnRight(playerid, 2);
  5296. ChangeDynamicObjectMaterial(BizInfo[key2][bObject][h], listitem, 30);
  5297. new list[2048];
  5298. for(new i=0; i < sizeof(MaterialIDs); i++)
  5299. {
  5300. format(list,2048,"%s\n%s",list,MaterialIDs[i][Name]);
  5301. }
  5302. ShowPlayerDialog(playerid, 502, DIALOG_STYLE_LIST, "Material List", list, "Select", "Back");
  5303. }
  5304. case 502: //Object Material List
  5305. {
  5306. new h = GetPVarInt(playerid, "FurnEditH"), key2 = FurnRight(playerid, 2);
  5307. if(!response) {
  5308. if(IsValidDynamicObject(BizInfo[key2][bObject][h])) DestroyDynamicObject(BizInfo[key2][bObject][h]);
  5309. BizInfo[key2][bObject][h] = CreateDynamicObject(BizInfo[key2][boID][h], BizInfo[key2][boX][h], BizInfo[key2][boY][h], BizInfo[key2][boZ][h], BizInfo[key2][borX][h], BizInfo[key2][borY][h], BizInfo[key2][borZ][h], key2);
  5310. for( new v=0; v < 13; v++) {
  5311. if(BizMInfo[key2][h][v] != 0) {
  5312. ChangeDynamicObjectMaterial(BizInfo[key2][bObject][h], v, BizMInfo[key2][h][v]);
  5313. }
  5314. }
  5315. Streamer_Update(playerid);
  5316. DeletePVar(playerid,"FurnEditL");
  5317. return ShowPlayerDialog(playerid, 501, DIALOG_STYLE_LIST, "What layer do you want to edit?", "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12", "Select", "Close");
  5318. }
  5319. if(listitem == 0) {
  5320. BizMInfo[key2][h][GetPVarInt(playerid,"FurnEditL")] = 0;
  5321. if(IsValidDynamicObject(BizInfo[key2][bObject][h])) DestroyDynamicObject(BizInfo[key2][bObject][h]);
  5322. BizInfo[key2][bObject][h] = CreateDynamicObject(BizInfo[key2][boID][h], BizInfo[key2][boX][h], BizInfo[key2][boY][h], BizInfo[key2][boZ][h], BizInfo[key2][borX][h], BizInfo[key2][borY][h], BizInfo[key2][borZ][h], key2);
  5323. for( new v=0; v < 13; v++) {
  5324. if(BizMInfo[key2][h][v] != 0) {
  5325. ChangeDynamicObjectMaterial(BizInfo[key2][bObject][h], v, BizMInfo[key2][h][v]);
  5326. }
  5327. }
  5328. Streamer_Update(playerid);
  5329. SaveBizzObj(key2, h);
  5330. format(string, sizeof(string), "Object %d's material layer %d reset to default.",BizInfo[key2][bObject][h],GetPVarInt(playerid,"FurnEditL"));
  5331. return SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5332. }
  5333. ChangeDynamicObjectMaterial(BizInfo[key2][bObject][h], GetPVarInt(playerid,"FurnEditL"), listitem);
  5334. BizMInfo[key2][h][GetPVarInt(playerid,"FurnEditL")] = listitem;
  5335. SaveBizzObj(key2, h);
  5336. format(string, sizeof(string), "Object %d's material layer %d changed to: '%s'.",BizInfo[key2][bObject][h],GetPVarInt(playerid,"FurnEditL"),MaterialIDs[listitem][Name]);
  5337. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5338. DeletePVar(playerid,"FurnEditL");
  5339. }
  5340. case 503: //What layer do you want to change? Material-editing.
  5341. {
  5342. if(!response) return 1;
  5343. SetPVarInt(playerid, "FurnEditL", listitem);
  5344. new h = GetPVarInt(playerid, "FurnEditH"), key2 = FurnRight(playerid, 1);
  5345. ChangeDynamicObjectMaterial(HouseInfo[key2][hObject][h], listitem, 30);
  5346. new list[2048];
  5347. for(new i=0; i < sizeof(MaterialIDs); i++)
  5348. {
  5349. format(list,2048,"%s\n%s",list,MaterialIDs[i][Name]);
  5350. }
  5351. ShowPlayerDialog(playerid, 504, DIALOG_STYLE_LIST, "Material List", list, "Select", "Back");
  5352. }
  5353. case 504: //Object Material List
  5354. {
  5355. new h = GetPVarInt(playerid, "FurnEditH"), key2 = FurnRight(playerid, 1);
  5356. if(!response) {
  5357. if(IsValidDynamicObject(HouseInfo[key2][hObject][h])) DestroyDynamicObject(HouseInfo[key2][hObject][h]);
  5358. HouseInfo[key2][hObject][h] = CreateDynamicObject(HouseInfo[key2][hoID][h], HouseInfo[key2][hoX][h], HouseInfo[key2][hoY][h], HouseInfo[key2][hoZ][h], HouseInfo[key2][horX][h], HouseInfo[key2][horY][h], HouseInfo[key2][horZ][h], key2);
  5359. for( new v=0; v < 13; v++) {
  5360. if(HouseMInfo[key2][h][v] != 0) {
  5361. ChangeDynamicObjectMaterial(HouseInfo[key2][hObject][h], v, HouseMInfo[key2][h][v]);
  5362. }
  5363. }
  5364. Streamer_Update(playerid);
  5365. DeletePVar(playerid,"FurnEditL");
  5366. return ShowPlayerDialog(playerid, 503, DIALOG_STYLE_LIST, "What layer do you want to edit?", "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12", "Select", "Close");
  5367. }
  5368. if(listitem == 0) {
  5369. HouseMInfo[key2][h][GetPVarInt(playerid,"FurnEditL")] = 0;
  5370. if(IsValidDynamicObject(HouseInfo[key2][hObject][h])) DestroyDynamicObject(HouseInfo[key2][hObject][h]);
  5371. HouseInfo[key2][hObject][h] = CreateDynamicObject(HouseInfo[key2][hoID][h], HouseInfo[key2][hoX][h], HouseInfo[key2][hoY][h], HouseInfo[key2][hoZ][h], HouseInfo[key2][horX][h], HouseInfo[key2][horY][h], HouseInfo[key2][horZ][h], key2);
  5372. for( new v=0; v < 13; v++) {
  5373. if(HouseMInfo[key2][h][v] != 0) {
  5374. ChangeDynamicObjectMaterial(HouseInfo[key2][hObject][h], v, HouseMInfo[key2][h][v]);
  5375. }
  5376. }
  5377. Streamer_Update(playerid);
  5378. SaveFurnObj(key2, h);
  5379. format(string, sizeof(string), "Object %d's material layer %d reset to default.",HouseInfo[key2][hObject][h],GetPVarInt(playerid,"FurnEditL"));
  5380. return SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5381. }
  5382. ChangeDynamicObjectMaterial(HouseInfo[key2][hObject][h], GetPVarInt(playerid,"FurnEditL"), listitem);
  5383. HouseMInfo[key2][h][GetPVarInt(playerid,"FurnEditL")] = listitem;
  5384. SaveFurnObj(key2, h);
  5385. format(string, sizeof(string), "Object %d's material layer %d changed to: '%s'.",HouseInfo[key2][hObject][h],GetPVarInt(playerid,"FurnEditL"),MaterialIDs[listitem][Name]);
  5386. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5387. DeletePVar(playerid,"FurnEditL");
  5388. }
  5389. case 505:
  5390. {
  5391. if(response)
  5392. {
  5393. new found, foundid, Float:pos[3], result[500];
  5394. for(new i = 0; i < sizeof(CorpInfo); i++)
  5395. {
  5396. if(CorpInfo[i][cUsed] == 1 && found == 0)
  5397. {
  5398. if(IsPlayerInRangeOfPoint(playerid, 2.0, CorpInfo[i][cX], CorpInfo[i][cY], CorpInfo[i][cZ]))
  5399. {
  5400. found++;
  5401. foundid = i;
  5402. }
  5403. }
  5404. }
  5405. if(found == 0) return 1;
  5406. switch(listitem)
  5407. {
  5408. case 0: // Examine
  5409. {
  5410. format(result, 500, "%s\n%s", CorpInfo[foundid][cNote1], CorpInfo[foundid][cNote2]);
  5411. ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Corpse Information", result, "Close", "");
  5412. }
  5413. case 1: // Store In Vehicle
  5414. {
  5415. if(GetPVarInt(playerid, "Dead") > 0) return 1;
  5416. if(GetPVarInt(playerid, "Mute") == 1) return 1;
  5417. if(GetPVarInt(playerid, "Cuffed") != 0) return 1;
  5418. new vehicleID = PlayerToCar(playerid, 2, 4.0);
  5419. if(vehicleID == INVALID_VEHICLE_ID) return SendClientMessage(playerid, COLOR_GREY, "You aren't near any vehicles.");
  5420. if(!IsTrunkCar(GetVehicleModel(vehicleID))) return SendClientMessage(playerid, COLOR_GREY, "This vehicle doesn't have a suitable trunk!");
  5421. if(VehicleInfo[vehicleID][vTrunk] == 0) return SendClientMessage(playerid, COLOR_GREY, "The vehicles trunk must be opened.");
  5422. GetVehiclePos(vehicleID, pos[0], pos[1], pos[2]);
  5423. if(IsPlayerInRangeOfPoint(playerid, 10.0, pos[0], pos[1], pos[2]))
  5424. {
  5425. if(VehicleInfo[vehicleID][vCorp] > 0 && CorpInfo[VehicleInfo[vehicleID][vCorp]][cUsed] == 1) return scm(playerid, -1, "There's a corpse already in this vehicle!");
  5426. scm(playerid, -1, "Corpse stored in the vehicle!");
  5427. CorpInfo[foundid][cTime]=60;
  5428. CorpInfo[foundid][cVeh]=vehicleID;
  5429. VehicleInfo[vehicleID][vCorp]=foundid;
  5430. DestroyDynamic3DTextLabel(CorpInfo[foundid][cText]);
  5431. if(IsValidActor(CorpInfo[foundid][cBody])) {
  5432. DestroyActorEx(CorpInfo[foundid][cBody]);
  5433. }
  5434. }
  5435. else SendClientMessage(playerid, COLOR_GREY, "You are not around your vehicle.");
  5436. }
  5437. case 2: // Corpse removed
  5438. {
  5439. RemoveCorpse(foundid);
  5440. scm(playerid, -1, "Corpse discarded.");
  5441. }
  5442. }
  5443. }
  5444. }
  5445. case 506:
  5446. {
  5447. if(!response) return 1;
  5448. if(!IsNumeric(inputtext)) return scm(playerid,-1,"Safe-combos are numeric. (4-digits)");
  5449. new combo = strval(inputtext);
  5450. if(combo < 1000 || combo > 9999) return scm(playerid,-1,"Safe-combos are 4 digits long.");
  5451. new id = GetPVarInt(playerid,"HouseEnter");
  5452. if(HouseInfo[id][hCombo] == combo) {
  5453. HouseInfo[id][sLocked] = 0;
  5454. scm(playerid,COLOR_ORANGE,"House safe(s) unlocked!");
  5455. SaveHouse(id);
  5456. format(string, sizeof(string), "%s tried to open house-safe #%i with the combination %i and succeeded.", PlayerName(playerid), id, inputtext);
  5457. SafeLog(string);
  5458. } else {
  5459. SendMessageByName(HouseInfo[id][hOwner],COLOR_BLUE,"[Safe-Alert] Someone has entered an incorrect combination for your house-safe.");
  5460. format(string, sizeof(string), "%s tried to open house-safe #%i with the combination %i and failed.", PlayerName(playerid), id, inputtext);
  5461. SafeLog(string);
  5462. }
  5463. }
  5464. case 507:
  5465. {
  5466. if(!response) return 1;
  5467. if(!IsNumeric(inputtext)) return scm(playerid,-1,"Safe-combos are numeric. (4-digits)");
  5468. new combo = strval(inputtext);
  5469. if(combo < 1000 || combo > 9999) return scm(playerid,-1,"Safe-combos are 4 digits long.");
  5470. new id = GetPVarInt(playerid,"BizzEnter");
  5471. if(BizInfo[id][Combo] == combo) {
  5472. BizInfo[id][sLocked] = 0;
  5473. scm(playerid,COLOR_ORANGE,"Business safe(s) unlocked!");
  5474. SaveBiz(id);
  5475. format(string, sizeof(string), "%s tried to open business-safe #%i with the combination %i and succeeded.", PlayerName(playerid), id, inputtext);
  5476. SafeLog(string);
  5477. } else {
  5478. SendMessageByName(BizInfo[id][Owner],COLOR_BLUE,"[Safe-Alert] Someone has entered an incorrect combination for your business-safe.");
  5479. format(string, sizeof(string), "%s tried to open business-safe #%i with the combination %i and failed.", PlayerName(playerid), id, inputtext);
  5480. SafeLog(string);
  5481. }
  5482. }
  5483. case 508:
  5484. {
  5485. new mtg = GetPVarInt(playerid, "MarriagePlayer"), result[256];
  5486. DeletePVar(playerid,"MarriagePlayer");
  5487. switch(response)
  5488. {
  5489. case 0:
  5490. {
  5491. format(string,sizeof(string),"%s denied your marriage offer.", PlayerName(playerid));
  5492. SendClientMessage(mtg, COLOR_WHITE, string);
  5493. DeletePVar(mtg, "MarriagePlayer");
  5494. }
  5495. case 1:
  5496. {
  5497. strmid(PlayerInfo[playerid][pMarriedTo], PlayerName(mtg), 0, strlen(PlayerName(mtg)), 255);
  5498. strmid(PlayerInfo[mtg][pMarriedTo], PlayerName(playerid), 0, strlen(PlayerName(playerid)), 255);
  5499. if(GetPVarInt(playerid, "Sex") == GetPVarInt(mtg, "Sex")) {
  5500. format(result, 256,"(( Marriage News: We have a new lovely gay couple, %s & %s have been legally married. ))", PlayerName(playerid), PlayerName(mtg));
  5501. } else {
  5502. format(result, 256,"(( Marriage News: We have a new lovely couple, %s & %s have been married. ))", PlayerName(playerid), PlayerName(mtg)); }
  5503. SendClientMessageToAll(-1, result);
  5504. DeletePVar(mtg,"MarriagePlayer");
  5505. GivePlayerMoneyEx(playerid,-20000);
  5506. scm(playerid,COLOR_GREY,"You've spent $20,000 on your wedding.");
  5507. OnPlayerDataSave(playerid);
  5508. OnPlayerDataSave(mtg);
  5509. }
  5510. }
  5511. }
  5512. case 509:
  5513. {
  5514. if(!response) // RETURN TO MENU
  5515. {
  5516. DeletePVar(playerid, "RimID");
  5517. SetPVarInt(playerid, "VEHSEC", 0);
  5518. CallRemoteFunction("VehMod", "i", playerid);
  5519. return 1;
  5520. }
  5521. new id = GetPVarInt(playerid, "RimID");
  5522. new rcost;
  5523. if(GetPVarInt(playerid, "DonateRank") == 0) {
  5524. rcost = Components[id][cPrice];
  5525. format(string, sizeof(string), "You've bought '%s' rims for $%d.", Components[id][cName], rcost);
  5526. }
  5527. else {
  5528. rcost = 0;
  5529. format(string, sizeof(string), "You've bought '%s' rims. They were free because you are a donor.", Components[id][cName]);
  5530. }
  5531. if(GetPlayerMoneyEx(playerid) < rcost) {
  5532. DeletePVar(playerid, "RimID");
  5533. SetPVarInt(playerid, "VEHSEC", 0);
  5534. CallRemoteFunction("VehMod", "i", playerid);
  5535. return scm(playerid, COLOR_GREY, "You can't afford these rims.");
  5536. }
  5537. new keyex = GetPlayerVehicleID(playerid);
  5538. AddVehicleComponent(keyex, Components[id][cID]);
  5539. AddVehMod(keyex, Components[id][cID]);
  5540. CallRemoteFunction("VehMod", "i", playerid);
  5541. new query[300];
  5542. mysql_format(handlesql, query, sizeof(query), "UPDATE `vehicles` SET `Mod1` = %i, `Mod2` = %i, `Mod3` = %i, `Mod4` = %i, `Mod5` = %i, `Mod6` = %i, `Mod7` = %i, \
  5543. `Mod8` = %i, `Mod9` = %i, `Mod10` = %i, `Mod11` = %i WHERE `ID` = %i;",
  5544. VehicleInfo[keyex][vMod][0], VehicleInfo[keyex][vMod][1], VehicleInfo[keyex][vMod][2], VehicleInfo[keyex][vMod][3], VehicleInfo[keyex][vMod][4], VehicleInfo[keyex][vMod][5],
  5545. VehicleInfo[keyex][vMod][6], VehicleInfo[keyex][vMod][7], VehicleInfo[keyex][vMod][8], VehicleInfo[keyex][vMod][9], VehicleInfo[keyex][vMod][10], VehicleInfo[keyex][vID]);
  5546. mysql_tquery(handlesql, query);
  5547. GivePlayerMoneyEx(playerid, -rcost);
  5548. PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
  5549. scm(playerid, -1, string);
  5550. DeletePVar(playerid, "RimID");
  5551. }
  5552. case 510: // Application list
  5553. {
  5554. if(!response) return 1;
  5555. SetPVarString(playerid, "ReviewName", inputtext);
  5556. format(string, sizeof(string), "You are currently viewing %s's application.", inputtext);
  5557. scm(playerid, -1, string);
  5558. ShowPlayerDialog(playerid, 511, DIALOG_STYLE_LIST, "Options", "Approve Player\nDeny Player\nView Application", "Select", "Exit");
  5559. }
  5560. case 511: // View/Accept/Deny/
  5561. {
  5562. if(GetPVarInt(playerid, "Delay") > GetCount()) return scm(playerid, COLOR_WHITE, "Please try again - spam prevention stopped your last action.");
  5563. new query[128];
  5564. if(!response) {
  5565. DeletePVar(playerid, "ReviewName");
  5566. mysql_format(handlesql, query, sizeof(query), "SELECT `Name` FROM applications");
  5567. mysql_tquery(handlesql, query, "PopulateAppMenu", "i", playerid);
  5568. return 1;
  5569. }
  5570. switch(listitem)
  5571. {
  5572. case 0: //Approve app
  5573. {
  5574. new name[25];
  5575. GetPVarString(playerid, "ReviewName", name, sizeof(name));
  5576. mysql_format(handlesql, query, sizeof(query), "SELECT `Pass` FROM applications WHERE `Name`='%s'", name);
  5577. mysql_tquery(handlesql, query, "OnPlayerRegister", "s", name);
  5578. DeletePVar(playerid, "ReviewName");
  5579. format(string, sizeof(string), "AdmCmd: %s approved player %s.", PlayerName(playerid), name);
  5580. SendAdminAndRegMessage(COLOR_LIGHTRED,string);
  5581. RegLog(string);
  5582. }
  5583. case 1: //Deny app
  5584. {
  5585. new name[25];
  5586. GetPVarString(playerid, "ReviewName", name, sizeof(name));
  5587. mysql_format(handlesql, query, sizeof(query), "DELETE FROM applications WHERE `Name`='%s'",name);
  5588. mysql_tquery(handlesql, query);
  5589. DeletePVar(playerid, "ReviewName");
  5590. format(string, sizeof(string), "AdmCmd: %s denied player %s.", PlayerName(playerid), name);
  5591. SendAdminAndRegMessage(COLOR_LIGHTRED,string);
  5592. RegLog(string);
  5593. new targetid = FindPlayer(name);
  5594. if(targetid != -1) {
  5595. scm(targetid, COLOR_RED, "Your application has been denied, please read the rules posted on www.diverseroleplay.org and try again.");
  5596. Kick(targetid);
  5597. }
  5598. }
  5599. case 2: //View app
  5600. {
  5601. new name[25];
  5602. GetPVarString(playerid, "ReviewName", name, sizeof(name));
  5603. SetPVarInt(playerid, "AppPage", 0);
  5604. mysql_format(handlesql, query, sizeof(query), "SELECT * FROM applications WHERE `Name`='%s'", name);
  5605. mysql_tquery(handlesql, query, "ViewAppInfo", "is", playerid, name);
  5606. }
  5607. }
  5608. SetPVarInt(playerid, "Delay", GetCount()+500);
  5609. }
  5610. case 512: // Currently viewing an app
  5611. {
  5612. if(!response) {
  5613. DeletePVar(playerid, "AppPage");
  5614. return ShowPlayerDialog(playerid, 511, DIALOG_STYLE_LIST, "Options", "Approve Player\nDeny Player\nView Application", "Select", "Exit");
  5615. }
  5616. new name[25];
  5617. GetPVarString(playerid, "ReviewName", name, sizeof(name));
  5618. switch(GetPVarInt(playerid, "AppPage"))
  5619. {
  5620. case 0:
  5621. {
  5622. SetPVarInt(playerid, "AppPage", 1);
  5623. }
  5624. case 1:
  5625. {
  5626. SetPVarInt(playerid, "AppPage", 2);
  5627. }
  5628. case 2:
  5629. {
  5630. SetPVarInt(playerid, "AppPage", 0);
  5631. }
  5632. }
  5633. new query[72];
  5634. mysql_format(handlesql, query, sizeof(query), "SELECT * FROM applications WHERE `Name`='%s'", name);
  5635. mysql_tquery(handlesql, query, "ViewAppInfo", "is", playerid, name);
  5636. }
  5637. case 513: // Your application info
  5638. {
  5639. if(GetPVarInt(playerid, "AccountExist") == 1) return 1;
  5640. if(GetPVarInt(playerid, "Delay") > GetCount()) return ShowPlayerDialog(playerid, 513, DIALOG_STYLE_MSGBOX, "Spam prevention", "You can only 'Refresh' this dialog once every 5 seconds.", "Refresh", "");
  5641. new query[100];
  5642. mysql_format(handlesql, query, sizeof(query), "SELECT `Time` FROM applications WHERE `Name`='%s'", PlayerName(playerid));
  5643. mysql_tquery(handlesql, query, "RefreshAppStatus", "i", playerid);
  5644. SetPVarInt(playerid, "Delay", GetCount()+5000);
  5645. }
  5646. case 514: // Bare switch are you sure check.
  5647. {
  5648. if(!response) return 1;
  5649. CallRemoteFunction("DoBareSwitch","i",playerid);
  5650. }
  5651. case 515:
  5652. {
  5653. if(!response) {
  5654. DeletePVar(playerid, "ABizEdit");
  5655. return 1;
  5656. }
  5657. new keyex = GetPVarInt(playerid, "ABizEdit");
  5658. if(keyex == 0) return 1;
  5659. CallRemoteFunction("SetBizCP", "ii", playerid, keyex);
  5660. DeletePVar(playerid, "ABizEdit");
  5661. }
  5662. case 516: //UCPRelated Change email
  5663. {
  5664. if(!response) {
  5665. if(GetPVarInt(playerid,"UCPMode") == 1) {
  5666. ShowPlayerDialog(playerid, 428, DIALOG_STYLE_INPUT,"[UCP] Choose your age","Age must be between 10 and 110.", "Continue", "Cancel");
  5667. SendClientMessage(playerid, COLOR_BLUE, "[TIP] {FFFFFF}For password recovery reasons, please set your email by going to: '/ucp -> Player Options -> Change email'.");
  5668. }
  5669. return 1;
  5670. }
  5671. if(!strlen(inputtext) || strlen(inputtext) > 54)
  5672. {
  5673. SendClientMessage(playerid, COLOR_WHITE, "Email is too long (54 Chars max).");
  5674. ShowPlayerDialog(playerid,516,DIALOG_STYLE_INPUT,"[UCP] Choose a new email","Enter your new email below","Continue", "Cancel");
  5675. return 1;
  5676. }
  5677. new newemail[54],query[256];
  5678. mysql_real_escape_string(inputtext, newemail);
  5679. mysql_format(handlesql, query, sizeof(query), "UPDATE accounts SET `email`='%s' WHERE Name='%s'", newemail, PlayerName(playerid));
  5680. mysql_tquery(handlesql, query);
  5681. format(string, sizeof(string), "Your email has been successfully changed to: %s.", inputtext);
  5682. SendClientMessage(playerid, COLOR_GREEN, string);
  5683. SendClientMessageEx(playerid, COLOR_BLUE, "[TIP] {FFFFFF}Please make sure the email you entered was valid, for password recovery purposes. If it wasn't you can change it by going to: '/ucp -> Player Options -> Change email' at any time.");
  5684. if(GetPVarInt(playerid,"UCPMode") == 1) { ShowPlayerDialog(playerid, 428, DIALOG_STYLE_INPUT,"[UCP] Choose your age","Age must be between 10 and 110.", "Continue", "Cancel"); }
  5685. }
  5686. case 517:
  5687. {
  5688. if(!response) {
  5689. DeletePVar(playerid, "MapperRemove");
  5690. return 1;
  5691. }
  5692. new text[24];
  5693. GetPVarString(playerid, "MapperRemove", text, 24);
  5694. RemoveMapObject(text);
  5695. format(string, sizeof(string), "You've removed all of %s's mapping.", text);
  5696. SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
  5697. DeletePVar(playerid, "MapperRemove");
  5698. }
  5699. case 518: // Map Furniture AGREEMENT Dialog
  5700. {
  5701. if(!response) return true;
  5702. BuildMapObject(playerid, PlayerInfo[playerid][pFurnID], PlayerInfo[playerid][pFurn][0], PlayerInfo[playerid][pFurn][1], PlayerInfo[playerid][pFurn][2], PlayerInfo[playerid][pFurnR][0], PlayerInfo[playerid][pFurnR][1], PlayerInfo[playerid][pFurnR][2]);
  5703. }
  5704. case 519:
  5705. {
  5706. if(response)
  5707. {
  5708. new furnid = 0, furnitname[100];
  5709. furnitname="N/A";
  5710. for(new xe;xe<sizeof(FurnObjs);xe++)
  5711. {
  5712. if(MapInfo[GetPVarInt(playerid, "FurnEditH")][mID] == FurnObjs[xe])
  5713. {
  5714. format(furnitname, 100, "%d", FurnObjs[xe]);
  5715. furnid=xe;
  5716. break;
  5717. }
  5718. }
  5719. switch(listitem)
  5720. {
  5721. case 0: // Edit Object
  5722. {
  5723. new obj = 0, h = GetPVarInt(playerid, "FurnEditH");
  5724. obj = CreatePlayerObject(playerid, MapInfo[h][mID], MapInfo[h][mX], MapInfo[h][mY], MapInfo[h][mZ], MapInfo[h][mrX], MapInfo[h][mrY], MapInfo[h][mrZ], 100.0);
  5725. SetPVarInt(playerid, "FurnObject", obj);
  5726. SetPVarInt(playerid, "EditorMode", 7);
  5727. PlayerInfo[playerid][pFurnID]=furnid;
  5728. Streamer_Update(playerid);
  5729. EditPlayerObject(playerid, obj);
  5730. format(string, sizeof(string),"%s selected, use the SPRINT key to navigate.", furnitname);
  5731. SendClientMessage(playerid, COLOR_WHITE, string);
  5732. }
  5733. case 1: // Input Position
  5734. {
  5735. if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
  5736. ShowPlayerDialog(playerid, 533, DIALOG_STYLE_LIST, "What axis do you want to edit?", "X-pos\nY-pos\nZ-pos\nX-rotation\nY-rotation\nZ-rotation", "Continue", "Close");
  5737. }
  5738. case 2: // Select Material
  5739. {
  5740. if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
  5741. SendClientMessage(playerid,COLOR_LIGHTRED,"WARNING: Editing an invalid-layer MAY cause parts of the object to turn invisible, resetting the layers material will fix this.");
  5742. SendClientMessage(playerid,COLOR_LIGHTBLUE,"When you choose a layer to edit, that layer becomes highlighted in red.");
  5743. ShowPlayerDialog(playerid, 520, DIALOG_STYLE_LIST, "What layer do you want to edit?", "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12", "Select", "Close");
  5744. }
  5745. case 3: // Reset Material
  5746. {
  5747. if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
  5748. new h = GetPVarInt(playerid, "FurnEditH");
  5749. if(IsValidDynamicObject(MapInfo[h][mObject])) DestroyDynamicObject(MapInfo[h][mObject]);
  5750. MapInfo[h][mObject] = CreateDynamicObject(MapInfo[h][mID], MapInfo[h][mX], MapInfo[h][mY], MapInfo[h][mZ], MapInfo[h][mrX], MapInfo[h][mrY], MapInfo[h][mrZ], MapInfo[h][mVW]);
  5751. Streamer_Update(playerid);
  5752. SendClientMessage(playerid,COLOR_LIGHTBLUE,"You've reset the selected objects material.");
  5753. for(new v=0; v < 13; v++) {
  5754. MapMInfo[h][v] = 0;
  5755. }
  5756. SaveMapObj(h);
  5757. }
  5758. case 4: // Remove Object
  5759. {
  5760. if (GetPVarInt(playerid, "PlayerLogged") != 1) return true;
  5761. new h = GetPVarInt(playerid, "FurnEditH");
  5762. if(IsValidDynamicObject(MapInfo[h][mObject])) DestroyDynamicObject(MapInfo[h][mObject]);
  5763. MapInfo[h][mObject]=0;
  5764. MapInfo[h][mID]=0;
  5765. MapInfo[h][mX] = 0.0;
  5766. MapInfo[h][mY] = 0.0;
  5767. MapInfo[h][mZ] = 0.0;
  5768. MapInfo[h][mrX] = 0.0;
  5769. MapInfo[h][mrY] = 0.0;
  5770. MapInfo[h][mrZ] = 0.0;
  5771. MapInfo[h][mInt] = 0;
  5772. MapInfo[h][mVW] = 0;
  5773. mysql_format(handlesql, string, sizeof(string), "DELETE FROM `mapfurn` WHERE `ID`=%d", MapInfo[h][mDBID]);
  5774. mysql_tquery(handlesql, string);
  5775. }
  5776. }
  5777. }
  5778. }
  5779. case 520: //What layer do you want to change? Material-editing.
  5780. {
  5781. if(!response) return 1;
  5782. SetPVarInt(playerid, "FurnEditL", listitem);
  5783. new h = GetPVarInt(playerid, "FurnEditH");
  5784. ChangeDynamicObjectMaterial(MapInfo[h][mObject], listitem, 30);
  5785. new list[2048];
  5786. for(new i=0; i < sizeof(MaterialIDs); i++)
  5787. {
  5788. format(list,2048,"%s\n%s",list,MaterialIDs[i][Name]);
  5789. }
  5790. ShowPlayerDialog(playerid, 521, DIALOG_STYLE_LIST, "Material List", list, "Select", "Back");
  5791. }
  5792. case 521: //Object Material List
  5793. {
  5794. new h = GetPVarInt(playerid, "FurnEditH");
  5795. if(!response) {
  5796. if(IsValidDynamicObject(MapInfo[h][mObject])) DestroyDynamicObject(MapInfo[h][mObject]);
  5797. MapInfo[h][mObject] = CreateDynamicObject(MapInfo[h][mID], MapInfo[h][mX], MapInfo[h][mY], MapInfo[h][mZ], MapInfo[h][mrX], MapInfo[h][mrY], MapInfo[h][mrZ], MapInfo[h][mVW]);
  5798. for( new v=0; v < 13; v++) {
  5799. if(MapMInfo[h][v] != 0) {
  5800. ChangeDynamicObjectMaterial(MapInfo[h][mObject], v, MapMInfo[h][v]);
  5801. }
  5802. }
  5803. Streamer_Update(playerid);
  5804. DeletePVar(playerid,"FurnEditL");
  5805. return ShowPlayerDialog(playerid, 520, DIALOG_STYLE_LIST, "What layer do you want to edit?", "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12", "Select", "Close");
  5806. }
  5807. if(listitem == 0) {
  5808. MapMInfo[h][GetPVarInt(playerid,"FurnEditL")] = 0;
  5809. if(IsValidDynamicObject(MapInfo[h][mObject])) DestroyDynamicObject(MapInfo[h][mObject]);
  5810. MapInfo[h][mObject] = CreateDynamicObject(MapInfo[h][mID], MapInfo[h][mX], MapInfo[h][mY], MapInfo[h][mZ], MapInfo[h][mrX], MapInfo[h][mrY], MapInfo[h][mrZ], MapInfo[h][mVW]);
  5811. for( new v=0; v < 13; v++) {
  5812. if(MapMInfo[h][v] != 0) {
  5813. ChangeDynamicObjectMaterial(MapInfo[h][mObject], v, MapMInfo[h][v]);
  5814. }
  5815. }
  5816. Streamer_Update(playerid);
  5817. SaveMapObj(h);
  5818. format(string, sizeof(string), "Object %d's material layer %d reset to default.",MapInfo[h][mObject],GetPVarInt(playerid,"FurnEditL"));
  5819. return SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5820. }
  5821. ChangeDynamicObjectMaterial(MapInfo[h][mObject], GetPVarInt(playerid,"FurnEditL"), listitem);
  5822. MapMInfo[h][GetPVarInt(playerid,"FurnEditL")] = listitem;
  5823. SaveMapObj(h);
  5824. format(string, sizeof(string), "Object %d's material layer %d changed to: '%s'.",MapInfo[h][mObject],GetPVarInt(playerid,"FurnEditL"),MaterialIDs[listitem][Name]);
  5825. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  5826. DeletePVar(playerid,"FurnEditL");
  5827. }
  5828. case 522: //Map-Editor selection
  5829. {
  5830. if(!response) return 1;
  5831. switch(listitem)
  5832. {
  5833. case 0:
  5834. {
  5835. new oblist[76], idx = 0;
  5836. for(new i = 321; i < 398; i++)
  5837. {
  5838. oblist[idx] = i;
  5839. idx++;
  5840. }
  5841. ShowModelSelectionMenuEx(playerid, oblist, sizeof(oblist), "Weapons (Map Objects)", 13, 16.0, 0.0, -55.0);
  5842. }
  5843. case 1:
  5844. {
  5845. new oblist[25], idx = 0;
  5846. for(new i = 700; i < 726; i++)
  5847. {
  5848. oblist[idx] = i;
  5849. idx++;
  5850. }
  5851. ShowModelSelectionMenuEx(playerid, oblist, sizeof(oblist), "Nature (Map Objects)", 13, 16.0, 0.0, -55.0);
  5852. }
  5853. case 2:
  5854. {
  5855. new oblist[20], idx = 0;
  5856. for(new i = 1000; i < 1021; i++)
  5857. {
  5858. oblist[idx] = i;
  5859. idx++;
  5860. }
  5861. ShowModelSelectionMenuEx(playerid, oblist, sizeof(oblist), "Car Parts (Map Objects)", 13, 16.0, 0.0, -55.0);
  5862. }
  5863. case 3:
  5864. {
  5865. new oblist[25] = {
  5866. 2918, 1433, 1484, 1486, 1518,
  5867. 1655, 1765, 1766, 1211, 1209,
  5868. 1227, 1222, 1225, 1340, 2222,
  5869. 2985, 2964, 3267, 3279, 3761,
  5870. 4563, 8493, 9900, 13592, 13594
  5871. };
  5872. ShowModelSelectionMenuEx(playerid, oblist, sizeof(oblist), "Fun Stuff (Map Objects)", 13, 16.0, 0.0, -55.0);
  5873. }
  5874. case 4:
  5875. {
  5876. new oblist[30], idx = 0;
  5877. for(new i = 5482; i < 5513; i++)
  5878. {
  5879. oblist[idx] = i;
  5880. idx++;
  5881. }
  5882. ShowModelSelectionMenuEx(playerid, oblist, sizeof(oblist), "Roads (Map Objects)", 13, 16.0, 0.0, -55.0);
  5883. }
  5884. case 5:
  5885. {
  5886. new oblist[33], idx = 0;
  5887. for(new i = 966; i < 999; i++)
  5888. {
  5889. oblist[idx] = i;
  5890. idx++;
  5891. }
  5892. ShowModelSelectionMenuEx(playerid, oblist, sizeof(oblist), "Barriers (Map Objects)", 13, 16.0, 0.0, -55.0);
  5893. }
  5894. case 6:
  5895. {
  5896. new oblist[65] = {
  5897. 1206, 1210, 1216, 1219,
  5898. 1223, 1341, 1342, 1378,
  5899. 1384, 1383, 1543, 1562,
  5900. 1572, 1608, 1609, 1612,
  5901. 1622, 1684, 3092, 2803,
  5902. 2589, 2590, 2804, 2805,
  5903. 2806, 16410, 12961, 12986,
  5904. 2896, 2905, 2906, 2907,
  5905. 2908, 2976, 3082, 3007,
  5906. 3008, 3009, 3010, 3011,
  5907. 3012, 3028, 3070, 3071,
  5908. 3072, 2627, 2628, 2629,
  5909. 2630, 3074, 3077, 3086,
  5910. 3085, 3087, 3088, 3108,
  5911. 3113, 3114, 3115, 2114,
  5912. 1318, 1318, 1317, 1316,
  5913. 1559
  5914. };
  5915. ShowModelSelectionMenuEx(playerid, oblist, sizeof(oblist), "Various (Map Objects)", 13, 16.0, 0.0, -55.0);
  5916. }
  5917. case 7:
  5918. {
  5919. new oblist[316], idx = 0;
  5920. for(new i = 1210; i < 1326; i++)
  5921. {
  5922. oblist[idx] = i;
  5923. idx++;
  5924. }
  5925. for(new i = 1420; i < 1621; i++)
  5926. {
  5927. oblist[idx] = i;
  5928. idx++;
  5929. }
  5930. ShowModelSelectionMenuEx(playerid, oblist, sizeof(oblist), "Misc (Map Objects)", 13, 16.0, 0.0, -55.0);
  5931. }
  5932. case 8:
  5933. {
  5934. new oblist[sizeof(FurnObjs)];
  5935. for(new i = 0; i < sizeof(FurnObjs); i++)
  5936. {
  5937. oblist[i] = FurnObjs[i];
  5938. }
  5939. ShowModelSelectionMenuEx(playerid, oblist, sizeof(FurnObjs), "Furniture List", 13, 16.0, 0.0, -55.0);
  5940. }
  5941. }
  5942. }
  5943. case 523: //House-sale dialog
  5944. {
  5945. if(!response) return 1;
  5946. new uid = GetPVarInt(playerid, "HouseKey");
  5947. if(!strmatch(HouseInfo[uid][hOwner], PlayerName(playerid))) return error(playerid, "You only rent this property.");
  5948. GivePlayerMoneyEx(playerid, floatround(HouseInfo[uid][hBuyValue]*0.8));
  5949. SetPVarInt(playerid, "HouseKey", 0);
  5950. HouseInfo[uid][hOwned] = 0;
  5951. format(HouseInfo[uid][hOwner], 25, "None");
  5952. SCM(playerid, -1, "Property sold.");
  5953. SaveHouse(uid);
  5954. OnPlayerDataSave(playerid);
  5955. RemoveHouseObject(uid);
  5956. }
  5957. case 524: // RLS station list
  5958. {
  5959. if(!response) return 1;
  5960. SetPVarInt(playerid, "RLSStation", listitem);
  5961. ShowPlayerDialog(playerid, 525, DIALOG_STYLE_LIST, RLSInfo[listitem][Name], "Edit Name\nEdit URL\nPlay Song", "Select", "Back");
  5962. }
  5963. case 525: // RLS station options
  5964. {
  5965. if(!response) {
  5966. DeletePVar(playerid, "RLSStation");
  5967. PopulateRLS(playerid);
  5968. return 1;
  5969. }
  5970. switch(listitem)
  5971. {
  5972. case 0: //Edit name
  5973. {
  5974. ShowPlayerDialog(playerid, 526, DIALOG_STYLE_INPUT, "Song Name", "What should this songs name be displayed as?", "Enter", "Cancel");
  5975. }
  5976. case 1: //Edit URL
  5977. {
  5978. ShowPlayerDialog(playerid, 527, DIALOG_STYLE_INPUT, "Song URL", "What is the URL that plays this song? (direct-link)", "Enter", "Cancel");
  5979. }
  5980. case 2: //Play Song
  5981. {
  5982. if(strlen(RLSInfo[GetPVarInt(playerid, "RLSStation")][URL]) < 3) {
  5983. DeletePVar(playerid, "RLSStation");
  5984. PopulateRLS(playerid);
  5985. return 1;
  5986. }
  5987. CallRemoteFunction("PlayRLSSong", "s", RLSInfo[GetPVarInt(playerid, "RLSStation")][URL]);
  5988. format(string, sizeof(string), "You've changed the Radio Los Santos stream to %s.", RLSInfo[GetPVarInt(playerid, "RLSStation")][Name]);
  5989. scm(playerid, COLOR_LIGHTBLUE, string);
  5990. DeletePVar(playerid, "RLSStation");
  5991. }
  5992. }
  5993. }
  5994. case 526: //RLS Station Name
  5995. {
  5996. if(!response) {
  5997. DeletePVar(playerid, "RLSStation");
  5998. return 1;
  5999. }
  6000. if(strlen(inputtext) < 1 || strlen(inputtext) > 72) {
  6001. error(playerid, "The songs name can only be between 1 and 72 characters long.");
  6002. return ShowPlayerDialog(playerid, 526, DIALOG_STYLE_INPUT, "Song Name", "What should this song's name be displayed as?", "Enter", "Cancel");
  6003. }
  6004. format(RLSInfo[GetPVarInt(playerid, "RLSStation")][Name], 72, "%s", inputtext);
  6005. format(string, sizeof(string), "You've changed the Name of stream %d to %s.", GetPVarInt(playerid, "RLSStation"), inputtext);
  6006. scm(playerid, COLOR_LIGHTBLUE, string);
  6007. DeletePVar(playerid, "RLSStation");
  6008. }
  6009. case 527: //RLS Station URL
  6010. {
  6011. if(!response) {
  6012. DeletePVar(playerid, "RLSStation");
  6013. return 1;
  6014. }
  6015. if(strlen(inputtext) < 1 || strlen(inputtext) > 128) {
  6016. error(playerid, "The songs URL can only be between 1 and 128 characters long.");
  6017. return ShowPlayerDialog(playerid, 527, DIALOG_STYLE_INPUT, "Song URL", "What is the URL that plays this song? (direct-link)", "Enter", "Cancel");
  6018. }
  6019. format(RLSInfo[GetPVarInt(playerid, "RLSStation")][URL], 129, "%s", inputtext);
  6020. format(string, sizeof(string), "You've changed the URL for %s to %s.", RLSInfo[GetPVarInt(playerid, "RLSStation")][Name], inputtext);
  6021. scm(playerid, COLOR_LIGHTBLUE, string);
  6022. DeletePVar(playerid, "RLSStation");
  6023. }
  6024. case 528:
  6025. {
  6026. if(!response) {
  6027. DeletePVar(playerid, "CurEditMdl");
  6028. return 1;
  6029. }
  6030. new count = 0;
  6031. for(new h = 0; h < MAX_MAP_OBJ; h++)
  6032. {
  6033. if(MapInfo[h][mObject] != 0)
  6034. {
  6035. if(MapInfo[h][mID] == GetPVarInt(playerid, "CurEditMdl"))
  6036. {
  6037. if(count >= listitem)
  6038. {
  6039. CallRemoteFunction("SelectMapObj", "ii", playerid, h);
  6040. break;
  6041. }
  6042. count++;
  6043. }
  6044. }
  6045. }
  6046. }
  6047. case 529:
  6048. {
  6049. if(!response) {
  6050. DeletePVar(playerid, "CurEditMdl");
  6051. return 1;
  6052. }
  6053. new keyex = FurnRight(playerid, 1), count = 0;
  6054. for(new h = 0; h < MAX_HOUSE_OBJ; h++)
  6055. {
  6056. if(HouseInfo[keyex][hObject][h] != 0)
  6057. {
  6058. if(IsPlayerInRangeOfPoint(playerid, 2.5, HouseInfo[keyex][hoX][h], HouseInfo[keyex][hoY][h], HouseInfo[keyex][hoZ][h]))
  6059. {
  6060. if(HouseInfo[keyex][hoID][h] == GetPVarInt(playerid, "CurEditMdl"))
  6061. {
  6062. if(count >= listitem)
  6063. {
  6064. CallRemoteFunction("SelectHouseObj", "iii", playerid, h, keyex);
  6065. break;
  6066. }
  6067. count++;
  6068. }
  6069. }
  6070. }
  6071. }
  6072. }
  6073. case 530:
  6074. {
  6075. if(!response) {
  6076. DeletePVar(playerid, "CurEditMdl");
  6077. return 1;
  6078. }
  6079. new keyex = FurnRight(playerid, 2), count = 0;
  6080. for(new h = 0; h < MAX_HOUSE_OBJ; h++)
  6081. {
  6082. if(BizInfo[keyex][bObject][h] != 0)
  6083. {
  6084. if(IsPlayerInRangeOfPoint(playerid, 2.5, BizInfo[keyex][boX][h], BizInfo[keyex][boY][h], BizInfo[keyex][boZ][h]))
  6085. {
  6086. if(BizInfo[keyex][boID][h] == GetPVarInt(playerid, "CurEditMdl"))
  6087. {
  6088. if(count >= listitem)
  6089. {
  6090. CallRemoteFunction("SelectBizzObj", "iii", playerid, h, keyex);
  6091. break;
  6092. }
  6093. count++;
  6094. }
  6095. }
  6096. }
  6097. }
  6098. }
  6099. case 531: // select which version of the same model-obj w/ range
  6100. {
  6101. if(!response) {
  6102. DeletePVar(playerid, "CurEditMdl");
  6103. return 1;
  6104. }
  6105. new count = 0;
  6106. for(new h = 0; h < MAX_MAP_OBJ; h++)
  6107. {
  6108. if(MapInfo[h][mObject] != 0)
  6109. {
  6110. if(MapInfo[h][mID] == GetPVarInt(playerid, "CurEditMdl"))
  6111. {
  6112. if(IsPlayerInRangeOfPoint(playerid, 2.5, MapInfo[h][mX], MapInfo[h][mY], MapInfo[h][mZ]))
  6113. {
  6114. if(count >= listitem)
  6115. {
  6116. CallRemoteFunction("SelectMapObj", "ii", playerid, h);
  6117. break;
  6118. }
  6119. count++;
  6120. }
  6121. }
  6122. }
  6123. }
  6124. }
  6125. case 532:
  6126. {
  6127. if(!response) {
  6128. DeletePVar(playerid, "CurEditMdl");
  6129. return 1;
  6130. }
  6131. new count = 0;
  6132. for(new h = 0; h < MAX_MAP_OBJ; h++)
  6133. {
  6134. if(MapInfo[h][mObject] != 0)
  6135. {
  6136. if(MapInfo[h][mID] == GetPVarInt(playerid, "CurEditMdl"))
  6137. {
  6138. if(strmatch(MapInfo[h][mOwner], PlayerName(playerid)))
  6139. {
  6140. if(count >= listitem)
  6141. {
  6142. CallRemoteFunction("SelectMapObj", "ii", playerid, h);
  6143. break;
  6144. }
  6145. count++;
  6146. }
  6147. }
  6148. }
  6149. }
  6150. }
  6151. case 533:
  6152. {
  6153. if(!response) return 1;
  6154. new h = GetPVarInt(playerid, "FurnEditH");
  6155. new Float:fX = MapInfo[h][mX], Float:fY = MapInfo[h][mY], Float:fZ = MapInfo[h][mZ];
  6156. new Float:fRotX = MapInfo[h][mrX], Float:fRotY = MapInfo[h][mrY], Float:fRotZ = MapInfo[h][mrZ];
  6157. SetPVarInt(playerid, "MapOEType", listitem);
  6158. switch(listitem)
  6159. {
  6160. case 0: // X-pos
  6161. {
  6162. format(string, sizeof(string), "Editing X-position: %.3f", fX);
  6163. ShowPlayerDialog(playerid, 534, DIALOG_STYLE_INPUT, "Editing X-position", string, "Enter", "Cancel");
  6164. }
  6165. case 1: // Y-pos
  6166. {
  6167. format(string, sizeof(string), "Editing Y-position: %.3f", fY);
  6168. ShowPlayerDialog(playerid, 534, DIALOG_STYLE_INPUT, "Editing Y-position", string, "Enter", "Cancel");
  6169. }
  6170. case 2: // Z-pos
  6171. {
  6172. format(string, sizeof(string), "Editing Z-position: %.3f", fZ);
  6173. ShowPlayerDialog(playerid, 534, DIALOG_STYLE_INPUT, "Editing Z-position", string, "Enter", "Cancel");
  6174. }
  6175. case 3: // X-rotation
  6176. {
  6177. format(string, sizeof(string), "Editing X-rotation: %.3f", fRotX);
  6178. ShowPlayerDialog(playerid, 534, DIALOG_STYLE_INPUT, "Editing X-rotation", string, "Enter", "Cancel");
  6179. }
  6180. case 4: // Y-rotation
  6181. {
  6182. format(string, sizeof(string), "Editing Y-rotation: %.3f", fRotY);
  6183. ShowPlayerDialog(playerid, 534, DIALOG_STYLE_INPUT, "Editing Y-rotation", string, "Enter", "Cancel");
  6184. }
  6185. case 5: // z-rotation
  6186. {
  6187. format(string, sizeof(string), "Editing Z-rotation: %.3f", fRotZ);
  6188. ShowPlayerDialog(playerid, 534, DIALOG_STYLE_INPUT, "Editing Z-rotation", string, "Enter", "Cancel");
  6189. }
  6190. }
  6191. }
  6192. case 534:
  6193. {
  6194. if(!response) {
  6195. DeletePVar(playerid, "MapOEType");
  6196. return 1;
  6197. }
  6198. new h = GetPVarInt(playerid, "FurnEditH");
  6199. new Float:fX = MapInfo[h][mX], Float:fY = MapInfo[h][mY], Float:fZ = MapInfo[h][mZ];
  6200. new Float:fRotX = MapInfo[h][mrX], Float:fRotY = MapInfo[h][mrY], Float:fRotZ = MapInfo[h][mrZ];
  6201. switch(GetPVarInt(playerid, "MapOEType"))
  6202. {
  6203. case 0: // X-pos
  6204. {
  6205. fX = floatstr(inputtext);
  6206. }
  6207. case 1: // Y-pos
  6208. {
  6209. fY = floatstr(inputtext);
  6210. }
  6211. case 2: // Z-pos
  6212. {
  6213. fZ = floatstr(inputtext);
  6214. }
  6215. case 3: // X-rotation
  6216. {
  6217. fRotX = floatstr(inputtext);
  6218. }
  6219. case 4: // Y-rotation
  6220. {
  6221. fRotY = floatstr(inputtext);
  6222. }
  6223. case 5: // z-rotation
  6224. {
  6225. fRotZ = floatstr(inputtext);
  6226. }
  6227. }
  6228. MoveDynamicObject(MapInfo[h][mObject], fX, fY, fZ, 50.0, fRotX, fRotY, fRotZ);
  6229. MapInfo[h][mX]=fX;
  6230. MapInfo[h][mY]=fY;
  6231. MapInfo[h][mZ]=fZ;
  6232. MapInfo[h][mrX]=fRotX;
  6233. MapInfo[h][mrY]=fRotY;
  6234. MapInfo[h][mrZ]=fRotZ;
  6235. SaveMapObj(h);
  6236. }
  6237. case 535:
  6238. {
  6239. if(!response) return 1;
  6240. new fid = strval(inputtext);
  6241. if(fid < 5 || fid == 8 || fid > MAX_FACTIONS) return error(playerid, "Invalid faction-id.");
  6242. if(FactionInfo[fid][fUsed] == 0) return error(playerid, "Faction slot isn't in use!");
  6243. SetPVarInt(playerid, "FacTD", fid);
  6244. format(string, sizeof(string), "Are you sure you want to delete\n%s?\n----\nWARNING: This is irreversible.", FactionInfo[fid][fName]);
  6245. ShowPlayerDialog(playerid, 536, DIALOG_STYLE_MSGBOX, "Delete a faction", string, "Yes", "No");
  6246. }
  6247. case 536:
  6248. {
  6249. if(!response) {
  6250. DeletePVar(playerid, "FacTD");
  6251. return 1;
  6252. }
  6253. if(GetPVarInt(playerid, "Admin") < 8) {
  6254. DeletePVar(playerid, "FacTD");
  6255. return 1;
  6256. }
  6257. new fid = GetPVarInt(playerid, "FacTD");
  6258. printf("Faction %s(%d) removed by: %s.", FactionInfo[fid][fName], fid, PlayerName(playerid));
  6259. DeleteFaction(fid);
  6260. format(string, sizeof(string), "Faction %d removed!", fid);
  6261. scm(playerid, COLOR_ORANGE, string);
  6262. DeletePVar(playerid, "FacTD");
  6263. }
  6264. case 537:
  6265. {
  6266. if(!response) {
  6267. DeletePVar(playerid, "CurEditMdl");
  6268. return 1;
  6269. }
  6270. new keyex = FurnRight(playerid, 1), count = 0;
  6271. for(new h = 0; h < MAX_HOUSE_OBJ; h++)
  6272. {
  6273. if(HouseInfo[keyex][hObject][h] != 0)
  6274. {
  6275. if(HouseInfo[keyex][hoID][h] == GetPVarInt(playerid, "CurEditMdl"))
  6276. {
  6277. if(count >= listitem)
  6278. {
  6279. CallRemoteFunction("SelectHouseObj", "iii", playerid, h, keyex);
  6280. break;
  6281. }
  6282. count++;
  6283. }
  6284. }
  6285. }
  6286. }
  6287. case 538:
  6288. {
  6289. if(!response) {
  6290. DeletePVar(playerid, "CurEditMdl");
  6291. return 1;
  6292. }
  6293. new keyex = FurnRight(playerid, 2), count = 0;
  6294. for(new h = 0; h < MAX_HOUSE_OBJ; h++)
  6295. {
  6296. if(BizInfo[keyex][bObject][h] != 0)
  6297. {
  6298. if(BizInfo[keyex][boID][h] == GetPVarInt(playerid, "CurEditMdl"))
  6299. {
  6300. if(count >= listitem)
  6301. {
  6302. CallRemoteFunction("SelectBizzObj", "iii", playerid, h, keyex);
  6303. break;
  6304. }
  6305. count++;
  6306. }
  6307. }
  6308. }
  6309. }
  6310. case 539:
  6311. {
  6312. if(!response) return 1;
  6313. new keyex = FurnRight(playerid, 1);
  6314. if(keyex != GetPVarInt(playerid, "HouseEnter")) return 1;
  6315. new h = GetPVarInt(playerid, "FurnEditH");
  6316. new Float:fX = HouseInfo[keyex][hoX][h], Float:fY = HouseInfo[keyex][hoY][h], Float:fZ = HouseInfo[keyex][hoZ][h];
  6317. new Float:fRotX = HouseInfo[keyex][horX][h], Float:fRotY = HouseInfo[keyex][horY][h], Float:fRotZ = HouseInfo[keyex][horZ][h];
  6318. SetPVarInt(playerid, "MapOEType", listitem);
  6319. switch(listitem)
  6320. {
  6321. case 0: // X-pos
  6322. {
  6323. format(string, sizeof(string), "Editing X-position: %.4f", fX);
  6324. ShowPlayerDialog(playerid, 540, DIALOG_STYLE_INPUT, "Editing X-position", string, "Enter", "Cancel");
  6325. }
  6326. case 1: // Y-pos
  6327. {
  6328. format(string, sizeof(string), "Editing Y-position: %.4f", fY);
  6329. ShowPlayerDialog(playerid, 540, DIALOG_STYLE_INPUT, "Editing Y-position", string, "Enter", "Cancel");
  6330. }
  6331. case 2: // Z-pos
  6332. {
  6333. format(string, sizeof(string), "Editing Z-position: %.4f", fZ);
  6334. ShowPlayerDialog(playerid, 540, DIALOG_STYLE_INPUT, "Editing Z-position", string, "Enter", "Cancel");
  6335. }
  6336. case 3: // X-rotation
  6337. {
  6338. format(string, sizeof(string), "Editing X-rotation: %.4f", fRotX);
  6339. ShowPlayerDialog(playerid, 540, DIALOG_STYLE_INPUT, "Editing X-rotation", string, "Enter", "Cancel");
  6340. }
  6341. case 4: // Y-rotation
  6342. {
  6343. format(string, sizeof(string), "Editing Y-rotation: %.4f", fRotY);
  6344. ShowPlayerDialog(playerid, 540, DIALOG_STYLE_INPUT, "Editing Y-rotation", string, "Enter", "Cancel");
  6345. }
  6346. case 5: // z-rotation
  6347. {
  6348. format(string, sizeof(string), "Editing Z-rotation: %.4f", fRotZ);
  6349. ShowPlayerDialog(playerid, 540, DIALOG_STYLE_INPUT, "Editing Z-rotation", string, "Enter", "Cancel");
  6350. }
  6351. }
  6352. }
  6353. case 540:
  6354. {
  6355. if(!response) {
  6356. DeletePVar(playerid, "MapOEType");
  6357. return 1;
  6358. }
  6359. new keyex = FurnRight(playerid, 1);
  6360. if(keyex != GetPVarInt(playerid, "HouseEnter")) return 1;
  6361. new h = GetPVarInt(playerid, "FurnEditH");
  6362. new Float:fX = HouseInfo[keyex][hoX][h], Float:fY = HouseInfo[keyex][hoY][h], Float:fZ = HouseInfo[keyex][hoZ][h];
  6363. new Float:fRotX = HouseInfo[keyex][horX][h], Float:fRotY = HouseInfo[keyex][horY][h], Float:fRotZ = HouseInfo[keyex][horZ][h];
  6364. switch(GetPVarInt(playerid, "MapOEType"))
  6365. {
  6366. case 0: // X-pos
  6367. {
  6368. fX = floatstr(inputtext);
  6369. }
  6370. case 1: // Y-pos
  6371. {
  6372. fY = floatstr(inputtext);
  6373. }
  6374. case 2: // Z-pos
  6375. {
  6376. fZ = floatstr(inputtext);
  6377. }
  6378. case 3: // X-rotation
  6379. {
  6380. fRotX = floatstr(inputtext);
  6381. }
  6382. case 4: // Y-rotation
  6383. {
  6384. fRotY = floatstr(inputtext);
  6385. }
  6386. case 5: // z-rotation
  6387. {
  6388. fRotZ = floatstr(inputtext);
  6389. }
  6390. }
  6391. MoveDynamicObject(HouseInfo[keyex][hObject][h], fX, fY, fZ, 50.0, fRotX, fRotY, fRotZ);
  6392. HouseInfo[keyex][hoX][h]=fX;
  6393. HouseInfo[keyex][hoY][h]=fY;
  6394. HouseInfo[keyex][hoZ][h]=fZ;
  6395. HouseInfo[keyex][horX][h]=fRotX;
  6396. HouseInfo[keyex][horY][h]=fRotY;
  6397. HouseInfo[keyex][horZ][h]=fRotZ;
  6398. SaveFurnObj(keyex, h);
  6399. }
  6400. case 541:
  6401. {
  6402. if(!response) return 1;
  6403. new keyex = FurnRight(playerid, 2);
  6404. if(keyex != GetPVarInt(playerid, "BizzEnter")) return 1;
  6405. new h = GetPVarInt(playerid, "FurnEditH");
  6406. new Float:fX = BizInfo[keyex][boX][h], Float:fY = BizInfo[keyex][boY][h], Float:fZ = BizInfo[keyex][boZ][h];
  6407. new Float:fRotX = BizInfo[keyex][borX][h], Float:fRotY = BizInfo[keyex][borY][h], Float:fRotZ = BizInfo[keyex][borZ][h];
  6408. SetPVarInt(playerid, "MapOEType", listitem);
  6409. switch(listitem)
  6410. {
  6411. case 0: // X-pos
  6412. {
  6413. format(string, sizeof(string), "Editing X-position: %.4f", fX);
  6414. ShowPlayerDialog(playerid, 542, DIALOG_STYLE_INPUT, "Editing X-position", string, "Enter", "Cancel");
  6415. }
  6416. case 1: // Y-pos
  6417. {
  6418. format(string, sizeof(string), "Editing Y-position: %.4f", fY);
  6419. ShowPlayerDialog(playerid, 542, DIALOG_STYLE_INPUT, "Editing Y-position", string, "Enter", "Cancel");
  6420. }
  6421. case 2: // Z-pos
  6422. {
  6423. format(string, sizeof(string), "Editing Z-position: %.4f", fZ);
  6424. ShowPlayerDialog(playerid, 542, DIALOG_STYLE_INPUT, "Editing Z-position", string, "Enter", "Cancel");
  6425. }
  6426. case 3: // X-rotation
  6427. {
  6428. format(string, sizeof(string), "Editing X-rotation: %.4f", fRotX);
  6429. ShowPlayerDialog(playerid, 542, DIALOG_STYLE_INPUT, "Editing X-rotation", string, "Enter", "Cancel");
  6430. }
  6431. case 4: // Y-rotation
  6432. {
  6433. format(string, sizeof(string), "Editing Y-rotation: %.4f", fRotY);
  6434. ShowPlayerDialog(playerid, 542, DIALOG_STYLE_INPUT, "Editing Y-rotation", string, "Enter", "Cancel");
  6435. }
  6436. case 5: // z-rotation
  6437. {
  6438. format(string, sizeof(string), "Editing Z-rotation: %.4f", fRotZ);
  6439. ShowPlayerDialog(playerid, 542, DIALOG_STYLE_INPUT, "Editing Z-rotation", string, "Enter", "Cancel");
  6440. }
  6441. }
  6442. }
  6443. case 542:
  6444. {
  6445. if(!response) {
  6446. DeletePVar(playerid, "MapOEType");
  6447. return 1;
  6448. }
  6449. new keyex = FurnRight(playerid, 2);
  6450. if(keyex != GetPVarInt(playerid, "BizzEnter")) return 1;
  6451. new h = GetPVarInt(playerid, "FurnEditH");
  6452. new Float:fX = BizInfo[keyex][boX][h], Float:fY = BizInfo[keyex][boY][h], Float:fZ = BizInfo[keyex][boZ][h];
  6453. new Float:fRotX = BizInfo[keyex][borX][h], Float:fRotY = BizInfo[keyex][borY][h], Float:fRotZ = BizInfo[keyex][borZ][h];
  6454. switch(GetPVarInt(playerid, "MapOEType"))
  6455. {
  6456. case 0: // X-pos
  6457. {
  6458. fX = floatstr(inputtext);
  6459. }
  6460. case 1: // Y-pos
  6461. {
  6462. fY = floatstr(inputtext);
  6463. }
  6464. case 2: // Z-pos
  6465. {
  6466. fZ = floatstr(inputtext);
  6467. }
  6468. case 3: // X-rotation
  6469. {
  6470. fRotX = floatstr(inputtext);
  6471. }
  6472. case 4: // Y-rotation
  6473. {
  6474. fRotY = floatstr(inputtext);
  6475. }
  6476. case 5: // z-rotation
  6477. {
  6478. fRotZ = floatstr(inputtext);
  6479. }
  6480. }
  6481. MoveDynamicObject(BizInfo[keyex][bObject][h], fX, fY, fZ, 50.0, fRotX, fRotY, fRotZ);
  6482. BizInfo[keyex][boX][h]=fX;
  6483. BizInfo[keyex][boY][h]=fY;
  6484. BizInfo[keyex][boZ][h]=fZ;
  6485. BizInfo[keyex][borX][h]=fRotX;
  6486. BizInfo[keyex][borY][h]=fRotY;
  6487. BizInfo[keyex][borZ][h]=fRotZ;
  6488. SaveBizzObj(keyex, h);
  6489. }
  6490. case 543: // Dealership menu
  6491. {
  6492. if(!response) return true;
  6493. switch(listitem)
  6494. {
  6495. case 0:
  6496. {
  6497. new query[75];
  6498. mysql_format(handlesql, query, sizeof(query), "SELECT NULL FROM `vehicles` WHERE `Owner` = '%e';", PlayerInfo[playerid][pUsername]);
  6499. mysql_tquery(handlesql, query, "OnPlayerEntersDealership", "i", playerid);
  6500. }
  6501. case 1:
  6502. {
  6503. if(CountSpawnedCars(playerid) > 1) return SendClientMessage(playerid, COLOR_GREY, "You can't upgrade vehicles while you have more than 1 spawned.");
  6504. new keyex = IsPlayerVehicleSpawned(playerid);
  6505. if(keyex == -1) return SendClientMessage(playerid, COLOR_GREY, "You do not have a vehicle spawned.");
  6506. if (OwnableVehicle(keyex))
  6507. {
  6508. if(IsNotAEngineCar(keyex)) return true;
  6509. format(string, sizeof(string), "Vehicle Upgrades (%s)", VehicleName[GetVehicleModel(keyex)-400]);
  6510. ShowPlayerDialog(playerid, 544, DIALOG_STYLE_LIST, string, "Insurance\nLock\nAlarm", "Select", "Close");
  6511. }
  6512. }
  6513. }
  6514. }
  6515. case 544: // Vehicle Upgrades
  6516. {
  6517. if(!response) return true;
  6518. new strie[1024];
  6519. switch(listitem)
  6520. {
  6521. case 0: // Insurance
  6522. {
  6523. strcat(strie, "{3366FF}Enter the insurance level you wish to purchase:");
  6524. strcat(strie, "\n\n{3366FF}Insurance will cost {FFFFFF}($150) {3366FF}each payday, failure to pay will result in penalty charges.");
  6525. strcat(strie, "\n\n{3366FF}Level {FFFFFF}1: {3366FF}Insurance will cover the damages when a vehicle is destroyed, ($1500 to purchase).");
  6526. strcat(strie, "\n{3366FF}Level {FFFFFF}2: {3366FF}Insurance will cover any scratches etc on the vehicle when spawned +lvl 1, ($2500 to purchase).");
  6527. strcat(strie, "\n{3366FF}Level {FFFFFF}3: {3366FF}Insurance will spawn your vehicle at full health after despawning with low hp +lvl 1-2, ($5000 to purchase).");
  6528. strcat(strie, "\n\n{FFFFFF}Insert '0' to remove this perk.");
  6529. ShowPlayerDialog(playerid, 545, DIALOG_STYLE_INPUT, "Vehicle Insurance", strie, "Purchase","Close");
  6530. }
  6531. case 1: // Lock
  6532. {
  6533. strcat(strie, "{3366FF}Enter the lock level you wish to purchase:");
  6534. strcat(strie, "\n\n{3366FF}Level {FFFFFF}1: {3366FF}Extended time when attempting to breakin the vehicle, ($875 to purchase).");
  6535. strcat(strie, "\n{3366FF}Level {FFFFFF}2: {3366FF}Extra extended time when attempt to break into vehicle + breakin success more difficult, ($1500 to purchase).");
  6536. strcat(strie, "\n{3366FF}Level {FFFFFF}3: {3366FF}Superior extended time when attempt to break into vehicle {FFFFFF}+lvl 2{3366FF}, ($2000 to purchase).");
  6537. strcat(strie, "\n\n{FFFFFF}Insert '0' to remove this perk.");
  6538. ShowPlayerDialog(playerid, 546, DIALOG_STYLE_INPUT, "Vehicle Lock", strie, "Purchase","Close");
  6539. }
  6540. case 2: // Alarm
  6541. {
  6542. strcat(strie, "{3366FF}Enter the alarm level you wish to purchase:");
  6543. strcat(strie, "\n\n{3366FF}Level {FFFFFF}1: {3366FF}When someone successfully breaks into your vehicle the alarm will ring, ($950 to purchase).");
  6544. strcat(strie, "\n{3366FF}Level {FFFFFF}2: {3366FF}Any attempts to break into your vehicle and the alarm will ring {FFFFFF}+lvl 1{3366FF}, ($1500 to purchase).");
  6545. strcat(strie, "\n{3366FF}Level {FFFFFF}3: {3366FF}Any theft or control attempts to your vehicle and the alarm will ring {FFFFFF}+lvl 1-2{3366FF}, ($3000 to purchase).");
  6546. strcat(strie, "\n\n{FFFFFF}Insert '0' to remove this perk.");
  6547. ShowPlayerDialog(playerid, 547, DIALOG_STYLE_INPUT, "Vehicle Alarm", strie, "Purchase","Close");
  6548. }
  6549. }
  6550. }
  6551. case 545: // Insurance Purchase
  6552. {
  6553. if(!response) return true;
  6554. if(!strlen(inputtext)) return true;
  6555. if(strlen(inputtext) >= 7) return true;
  6556. new amount = strval(inputtext), priceex;
  6557. if(amount < 0) return true;
  6558. if(amount >= 4) return true;
  6559. switch(amount)
  6560. {
  6561. case 1: priceex=1500;
  6562. case 2: priceex=2500;
  6563. case 3: priceex=5000;
  6564. }
  6565.  
  6566. if(CountSpawnedCars(playerid) > 1) return SendClientMessage(playerid, COLOR_GREY, "You can't upgrade vehicles while you have more than 1 spawned.");
  6567. new keyex = IsPlayerVehicleSpawned(playerid);
  6568. if(keyex == -1) return SendClientMessage(playerid, COLOR_GREY, "You do not have a vehicle spawned.");
  6569. if(VehicleInfo[keyex][vInsurance] == amount) return SendClientMessage(playerid, COLOR_WHITE, "You already have this insurance level!");
  6570. if(amount == 0)
  6571. {
  6572. if(GetPVarInt(playerid, "UpgDelay") > 0) {
  6573. format(string, sizeof(string), "You must wait %d minutes before removing a upgrade!", GetPVarInt(playerid, "UpgDelay"));
  6574. scm(playerid, COLOR_LIGHTRED, string);
  6575. } else {
  6576. scm(playerid, -1, "Upgrade removed!");
  6577. VehicleInfo[keyex][vInsurance]=0;
  6578. }
  6579. return 1;
  6580. }
  6581. if(VehicleInfo[keyex][vInsurance] >= 3) return SendClientMessage(playerid, COLOR_WHITE, "You have exceeded the insurance amount!");
  6582. if (OwnableVehicle(keyex))
  6583. {
  6584. if(IsNotAEngineCar(keyex)) return true;
  6585. if(GetPlayerMoneyEx(playerid) >= priceex)
  6586. {
  6587. GivePlayerMoneyEx(playerid, -priceex);
  6588. format(string, sizeof(string),"~r~-$%d", priceex);
  6589. GameTextForPlayer(playerid, string, 5000, 1);
  6590. format(string, sizeof(string),"{3366FF}(%s UPGRADE): {FFFFFF}Congratulations on your level %d insurance for $%d!", VehicleName[GetVehicleModel(keyex)-400], amount, priceex);
  6591. SCM(playerid, -1, string);
  6592. VehicleInfo[keyex][vInsurance]=amount;
  6593. SetPVarInt(playerid, "UpgDelay", 60);
  6594. }
  6595. else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds!");
  6596. }
  6597. }
  6598. case 546: // Lock Purchase
  6599. {
  6600. if(!response) return true;
  6601. if(!strlen(inputtext)) return true;
  6602. if(strlen(inputtext) >= 7) return true;
  6603. new amount = strval(inputtext), priceex;
  6604. if(amount < 0) return true;
  6605. if(amount >= 4) return true;
  6606. switch(amount)
  6607. {
  6608. case 1: priceex=875;
  6609. case 2: priceex=1500;
  6610. case 3: priceex=2000;
  6611. }
  6612.  
  6613. if(CountSpawnedCars(playerid) > 1) return SendClientMessage(playerid, COLOR_GREY, "You can't upgrade vehicles while you have more than 1 spawned.");
  6614. new keyex = IsPlayerVehicleSpawned(playerid);
  6615. if(keyex == -1) return SendClientMessage(playerid, COLOR_GREY, "You do not have a vehicle spawned.");
  6616. if(VehicleInfo[keyex][vLockLvl] == amount) return SendClientMessage(playerid, COLOR_WHITE, "You already have this lock level!");
  6617. if(amount == 0)
  6618. {
  6619. if(GetPVarInt(playerid, "UpgDelay") > 0) {
  6620. format(string, sizeof(string), "You must wait %d minutes before removing a upgrade!", GetPVarInt(playerid, "UpgDelay"));
  6621. scm(playerid, COLOR_LIGHTRED, string);
  6622. } else {
  6623. scm(playerid, -1, "Upgrade removed!");
  6624. VehicleInfo[keyex][vLockLvl]=0;
  6625. } return 1;
  6626. }
  6627. if(VehicleInfo[keyex][vLockLvl] >= 3) return SendClientMessage(playerid, COLOR_WHITE, "You have exceeded the lock level amount!");
  6628. if (OwnableVehicle(keyex))
  6629. {
  6630. if(IsNotAEngineCar(keyex)) return true;
  6631. if(GetPlayerMoneyEx(playerid) >= priceex)
  6632. {
  6633. GivePlayerMoneyEx(playerid, -priceex);
  6634. format(string, sizeof(string),"~r~-$%d", priceex);
  6635. GameTextForPlayer(playerid, string, 5000, 1);
  6636. format(string, sizeof(string),"{3366FF}(%s UPGRADE): {FFFFFF}Congratulations on your level %d lock for $%d!", VehicleName[GetVehicleModel(keyex)-400], amount, priceex);
  6637. SCM(playerid, -1, string);
  6638. VehicleInfo[keyex][vLockLvl]=amount;
  6639. SetPVarInt(playerid, "UpgDelay", 60);
  6640. }
  6641. else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds!");
  6642. }
  6643. }
  6644. case 547: // Alarm Purchase
  6645. {
  6646. if(!response) return true;
  6647. if(!strlen(inputtext)) return true;
  6648. if(strlen(inputtext) >= 7) return true;
  6649. new amount = strval(inputtext), priceex;
  6650. if(amount < 0) return true;
  6651. if(amount >= 4) return true;
  6652. switch(amount)
  6653. {
  6654. case 1: priceex=950;
  6655. case 2: priceex=1500;
  6656. case 3: priceex=3000;
  6657. }
  6658.  
  6659. if(CountSpawnedCars(playerid) > 1) return SendClientMessage(playerid, COLOR_GREY, "You can't upgrade vehicles while you have more than 1 spawned.");
  6660. new keyex = IsPlayerVehicleSpawned(playerid);
  6661. if(keyex == -1) return SendClientMessage(playerid, COLOR_GREY, "You do not have a vehicle spawned.");
  6662. if(VehicleInfo[keyex][vAlarmLvl] == amount) return SendClientMessage(playerid, COLOR_WHITE, "You already have this alarm level!");
  6663. if(amount == 0)
  6664. {
  6665. if(GetPVarInt(playerid, "UpgDelay") > 0) {
  6666. format(string, sizeof(string), "You must wait %d minutes before removing a upgrade!", GetPVarInt(playerid, "UpgDelay"));
  6667. scm(playerid, COLOR_LIGHTRED, string);
  6668. } else {
  6669. scm(playerid, -1, "Upgrade removed!");
  6670. VehicleInfo[keyex][vAlarmLvl]=amount;
  6671. } return 1;
  6672. }
  6673. if(VehicleInfo[keyex][vAlarmLvl] >= 3) return SendClientMessage(playerid, COLOR_WHITE, "You have exceeded the alarm amount!");
  6674. if (OwnableVehicle(keyex))
  6675. {
  6676. if(IsNotAEngineCar(keyex)) return true;
  6677. if(GetPlayerMoneyEx(playerid) >= priceex)
  6678. {
  6679. GivePlayerMoneyEx(playerid, -priceex);
  6680. format(string, sizeof(string),"~r~-$%d", priceex);
  6681. GameTextForPlayer(playerid, string, 5000, 1);
  6682. format(string, sizeof(string),"{3366FF}(%s UPGRADE): {FFFFFF}Congratulations on your level %d alarm for $%d!", VehicleName[GetVehicleModel(keyex)-400], amount, priceex);
  6683. SCM(playerid, -1, string);
  6684. VehicleInfo[keyex][vAlarmLvl]=amount;
  6685. SetPVarInt(playerid, "UpgDelay", 60);
  6686. }
  6687. else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds!");
  6688. }
  6689. }
  6690. case 548: // Drop keys
  6691. {
  6692. if(!response) return 1;
  6693. if(CarKeys[playerid][listitem] != 0) {
  6694. new query[128];
  6695. mysql_format(handlesql, query, 128, "SELECT `Owner`,`Model` FROM `vehicles` WHERE `ID`=%d", CarKeys[playerid][listitem]);
  6696. mysql_tquery(handlesql, query, "OnViewKey", "ii", playerid, listitem);
  6697. } else {
  6698. scm(playerid, COLOR_RED, "You don't have a key in that slot.");
  6699. ShowCarKeys(playerid);
  6700. }
  6701. }
  6702. case 549: // OnViewKey dialog
  6703. {
  6704. if(!response) {
  6705. DeletePVar(playerid, "ViewKeyID");
  6706. return ShowCarKeys(playerid);
  6707. }
  6708. TakeCarKeyEx(playerid, GetPVarInt(playerid, "ViewKeyID"));
  6709. DeletePVar(playerid, "ViewKeyID");
  6710. }
  6711. case 550: // Lend car-key to
  6712. {
  6713. if(!response) {
  6714. DeletePVar(playerid, "LendKeysTo");
  6715. return 1;
  6716. }
  6717. if(!IsPlayerConnected(GetPVarInt(playerid, "LendKeysTo"))) {
  6718. DeletePVar(playerid, "LendKeysTo");
  6719. scm(playerid, COLOR_ORANGE, "The player you're trying to lend your car-key to isn't online.");
  6720. return 1;
  6721. }
  6722. new query[112];
  6723. mysql_format(handlesql, query, sizeof(query), "SELECT `ID`, `Model` FROM `vehicles` WHERE `Owner` = '%e' LIMIT %i, %i;", PlayerInfo[playerid][pUsername], listitem, listitem + 1);
  6724. mysql_tquery(handlesql, query, "LendCarKeys", "ii", playerid, GetPVarInt(playerid, "LendKeysTo"));
  6725. }
  6726. case 551: // Take car-key from
  6727. {
  6728. if(!response) {
  6729. DeletePVar(playerid, "TakeKeysFrom");
  6730. return 1;
  6731. }
  6732. if(!IsPlayerConnected(GetPVarInt(playerid, "TakeKeysFrom"))) {
  6733. DeletePVar(playerid, "TakeKeysFrom");
  6734. scm(playerid, COLOR_ORANGE, "The player you're trying to take your car-key from isn't online.");
  6735. return 1;
  6736. }
  6737. new query[112];
  6738. mysql_format(handlesql, query, sizeof(query), "SELECT `ID`, `Model` FROM `vehicles` WHERE `Owner` = '%e' LIMIT %i, %i;", PlayerInfo[playerid][pUsername], listitem, listitem + 1);
  6739. mysql_tquery(handlesql, query, "TakeCarKeys", "ii", playerid, GetPVarInt(playerid, "TakeKeysFrom"));
  6740. }
  6741. case 552: // Payphone options dialog
  6742. {
  6743. if(!response) {
  6744. cancelPayphone(playerid);
  6745. return 1;
  6746. }
  6747. switch(listitem)
  6748. {
  6749. case 0: //Call number
  6750. {
  6751. ShowPlayerDialog(playerid, 39, DIALOG_STYLE_INPUT, "Calling", "Enter the number you would like to call.", "Call", "Go Back");
  6752. }
  6753. case 1: //Services
  6754. {
  6755. ShowPlayerDialog(playerid, 553, DIALOG_STYLE_LIST, "Services", "Emergecy\nTaxi\nMechanic", "Okay", "Exit");
  6756. }
  6757. }
  6758. }
  6759. case 553: // Payphone services dialog
  6760. {
  6761. if(!response) {
  6762. ShowPlayerDialog(playerid, 552, DIALOG_STYLE_LIST, phoneInfo[GetPVarInt(playerid,"usingPayphone")][phoneName], "Call number\nServices", "Okay", "Exit");
  6763. return 1;
  6764. }
  6765. switch(listitem)
  6766. {
  6767. case 0: //Emergecy
  6768. {
  6769. CallNumber(playerid, "911");
  6770. }
  6771. case 1: //Taxi
  6772. {
  6773. CallNumber(playerid, "411");
  6774. }
  6775. case 2: //Mechanic
  6776. {
  6777. CallNumber(playerid, "311");
  6778. }
  6779. }
  6780. }
  6781. case 554: // Crafting menu
  6782. {
  6783. if(!response) return 1;
  6784. new strung[172];
  6785. format(strung, 172, "Name: {33FF66}%s.\n{FFFFFF}Level: {33FF66}%d/%d.\n{FFFFFF}Cost: {33FF66}%d/%d materials.", CraftWeps[listitem][wName], PlayerInfo[playerid][pCraft], CraftWeps[listitem][wLvl], PlayerInfo[playerid][pMaterials], CraftWeps[listitem][wCost]);
  6786. ShowPlayerDialog(playerid, 555, DIALOG_STYLE_MSGBOX, "Are you sure you want to craft this?", strung, "Craft", "Close");
  6787. SetPVarInt(playerid, "CraftID", listitem);
  6788. }
  6789. case 555: // Crafting confirm
  6790. {
  6791. if(!response) {
  6792. DeletePVar(playerid, "CraftID");
  6793. return 1;
  6794. }
  6795. if(PlayerInfo[playerid][pMaterials] < CraftWeps[GetPVarInt(playerid, "CraftID")][wCost]) return SCM(playerid, COLOR_ORANGE, "You don't have enough materials for this!");
  6796. ProgressBar(playerid, "Crafting item...", 10, 3);
  6797. AddPlayerTag(playerid, "(crafting item)");
  6798. scm(playerid, COLOR_ORANGE, "Don't forget to roleplay your crafting.");
  6799. }
  6800. case 556: //Vehicle glovebox
  6801. {
  6802. if(!IsPlayerInAnyVehicle(playerid)) return 1;
  6803. new kez = GetPlayerVehicleID(playerid);
  6804. if(VehicleInfo[kez][vType] != VEHICLE_PERSONAL) return 1;
  6805. if(IsHelmetCar(kez)) return 1;
  6806. if(kez == -1) return 1;
  6807. new stri2[100];
  6808. if(response)
  6809. {
  6810. if(CheckInv(playerid) == 0) return error(playerid, "Your inventory is full.");
  6811. if(DisabledWeapon(GetPVarInt(playerid, "ConnectTime"), VehicleInfo[kez][vGBID][listitem])) return error(playerid, "You need 8 hours played to use take this.");
  6812. if(VehicleInfo[kez][vGBID][listitem] == 0) return error(playerid, "Slot is empty.");
  6813. if(VehicleInfo[kez][vGBID][listitem] <= 800 || VehicleInfo[kez][vGBID][listitem] >= 1002) {
  6814. GiveInvItem(playerid, VehicleInfo[kez][vGBID][listitem], VehicleInfo[kez][vGBQ][listitem], VehicleInfo[kez][vGBE][listitem], VehicleInfo[kez][vGBS][listitem]); }
  6815. format(stri2, sizeof(stri2), "You took a (%s) from your vehicles glovebox.", PrintIName(VehicleInfo[kez][vGBID][listitem]));
  6816. scm(playerid, -1, stri2);
  6817. format(stri2, sizeof(stri2), "takes a %s from the vehicles glovebox.", PrintIName(VehicleInfo[kez][vGBID][listitem]));
  6818. ForceAME(playerid, stri2);
  6819. VehicleInfo[kez][vGBID][listitem] = 0;
  6820. VehicleInfo[kez][vGBQ][listitem] = 0;
  6821. VehicleInfo[kez][vGBE][listitem] = 0;
  6822. VehicleInfo[kez][vGBS][listitem] = 0;
  6823. mysql_format(handlesql, string, sizeof(string), "UPDATE `vehicles` SET `GBID%d` = %i, `GBQ%d` = %i, `GBE%d` = %i WHERE `ID` = %i;",
  6824. listitem, VehicleInfo[kez][vGBID][listitem], listitem, VehicleInfo[kez][vGBQ][listitem], listitem, VehicleInfo[kez][vGBE][listitem], listitem, VehicleInfo[kez][vID]);
  6825. mysql_tquery(handlesql, string);
  6826. }
  6827. }
  6828. case 557: // Delete vehicle
  6829. {
  6830. if(response) {
  6831. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You have to be in your vehicle in order to delete it.");
  6832. new vehicleID = GetPlayerVehicleID(playerid);
  6833. if(!PlayerOwnsVehicle(playerid, vehicleID)) return SendClientMessage(playerid, COLOR_GREY, "You don't own this vehicle.");
  6834. if(VehicleInfo[vehicleID][vDonate] == 0) return SendClientMessage(playerid, COLOR_GREY, "You can only delete donor vehicles, use (/v sell) instead.");
  6835. SendClientMessage(playerid, COLOR_WHITE, "Vehicle deleted.");
  6836. mysql_format(handlesql, string, sizeof(string), "DELETE FROM `vehicles` WHERE `ID` = %i;", VehicleInfo[vehicleID][vID]);
  6837. mysql_tquery(handlesql, string);
  6838. mysql_format(handlesql, string, sizeof(string), "DELETE FROM `vehiclefurn` WHERE VID=%i;", VehicleInfo[vehicleID][vID]);
  6839. mysql_tquery(handlesql, string);
  6840. DespawnVehicle(vehicleID);
  6841. }
  6842. }
  6843. case 558:
  6844. {
  6845. if(!response) return 1;
  6846.  
  6847. new houseid = GetPVarInt(playerid, "HouseKey");
  6848.  
  6849. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You have to be on foot in order to do this.");
  6850. if(!IsPlayerInRangeOfPoint(playerid, HOUSE_GARAGE_DISTANCE, HouseInfo[houseid][hXo], HouseInfo[houseid][hYo], HouseInfo[houseid][hZo])) return SendClientMessage(playerid, COLOR_GREY, "You are too far away from your house entrance.");
  6851. if(GetPlayerMoneyEx(playerid) < GARAGE_ENTRANCE_COST) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to do this.");
  6852.  
  6853. // CallRemoteFunction("GivePlayerMoneyEx","ii", playerid, -GARAGE_ENTRANCE_COST);
  6854.  
  6855. GivePlayerMoneyEx(playerid, -GARAGE_ENTRANCE_COST);
  6856.  
  6857. new Float:x, Float:y, Float:z, Float:a;
  6858.  
  6859. new string3[32];
  6860. format(string3, sizeof(string3),"~r~-%s", FormatMoney(GARAGE_ENTRANCE_COST));
  6861. GameTextForPlayer(playerid, string3, 5000, 1);
  6862.  
  6863. GetPlayerPos(playerid, x, y, z);
  6864. GetPlayerFacingAngle(playerid, a);
  6865.  
  6866. if(HouseInfo[houseid][gIcon] != 0) DestroyDynamicCP(HouseInfo[houseid][gIcon]);
  6867. HouseInfo[houseid][gIcon] = CreateDynamicCP(x, y, z, 3.0, 0, -1, -1, 3.0);
  6868. HouseInfo[houseid][hgXo] = x;
  6869. HouseInfo[houseid][hgYo] = y;
  6870. HouseInfo[houseid][hgZo] = z;
  6871. HouseInfo[houseid][hgAo] = a;
  6872. HouseInfo[houseid][gInterior] = 1;
  6873.  
  6874. if(HouseInfo[houseid][Garage] == 0)
  6875. {
  6876. if(HouseInfo[houseid][hClass] == 2)
  6877. {
  6878. HouseInfo[houseid][hgXi] = 286.7440;
  6879. HouseInfo[houseid][hgYi] = 1080.8870;
  6880. HouseInfo[houseid][hgZi] = 1185.0172;
  6881. HouseInfo[houseid][hgAi] = 177.6385;
  6882. }
  6883. else
  6884. {
  6885. HouseInfo[houseid][hgXi] = 603.3348;
  6886. HouseInfo[houseid][hgYi] = 1829.4977;
  6887. HouseInfo[houseid][hgZi] = 1586.4860;
  6888. HouseInfo[houseid][hgAi] = 88.7960;
  6889. }
  6890. }
  6891.  
  6892. HouseInfo[houseid][Garage] = 1;
  6893.  
  6894. SendClientMessage(playerid, COLOR_WHITE, "Garage entrance has been set!");
  6895.  
  6896. SaveHouse(houseid);
  6897. }
  6898. case 559:
  6899. {
  6900. if(!response) return 1;
  6901.  
  6902. if(GetPlayerMoneyEx(playerid) < GARAGE_EXIT_COST) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to do this.");
  6903.  
  6904. // CallRemoteFunction("GivePlayerMoneyEx","ii", playerid, -GARAGE_EXIT_COST);
  6905.  
  6906. GivePlayerMoneyEx(playerid, -GARAGE_EXIT_COST);
  6907.  
  6908. new string3[32];
  6909. format(string3, sizeof(string3),"~r~-%s", FormatMoney(GARAGE_EXIT_COST));
  6910. GameTextForPlayer(playerid, string3, 5000, 1);
  6911.  
  6912. new houseid = GetPVarInt(playerid, "HouseKey");
  6913.  
  6914. new Float:x, Float:y, Float:z, Float:a;
  6915. GetPlayerPos(playerid, x, y, z);
  6916. GetPlayerFacingAngle(playerid, a);
  6917.  
  6918. HouseInfo[houseid][gInterior] = GetPlayerInterior(playerid);
  6919. HouseInfo[houseid][hgXi] = x;
  6920. HouseInfo[houseid][hgYi] = y;
  6921. HouseInfo[houseid][hgZi] = z;
  6922. HouseInfo[houseid][hgAi] = a;
  6923. if(IsValidDynamicPickup(HouseInfo[houseid][gExit])) DestroyDynamicPickup(HouseInfo[houseid][gExit]);
  6924. HouseInfo[houseid][gExit] = CreateDynamicPickup(1318, 1, HouseInfo[houseid][hgXi], HouseInfo[houseid][hgYi], HouseInfo[houseid][hgZi], houseid, HouseInfo[houseid][hIntIn]);
  6925.  
  6926. SendClientMessage(playerid, COLOR_WHITE, "Garage exit has been set!");
  6927.  
  6928. SaveHouse(houseid);
  6929. }
  6930. case 560:
  6931. {
  6932. if(!response) return 1;
  6933.  
  6934. if(GetPlayerMoneyEx(playerid) < GARAGE_BARESWITCH_COST) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to do this.");
  6935.  
  6936. new houseid = GetPVarInt(playerid, "HouseKey");
  6937.  
  6938. if(GetPVarInt(playerid, "GarageEnter") != GetPVarInt(playerid, "HouseKey") && !IsPlayerInRangeOfPoint(playerid, 5.0, HouseInfo[houseid][hgXo], HouseInfo[houseid][hgYo], HouseInfo[houseid][hgZo])) return SendClientMessage(playerid, COLOR_GREY, "You are not near your garage.");
  6939.  
  6940. // CallRemoteFunction("GivePlayerMoneyEx","ii", playerid, -GARAGE_BARESWITCH_COST);
  6941.  
  6942. GivePlayerMoneyEx(playerid, -GARAGE_BARESWITCH_COST);
  6943.  
  6944. new string3[32];
  6945. format(string3, sizeof(string3),"~r~-%s", FormatMoney(GARAGE_BARESWITCH_COST));
  6946. GameTextForPlayer(playerid, string3, 5000, 1);
  6947.  
  6948. if(GetPVarInt(playerid, "GarageEnter") != 0)
  6949. {
  6950. HouseInfo[houseid][gInterior] = 1;
  6951. HouseInfo[houseid][hgXi] = 1402.7845;
  6952. HouseInfo[houseid][hgYi] = 1.9748;
  6953. HouseInfo[houseid][hgZi] = 1000.9152;
  6954. HouseInfo[houseid][hgAi] = 182.1760;
  6955.  
  6956. SaveHouse(houseid);
  6957.  
  6958. SendClientMessage(playerid, COLOR_WHITE, "Garage has been reset!");
  6959.  
  6960. SetPlayerPosEx(playerid, HouseInfo[houseid][hgXi], HouseInfo[houseid][hgYi], HouseInfo[houseid][hgZi]);
  6961. SetPlayerInterior(playerid, HouseInfo[houseid][gInterior]);
  6962. }
  6963. else
  6964. {
  6965. HouseInfo[houseid][gInterior] = 1;
  6966. HouseInfo[houseid][hgXi] = 1402.7845;
  6967. HouseInfo[houseid][hgYi] = 1.9748;
  6968. HouseInfo[houseid][hgZi] = 1000.9152;
  6969. HouseInfo[houseid][hgAi] = 182.1760;
  6970.  
  6971. SaveHouse(houseid);
  6972.  
  6973. SendClientMessage(playerid, COLOR_WHITE, "Garage has been reset!");
  6974. }
  6975. }
  6976. case 561:
  6977. {
  6978. if(!response) return 1;
  6979.  
  6980. new houseid = GetPVarInt(playerid, "HouseKey");
  6981.  
  6982. if(HouseInfo[houseid][Garage] == 0) return SendClientMessage(playerid, COLOR_GREY, "You don't have a garage to remove.");
  6983.  
  6984. HouseInfo[houseid][Garage] = 0;
  6985. HouseInfo[houseid][gInterior] = 0;
  6986. HouseInfo[houseid][hgXi] = 0;
  6987. HouseInfo[houseid][hgYi] = 0;
  6988. HouseInfo[houseid][hgZi] = 0;
  6989. HouseInfo[houseid][hgAi] = 0;
  6990. HouseInfo[houseid][hgXo] = 0;
  6991. HouseInfo[houseid][hgYo] = 0;
  6992. HouseInfo[houseid][hgZo] = 0;
  6993. HouseInfo[houseid][hgAo] = 0;
  6994.  
  6995. if(HouseInfo[houseid][gIcon] != 0) DestroyDynamicCP(HouseInfo[houseid][gIcon]);
  6996.  
  6997. SaveHouse(houseid);
  6998.  
  6999. SendClientMessage(playerid, COLOR_WHITE, "Garage has been removed!");
  7000. }
  7001. case 562:
  7002. {
  7003. if(response)
  7004. {
  7005. if(CheckInv(playerid) == 0)
  7006. {
  7007. SetPVarInt(playerid, "Dividing", 0);
  7008. SetPVarInt(playerid, "DividingChose", 0);
  7009. return SendClientMessage(playerid, COLOR_GREY, "Your inventory is full.");
  7010. }
  7011.  
  7012. if(!IsNumeric(inputtext))
  7013. {
  7014. SetPVarInt(playerid, "Dividing", 0);
  7015. SetPVarInt(playerid, "DividingChose", 0);
  7016. return SendClientMessage(playerid, COLOR_GREY, "Invalid value.");
  7017. }
  7018.  
  7019. if(strval(inputtext) <= 0 || strval(inputtext) >= PlayerInfo[playerid][pInvQ][GetPVarInt(playerid, "DividingChose")])
  7020. {
  7021. SetPVarInt(playerid, "Dividing", 0);
  7022. SetPVarInt(playerid, "DividingChose", 0);
  7023. return SendClientMessage(playerid, COLOR_GREY, "Invalid value.");
  7024. }
  7025.  
  7026. PlayerInfo[playerid][pInvQ][GetPVarInt(playerid, "DividingChose")] -= strval(inputtext);
  7027. GiveInvItem(playerid, PlayerInfo[playerid][pInvItem][GetPVarInt(playerid, "DividingChose")], strval(inputtext), 0);
  7028.  
  7029. SetPVarInt(playerid, "Dividing", 0);
  7030. SetPVarInt(playerid, "DividingChose", 0);
  7031.  
  7032. SendClientMessage(playerid, COLOR_WHITE, "Item divided!");
  7033. }
  7034. return 1;
  7035. }
  7036. case 563: //Edit color
  7037. {
  7038. if(!response) return 1;
  7039. if(ToyInfo[playerid][listitem][tModel] != 0 && IsPlayerAttachedObjectSlotUsed(playerid, listitem)) {
  7040. SetPVarInt(playerid, "ColorToy", listitem);
  7041. ShowPlayerDialog(playerid, 564, DIALOG_STYLE_LIST, "Choose a layer.", "First\nSecond", "Select", "Close");
  7042. }
  7043. else error(playerid, "You have no equipped item in this slot.");
  7044. return 1;
  7045. }
  7046. case 564: //Edit color #2 (Layer)
  7047. {
  7048. if(!response) {
  7049. DeletePVar(playerid, "ColorToy");
  7050. return 1;
  7051. }
  7052. SetPVarInt(playerid, "ColorToyL", listitem);
  7053. new diatxt[564];
  7054. for (new i=0; i < sizeof(ARGBColors); i++) {
  7055. format(diatxt, 564, "%s%s\n", diatxt, ARGBColors[i][Name]);
  7056. }
  7057. ShowPlayerDialog(playerid, 565, DIALOG_STYLE_LIST, "Choose a color.", diatxt, "Select", "Close");
  7058. return 1;
  7059. }
  7060. case 565: //Edit color #3 (Final)
  7061. {
  7062. if(!response) {
  7063. DeletePVar(playerid, "ColorToy");
  7064. DeletePVar(playerid, "ColorToyL");
  7065. return 1;
  7066. }
  7067. SetToyColor(playerid, GetPVarInt(playerid, "ColorToy"), GetPVarInt(playerid, "ColorToyL"), listitem);
  7068. DeletePVar(playerid, "ColorToy");
  7069. DeletePVar(playerid, "ColorToyL");
  7070. }
  7071. case DIALOG_PAYMENT: {
  7072. if(!response) return 1;
  7073. if(listitem == 0) {
  7074. CallRemoteFunction("PurchaseItem","iiii", playerid, GetPVarInt(playerid, "PDBT"), GetPVarInt(playerid, "PDBTLI"), 1);
  7075. } else CallRemoteFunction("PurchaseItem","iiii", playerid, GetPVarInt(playerid, "PDBT"), GetPVarInt(playerid, "PDBTLI"), 2);
  7076. }
  7077. case DIALOG_HOUSE_REMOVEALL: {
  7078. if(!response) return 1;
  7079. new allow = FurnRight(playerid, 1);
  7080. if(allow > 0) {
  7081. RemoveHouseObjects(allow);
  7082. SendClientMessage(playerid, COLOR_WHITE, "All house furniture objects removed!");
  7083. }
  7084. }
  7085. case DIALOG_BUSINESS_REMOVEALL: {
  7086. if(!response) return 1;
  7087. new allow = FurnRight(playerid, 2);
  7088. if(allow > 0) {
  7089. RemoveBizzObjects(allow);
  7090. SendClientMessage(playerid, COLOR_WHITE, "All business furniture objects removed!");
  7091. }
  7092. }
  7093. case FUEL_DIALOG_FILL_GASCAN: {
  7094. if(!response) {
  7095. DeletePVar(playerid, "GC_ItemSlot");
  7096. return 1;
  7097. }
  7098. new slot = GetPVarInt(playerid, "GC_ItemSlot");
  7099. if(PlayerInfo[playerid][pInvItem][slot] != 1008) {
  7100. DeletePVar(playerid, "GC_ItemSlot");
  7101. return 1;
  7102. }
  7103. SetPVarInt(playerid, "GC_FillType", listitem);
  7104. format(string, sizeof(string), "Max: %dL", (100-PlayerInfo[playerid][pInvQ][slot]));
  7105. ShowPlayerDialog(playerid, FUEL_DIALOG_FILL_GASAMT, DIALOG_STYLE_INPUT, "How many litres?", string, "Fill", "Cancel");
  7106. }
  7107. case FUEL_DIALOG_FILL_GASAMT: {
  7108. if(!response) {
  7109. DeletePVar(playerid, "GC_ItemSlot");
  7110. DeletePVar(playerid, "GC_FillType");
  7111. return 1;
  7112. }
  7113. new amt = strval(inputtext);
  7114. if(amt < 1 || amt > 100) return SendClientMessage(playerid, COLOR_GREY, "You can only fill between 1 and 100 litres of fuel.");
  7115. new slot = GetPVarInt(playerid, "GC_ItemSlot");
  7116. if(PlayerInfo[playerid][pInvItem][slot] != 1008) {
  7117. DeletePVar(playerid, "GC_ItemSlot");
  7118. DeletePVar(playerid, "GC_FillType");
  7119. return 1;
  7120. }
  7121. if(PlayerInfo[playerid][pInvEx][slot] != -1 && (PlayerInfo[playerid][pInvEx][slot] != GetPVarInt(playerid, "GC_FillType"))) {
  7122. DeletePVar(playerid, "GC_ItemSlot");
  7123. DeletePVar(playerid, "GC_FillType");
  7124. return SendClientMessage(playerid, COLOR_GREY, "You can't mix different fuel types in a gas can.");
  7125. }
  7126. if(amt > (100-PlayerInfo[playerid][pInvQ][slot])) {
  7127. SendClientMessage(playerid, COLOR_GREY, "This gas can can't hold that much fuel.");
  7128. format(string, sizeof(string), "Max: %dL", (100-PlayerInfo[playerid][pInvQ][slot]));
  7129. return ShowPlayerDialog(playerid, FUEL_DIALOG_FILL_GASAMT, DIALOG_STYLE_INPUT, "How many litres?", string, "Fill", "Cancel");
  7130. }
  7131. PlayerInfo[playerid][pInvEx][slot] = GetPVarInt(playerid, "GC_FillType");
  7132. PlayerInfo[playerid][pInvQ][slot] = PlayerInfo[playerid][pInvQ][slot] + amt;
  7133. DeletePVar(playerid, "GC_ItemSlot");
  7134. OnPlayerDataSave(playerid);
  7135. format(sendername, sizeof(sendername), "%s", PlayerNameEx(playerid));
  7136. GiveNameSpace(sendername);
  7137. format(string, sizeof(string), "*** %s fills the gas can with some %s {C2A2DA}fuel.", sendername, FuelName(GetPVarInt(playerid, "GC_FillType")));
  7138. ProxDetector(30.0, playerid, string, COLOR_PURPLE);
  7139. DeletePVar(playerid, "GC_FillType");
  7140. }
  7141. case FISHING_DIALOG_SELL: {
  7142. if(!response) {
  7143. ResetFishingCP(playerid);
  7144. return 1;
  7145. }
  7146. if(PlayerInfo[playerid][pInvItem][listitem] < FISHING_LOWEST_ID || PlayerInfo[playerid][pInvItem][listitem] > FISHING_HIGHEST_ID) {
  7147. SellFish(playerid);
  7148. return SendClientMessage(playerid, COLOR_WHITE, "You can only sell fish!");
  7149. }
  7150. new payout = GetFishPrice(PlayerInfo[playerid][pInvItem][listitem], PlayerInfo[playerid][pInvEx][listitem]); //probably unneccesary to store this in memory, may be better to call twice but the more fish we add the more we want to store this in memory.
  7151. GivePlayerMoneyEx(playerid, payout);
  7152. format(string, sizeof(string), "You've sold this %s for $%d.", PrintIName(PlayerInfo[playerid][pInvItem][listitem]), payout);
  7153. RemoveInvItem(playerid, PlayerInfo[playerid][pInvItem][listitem], 0, listitem);
  7154. SendClientMessage(playerid, COLOR_WHITE, string);
  7155. SellFish(playerid);
  7156. }
  7157. case DIALOG_VEHICLE_RELEASE: {
  7158. if(!response) return 1;
  7159. new query[124];
  7160. mysql_format(handlesql, query, sizeof(query), "SELECT ID,Model,Impounded FROM vehicles WHERE Owner='%s' AND Impounded > 0 LIMIT %i, %i", PlayerInfo[playerid][pUsername], listitem, listitem+1);
  7161. mysql_tquery(handlesql, query, "OnVehicleReleased", "i", playerid);
  7162. }
  7163. case DIALOG_BOLO: {
  7164. switch(listitem)
  7165. {
  7166. case 0: // View Bolo's
  7167. {
  7168. ShowPlayerDialog(playerid,DIALOG_BOLO,DIALOG_STYLE_LIST,"Bolo Menu","View Bolo's\nAdd Bolo\nRemove Bolo\nExit","Select", "");
  7169. new found = 0;
  7170. for(new i=0;i<sizeof(BoloInfo);i++)
  7171. {
  7172. if(BoloInfo[i][bUsed] == 1)
  7173. {
  7174. found++;
  7175. break;
  7176. }
  7177. }
  7178. if(found == 0) return SendClientMessage(playerid,COLOR_BLUE,"BOLO: No bolo's available.");
  7179. SendClientMessage(playerid,COLOR_WHITE,"BOLO List:");
  7180. for(new i = 0; i < sizeof(BoloInfo); i++)
  7181. {
  7182. if(BoloInfo[i][bUsed] == 1)
  7183. {
  7184. format(string, 256, "BOLO %d - %s: %s", i+1, GetNameWithSpace(BoloInfo[i][bOfficer]), BoloInfo[i][bString]);
  7185. SendClientMessage(playerid, COLOR_BLUE, string);
  7186. }
  7187. }
  7188. }
  7189. case 1: // Add Bolo
  7190. {
  7191. new found = 0;
  7192. for(new i=0;i<sizeof(BoloInfo);i++)
  7193. {
  7194. if(BoloInfo[i][bUsed] == 0)
  7195. {
  7196. found++;
  7197. break;
  7198. }
  7199. }
  7200. if(found == 0)
  7201. {
  7202. ShowPlayerDialog(playerid,DIALOG_BOLO,DIALOG_STYLE_LIST,"Bolo Menu","View Bolo's\nAdd Bolo\nRemove Bolo\nExit","Select", "");
  7203. return SendClientMessage(playerid,COLOR_BLUE,"There is no bolo slots available.");
  7204. }
  7205. ShowPlayerDialog(playerid,DIALOG_BOLO_ADD,DIALOG_STYLE_INPUT,"Bolo Add","- Enter your text here -","Enter", "Go Back");
  7206. }
  7207. case 2: ShowPlayerDialog(playerid,DIALOG_BOLO_REMOVE,DIALOG_STYLE_LIST,"Bolo Remove","ID - 1\nID - 2\nID - 3\nID - 4\nID - 5\nID - 6\nID - 7\nID - 8\nID - 9\nID - 10","Select", "Go Back");
  7208. }
  7209. }
  7210. case DIALOG_BOLO_ADD: {
  7211. switch(response)
  7212. {
  7213. case 0: ShowPlayerDialog(playerid,DIALOG_BOLO,DIALOG_STYLE_LIST,"Bolo Menu","View Bolo's\nAdd Bolo\nRemove Bolo\nExit","Select", "");
  7214. case 1: // Add Bolo
  7215. {
  7216. new foundid = -1;
  7217. for(new i=0;i<sizeof(BoloInfo);i++) {
  7218. if(BoloInfo[i][bUsed] == 0) {
  7219. foundid=i;
  7220. break;
  7221. }
  7222. }
  7223. if(foundid == -1) {
  7224. ShowPlayerDialog(playerid,DIALOG_BOLO,DIALOG_STYLE_LIST,"Bolo Menu","View Bolo's\nAdd Bolo\nRemove Bolo\nExit","Select", "");
  7225. return SendClientMessage(playerid,COLOR_BLUE,"There is no bolo slots available.");
  7226. }
  7227. if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_BOLO_ADD,DIALOG_STYLE_INPUT,"Bolo","- Enter your text here -","Enter", "Go Back");
  7228. if(strlen(inputtext) >= 128) {
  7229. SendClientMessage(playerid, COLOR_WHITE, "Text is too long (max 128 chars).");
  7230. ShowPlayerDialog(playerid,DIALOG_BOLO_ADD,DIALOG_STYLE_INPUT,"Bolo","- Enter your text here -","Enter", "Go Back");
  7231. return 1;
  7232. }
  7233. BoloInfo[foundid][bUsed]=1;
  7234.  
  7235. format(BoloInfo[foundid][bOfficer], MAX_PLAYER_NAME, "%s", PlayerInfo[playerid][pUsername]);
  7236.  
  7237. strmid(BoloInfo[foundid][bString], inputtext, 0, strlen(inputtext), 255);
  7238. format(string, 256, "BOLO: %s set a bolo: (%s).", PlayerInfo[playerid][pUsername], inputtext);
  7239. SendFactionMessage(1,COLOR_BLUE,string);
  7240. ShowPlayerDialog(playerid,DIALOG_BOLO,DIALOG_STYLE_LIST,"Bolo Menu","View Bolo's\nAdd Bolo\nRemove Bolo\nExit","Select", "");
  7241. }
  7242. }
  7243. }
  7244. case DIALOG_BOLO_REMOVE: {
  7245. switch(response) {
  7246. case 0: ShowPlayerDialog(playerid,DIALOG_BOLO,DIALOG_STYLE_LIST,"Bolo Menu","View Bolo's\nAdd Bolo\nRemove Bolo\nExit","Select", "");
  7247. case 1:
  7248. {
  7249. ShowPlayerDialog(playerid,DIALOG_BOLO_REMOVE,DIALOG_STYLE_LIST,"Bolo Remove","ID - 1\nID - 2\nID - 3\nID - 4\nID - 5\nID - 6\nID - 7\nID - 8\nID - 9\nID - 10","Select", "Go Back");
  7250. if(BoloInfo[listitem][bUsed] == 0)
  7251. {
  7252. format(string, sizeof(string), "Bolo ID: (%d) is not being used.", listitem+1);
  7253. SendClientMessage(playerid,COLOR_WHITE,string);
  7254. return 1;
  7255. }
  7256. format(string, 256, "BOLO: %s removed bolo: (%s).", PlayerInfo[playerid][pUsername], BoloInfo[listitem][bString]);
  7257. SendFactionMessage(1,COLOR_BLUE,string);
  7258. BoloInfo[listitem][bUsed]=0;
  7259. strmid(BoloInfo[listitem][bString], "None", 0, strlen("None"), 255);
  7260. }
  7261. }
  7262. }
  7263. case DIALOG_FURN_DELETE_HOUSE: {
  7264. if(!response) {
  7265. DeletePVar(playerid, "FurnDeleteKey");
  7266. DeletePVar(playerid, "FurnDeleteProperty");
  7267. return 1;
  7268. }
  7269. if(GetPVarInt(playerid, "Admin") < 7) {
  7270. DeletePVar(playerid, "FurnDeleteKey");
  7271. DeletePVar(playerid, "FurnDeleteProperty");
  7272. return 1;
  7273. }
  7274. new i = GetPVarInt(playerid, "FurnDeleteKey"), key2 = GetPVarInt(playerid, "FurnDeleteProperty");
  7275. if(IsValidDynamicObject(HouseInfo[key2][hObject][i])) DestroyDynamicObject(HouseInfo[key2][hObject][i]);
  7276. HouseInfo[key2][hObject][i] = 0;
  7277. HouseInfo[key2][hoID][i] = 0;
  7278. HouseInfo[key2][hoX][i] = 0.0;
  7279. HouseInfo[key2][hoY][i] = 0.0;
  7280. HouseInfo[key2][hoZ][i] = 0.0;
  7281. HouseInfo[key2][horX][i] = 0.0;
  7282. HouseInfo[key2][horY][i] = 0.0;
  7283. HouseInfo[key2][horZ][i] = 0.0;
  7284. HouseInfo[key2][hoInt][i] = 0;
  7285. SendClientMessage(playerid, COLOR_WHITE, "Furniture object removed.");
  7286. SaveFurnObj(key2, i);
  7287. DeletePVar(playerid, "FurnDeleteKey");
  7288. DeletePVar(playerid, "FurnDeleteProperty");
  7289. }
  7290. case DIALOG_FURN_DELETE_BUSINESS: {
  7291. if(!response) {
  7292. DeletePVar(playerid, "FurnDeleteKey");
  7293. DeletePVar(playerid, "FurnDeleteProperty");
  7294. return 1;
  7295. }
  7296. if(GetPVarInt(playerid, "Admin") < 7) {
  7297. DeletePVar(playerid, "FurnDeleteKey");
  7298. DeletePVar(playerid, "FurnDeleteProperty");
  7299. return 1;
  7300. }
  7301. new i = GetPVarInt(playerid, "FurnDeleteKey"), key2 = GetPVarInt(playerid, "FurnDeleteProperty");
  7302. if(IsValidDynamicObject(BizInfo[key2][bObject][i])) DestroyDynamicObject(BizInfo[key2][bObject][i]);
  7303. BizInfo[key2][bObject][i] = 0;
  7304. BizInfo[key2][boID][i] = 0;
  7305. BizInfo[key2][boX][i] = 0.0;
  7306. BizInfo[key2][boY][i] = 0.0;
  7307. BizInfo[key2][boZ][i] = 0.0;
  7308. BizInfo[key2][borX][i] = 0.0;
  7309. BizInfo[key2][borY][i] = 0.0;
  7310. BizInfo[key2][borZ][i] = 0.0;
  7311. BizInfo[key2][boInt][i] = 0;
  7312. SendClientMessage(playerid, COLOR_WHITE, "Furniture object removed.");
  7313. SaveBizzObj(key2, i);
  7314. DeletePVar(playerid, "FurnDeleteKey");
  7315. DeletePVar(playerid, "FurnDeleteProperty");
  7316. }
  7317. case DIALOG_TAG_DELETE: {
  7318. if(!response) {
  7319. DeletePVar(playerid, "TagDeleteMember");
  7320. DeletePVar(playerid, "TagDeleteIndex");
  7321. return 1;
  7322. }
  7323. if(GetPVarInt(playerid, "Admin") < 1) {
  7324. DeletePVar(playerid, "TagDeleteMember");
  7325. DeletePVar(playerid, "TagDeleteIndex");
  7326. return 1;
  7327. }
  7328. SprayTag_ClearEx(GetPVarInt(playerid, "TagDeleteMember"), GetPVarInt(playerid, "TagDeleteIndex"));
  7329. SendClientMessage(playerid, COLOR_LIGHTBLUE, "Tag removed!");
  7330. DeletePVar(playerid, "TagDeleteMember");
  7331. DeletePVar(playerid, "TagDeleteIndex");
  7332. }
  7333. case DIALOG_TAG_DELETEALL: {
  7334. if(!response) {
  7335. DeletePVar(playerid, "TagDeleteMember");
  7336. return 1;
  7337. }
  7338. if(GetPVarInt(playerid, "Admin") < 1) {
  7339. DeletePVar(playerid, "TagDeleteMember");
  7340. return 1;
  7341. }
  7342. new member = GetPVarInt(playerid, "TagDeleteMember");
  7343. for(new i = 0; i < MAX_FACTION_TAGS; i++) {
  7344. if(IsValidDynamicObject(SprayTags[member][i][_spObject])) {
  7345. SprayTag_ClearEx(member, i);
  7346. }
  7347. }
  7348. format(string, sizeof(string), "AdmCmd: %s removed all spray-tags belonging to faction %s.", AdminName(playerid), FactionInfo[member][fName]);
  7349. SendAdminMessage(COLOR_ORANGE, string);
  7350. format(string, sizeof(string), "[NOTICE] {FFFFFF}%s removed all spray-tags belonging to your faction.", AdminName(playerid));
  7351. SendFactionMessage(member, COLOR_ORANGE, string);
  7352. DeletePVar(playerid, "TagDeleteMember");
  7353. }
  7354. case DIALOG_VEHICLE_FURN_CREATE: {
  7355. if(!response) {
  7356. DeletePVar(playerid, "FurnVehicleID");
  7357. return 1;
  7358. }
  7359. new vehicleid = GetPVarInt(playerid, "FurnVehicleID");
  7360. DeletePVar(playerid, "FurnVehicleID");
  7361. if(vehicleid == 0) { return 1; } //Just incase.
  7362. if(!CanFurnishVehicle(playerid, vehicleid)) { return 1; }
  7363. new cost = 250;
  7364. if(GetPVarInt(playerid, "MonthDon") > 0) { cost = 0; }
  7365. if(IsNeonObject(PlayerInfo[playerid][pFurnID])) { cost = 2500; }
  7366. if(GetPlayerMoneyEx(playerid) >= cost) {
  7367. new indoor = 1;
  7368. if(PlayerInfo[playerid][pInVehicle] == -1) { //Outside.
  7369. indoor = 0;
  7370. new Float:pos[3];
  7371. GetVehiclePos(vehicleid, pos[0], pos[1], pos[2]);
  7372. new Float:distance = GetDistanceFromPointToPoint(PlayerInfo[playerid][pFurn][0], PlayerInfo[playerid][pFurn][1], PlayerInfo[playerid][pFurn][2], pos[0], pos[1], pos[2]);
  7373. if(distance > VEHICLE_PLANT_DISTANCE) {
  7374. scm(playerid, COLOR_LIGHTRED, "WARNING: Object is too far from the vehicle and could not be planted!");
  7375. return 1;
  7376. } else { SendClientMessage(playerid, COLOR_ORANGE, "[NOTICE] {FFFFFF}Abuse of vehicle-attachments will result in a ban."); }
  7377. }
  7378. if(GetPlayerVirtualWorld(playerid) == 0) { indoor = 0; } //Just in-case since we know no vehicle occupies ID 0.
  7379. format(string, sizeof(string),"~r~-$%d", cost);
  7380. GameTextForPlayer(playerid, string, 5000, 1);
  7381. GivePlayerMoneyEx(playerid, -cost);
  7382. BuildVehicleObject(playerid, vehicleid, PlayerInfo[playerid][pFurnID], PlayerInfo[playerid][pFurn][0], PlayerInfo[playerid][pFurn][1], PlayerInfo[playerid][pFurn][2], PlayerInfo[playerid][pFurnR][0], PlayerInfo[playerid][pFurnR][1], PlayerInfo[playerid][pFurnR][2], indoor);
  7383. } else SendClientMessage(playerid, COLOR_LIGHTRED, "Insufficient funds!");
  7384. }
  7385. case DIALOG_VEHICLE_FURN_REMOVE_CONFIRM: {
  7386. if(!response) {
  7387. DeletePVar(playerid, "FurnVehicleID");
  7388. DeletePVar(playerid, "FurnVehicleKey");
  7389. return 1;
  7390. }
  7391. if(GetPVarInt(playerid, "Admin") < 4) {
  7392. DeletePVar(playerid, "FurnVehicleID");
  7393. DeletePVar(playerid, "FurnVehicleKey");
  7394. return 1;
  7395. }
  7396. DeleteVehicleObject(GetPVarInt(playerid, "FurnVehicleID"), GetPVarInt(playerid, "FurnVehicleKey"));
  7397. SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vehicle object removed!");
  7398. DeletePVar(playerid, "FurnVehicleID");
  7399. DeletePVar(playerid, "FurnVehicleKey");
  7400. }
  7401. case DIALOG_VEHICLE_FURN_REMOVEALL_CONFIRM: {
  7402. if(!response) {
  7403. DeletePVar(playerid, "FurnVehicleID");
  7404. return 1;
  7405. }
  7406. if(GetPVarInt(playerid, "Admin") < 4) {
  7407. DeletePVar(playerid, "FurnVehicleID");
  7408. return 1;
  7409. }
  7410. new vehicleid = GetPVarInt(playerid, "FurnVehicleID");
  7411. DeletePVar(playerid, "FurnVehicleID");
  7412. if(vehicleid == 0) { return 1; } //Just incase.
  7413. for(new slot = 0; slot < MAX_VEHICLE_OBJ; slot++) {
  7414. if(VehicleInfo[vehicleid][voID][slot] != 0) {
  7415. DeleteVehicleObject(vehicleid, slot);
  7416. }
  7417. }
  7418. SendClientMessage(playerid, COLOR_LIGHTBLUE, "All vehicle objects removed!");
  7419. }
  7420. case DIALOG_VEHFURN_EDIT: {
  7421. if(!response) {
  7422. DeletePVar(playerid, "CurEditMdl");
  7423. return 1;
  7424. }
  7425. new count = 0, vehicleid = GetPVarInt(playerid, "FurnVehicleID"), editmdl = GetPVarInt(playerid, "CurEditMdl");
  7426. for(new slot = 0; slot < MAX_VEHICLE_OBJ; slot++) {
  7427. if(VehicleInfo[vehicleid][voID][slot] == editmdl) {
  7428. if(PlayerInfo[playerid][pInVehicle] != -1) {
  7429. if(VehicleInfo[vehicleid][voIndoor][slot] == 1) {
  7430. if(count >= listitem)
  7431. {
  7432. CallRemoteFunction("SelectVehObj", "ii", playerid, slot);
  7433. break;
  7434. }
  7435. count++;
  7436. }
  7437. } else {
  7438. if(outdoor_vehicle_furn == 0) { break; }
  7439. if(VehicleInfo[vehicleid][voIndoor][slot] == 0) {
  7440. if(count >= listitem)
  7441. {
  7442. CallRemoteFunction("SelectVehObj", "ii", playerid, slot);
  7443. break;
  7444. }
  7445. count++;
  7446. }
  7447. }
  7448. }
  7449. }
  7450. DeletePVar(playerid, "CurEditMdl");
  7451. }
  7452. case DIALOG_VEHICLE_FURN_SELECT: {
  7453. if(GetPVarInt(playerid, "PlayerLogged") != 1) return true;
  7454. if(!response) {
  7455. DeletePVar(playerid, "FurnVehicleID");
  7456. DeletePVar(playerid, "FurnVehicleKey");
  7457. return 1;
  7458. }
  7459. new vehicleid = GetPVarInt(playerid, "FurnVehicleID"), slot = GetPVarInt(playerid, "FurnVehicleKey");
  7460. if(!IsValidDynamicObject(VehicleInfo[vehicleid][vObject][slot]) || !CanFurnishVehicle(playerid, vehicleid)) {
  7461. DeletePVar(playerid, "FurnVehicleID");
  7462. DeletePVar(playerid, "FurnVehicleKey");
  7463. return 1;
  7464. }
  7465. new furnid = 0, furnitname[100];
  7466. furnitname="N/A";
  7467. for(new xe; xe<sizeof(FurnObjs) ;xe++) {
  7468. if(VehicleInfo[vehicleid][voID][slot] == FurnObjs[xe]) {
  7469. format(furnitname, 100, "%d", FurnObjs[xe]);
  7470. furnid=xe;
  7471. break;
  7472. }
  7473. }
  7474. switch(listitem) {
  7475. case 0: // Edit Object
  7476. {
  7477. new obj = 0, Float:pos[3];
  7478. if(VehicleInfo[vehicleid][voIndoor][slot] == 1) { //Indoor.
  7479. new Float:rot[3];
  7480. GetDynamicObjectPos(VehicleInfo[vehicleid][vObject][slot], pos[0], pos[1], pos[2]);
  7481. GetDynamicObjectRot(VehicleInfo[vehicleid][vObject][slot], rot[0], rot[1], rot[2]);
  7482. obj = CreatePlayerObject(playerid, VehicleInfo[vehicleid][voID][slot], pos[0], pos[1], pos[2], rot[0], rot[1], rot[2], 100.0);
  7483. } else { //Outdoor.
  7484. GetVehicleRelativePos(vehicleid, pos[0], pos[1], pos[2], VehicleInfo[vehicleid][voX][slot], VehicleInfo[vehicleid][voY][slot], VehicleInfo[vehicleid][voZ][slot]);
  7485. new Float:vRotZ;
  7486. GetVehicleZAngle(vehicleid, vRotZ);
  7487. obj = CreatePlayerObject(playerid, VehicleInfo[vehicleid][voID][slot], pos[0], pos[1], pos[2], VehicleInfo[vehicleid][vorX][slot], VehicleInfo[vehicleid][vorY][slot], VehicleInfo[vehicleid][vorZ][slot]+vRotZ, 100.0);
  7488. }
  7489. DestroyVehicleObject(vehicleid, slot);
  7490. SetPVarInt(playerid, "FurnObject", obj);
  7491. SetPVarInt(playerid, "EditorMode", EDITOR_MODE_VEHICLEFURN_EDIT);
  7492. PlayerInfo[playerid][pFurnID] = furnid;
  7493. EditPlayerObject(playerid, obj);
  7494. format(string, sizeof(string),"%s selected, use the SPRINT key to navigate.", furnitname);
  7495. SendClientMessage(playerid, COLOR_WHITE, string);
  7496. }
  7497. case 1: // Select Material
  7498. {
  7499. SendClientMessage(playerid,COLOR_LIGHTRED,"WARNING: Editing an invalid-layer MAY cause parts of the object to turn invisible, resetting the layers material will fix this.");
  7500. SendClientMessage(playerid,COLOR_LIGHTBLUE,"When you choose a layer to edit, that layer becomes highlighted in red.");
  7501. ShowPlayerDialog(playerid, DIALOG_VEHICLE_FURN_MLAYER, DIALOG_STYLE_LIST, "What layer do you want to edit?", "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12", "Select", "Close");
  7502. }
  7503. case 2: // Reset Material
  7504. {
  7505. for(new v=0; v < 13; v++) {
  7506. VehicleMInfo[vehicleid][slot][v] = 0;
  7507. }
  7508. DestroyVehicleObject(vehicleid, slot);
  7509. CreateVehicleObject(vehicleid, slot);
  7510. Streamer_Update(playerid);
  7511. SendClientMessage(playerid ,COLOR_LIGHTBLUE, "You've reset the selected objects material.");
  7512. SaveVehObj(vehicleid, slot);
  7513. DeletePVar(playerid, "FurnVehicleID");
  7514. DeletePVar(playerid, "FurnVehicleKey");
  7515. }
  7516. case 3: // Remove Object
  7517. {
  7518. DeleteVehicleObject(vehicleid, slot);
  7519. DeletePVar(playerid, "FurnVehicleID");
  7520. DeletePVar(playerid, "FurnVehicleKey");
  7521. }
  7522. }
  7523. }
  7524. case DIALOG_VEHICLE_FURN_MLAYER: { //What layer do you want to change? Material-editing.
  7525. if(!response) {
  7526. DeletePVar(playerid, "FurnVehicleID");
  7527. DeletePVar(playerid, "FurnVehicleKey");
  7528. return 1;
  7529. }
  7530. new vehicleid = GetPVarInt(playerid, "FurnVehicleID"), slot = GetPVarInt(playerid, "FurnVehicleKey");
  7531. SetPVarInt(playerid, "FurnEditL", listitem);
  7532. ChangeDynamicObjectMaterial(VehicleInfo[vehicleid][vObject][slot], listitem, 30);
  7533. new list[2048];
  7534. for(new i=0; i < sizeof(MaterialIDs); i++) {
  7535. format(list, 2048, "%s\n%s", list, MaterialIDs[i][Name]);
  7536. }
  7537. ShowPlayerDialog(playerid, DIALOG_VEHICLE_FURN_MATERIAL, DIALOG_STYLE_LIST, "Material List", list, "Select", "Back");
  7538. }
  7539. case DIALOG_VEHICLE_FURN_MATERIAL: { //Object Material List
  7540. new vehicleid = GetPVarInt(playerid, "FurnVehicleID"), slot = GetPVarInt(playerid, "FurnVehicleKey");
  7541. if(!response) {
  7542. DestroyVehicleObject(vehicleid, slot);
  7543. CreateVehicleObject(vehicleid, slot);
  7544. Streamer_Update(playerid);
  7545. DeletePVar(playerid, "FurnEditL");
  7546. return ShowPlayerDialog(playerid, DIALOG_VEHICLE_FURN_MLAYER, DIALOG_STYLE_LIST, "What layer do you want to edit?", "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12", "Select", "Close");
  7547. }
  7548. new layer = GetPVarInt(playerid,"FurnEditL");
  7549. if(listitem == 0) {
  7550. VehicleMInfo[vehicleid][slot][layer] = 0;
  7551. DestroyVehicleObject(vehicleid, slot);
  7552. CreateVehicleObject(vehicleid, slot);
  7553. Streamer_Update(playerid);
  7554. SaveVehObj(vehicleid, slot);
  7555. DeletePVar(playerid, "FurnEditL");
  7556. DeletePVar(playerid, "FurnVehicleID");
  7557. DeletePVar(playerid, "FurnVehicleKey");
  7558. format(string, sizeof(string), "Object %d's material layer %d reset to default.", VehicleInfo[vehicleid][vObject][slot], layer);
  7559. return SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  7560. }
  7561. VehicleMInfo[vehicleid][slot][layer] = listitem;
  7562. ChangeDynamicObjectMaterial(VehicleInfo[vehicleid][vObject][slot], layer, listitem);
  7563. SaveVehObj(vehicleid, slot);
  7564. format(string, sizeof(string), "Object %d's material layer %d changed to: '%s'.", VehicleInfo[vehicleid][vObject][slot], layer, MaterialIDs[listitem][Name]);
  7565. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  7566. DeletePVar(playerid, "FurnEditL");
  7567. DeletePVar(playerid, "FurnVehicleID");
  7568. DeletePVar(playerid, "FurnVehicleKey");
  7569. }
  7570. case DIALOG_VEHFURN_REMOVEALL_CONFIRM: {
  7571. if(!response) {
  7572. DeletePVar(playerid, "FurnVehicleID");
  7573. return 1;
  7574. }
  7575. new vehicleid = GetPVarInt(playerid, "FurnVehicleID");
  7576. if(!CanFurnishVehicle(playerid, vehicleid)) {
  7577. DeletePVar(playerid, "FurnVehicleID");
  7578. return 1;
  7579. }
  7580. for(new slot = 0; slot < MAX_VEHICLE_OBJ; slot++) {
  7581. if(VehicleInfo[vehicleid][voID][slot] != 0) {
  7582. DeleteVehicleObject(vehicleid, slot);
  7583. }
  7584. }
  7585. SendClientMessage(playerid, COLOR_LIGHTBLUE, "All vehicle objects deleted!");
  7586. DeletePVar(playerid, "FurnVehicleID");
  7587. }
  7588. case DIALOG_SIREN_EDITOR: {
  7589. if(response) {
  7590. switch(listitem)
  7591. {
  7592. case 0:
  7593. {
  7594. new count = 0;
  7595. for(new i = 0; i < MAX_VEHICLE_SIREN_OBJECTS; i++)
  7596. {
  7597. if(VehicleInfo[GetPlayerVehicleID(playerid)][vSirenObject][i] != 0)
  7598. {
  7599. count++;
  7600. }
  7601. }
  7602.  
  7603. if(count >= MAX_VEHICLE_SIREN_OBJECTS)
  7604. {
  7605. ShowPlayerDialog(playerid, DIALOG_SIREN_EDITOR, DIALOG_STYLE_LIST, "Siren Editor", "Add a siren\nRemove a siren", "Select","Exit");
  7606. SendClientMessage(playerid, COLOR_GREY, "You have reached the maximum ammount of attachable sirens per vehicle.");
  7607. return 1;
  7608. }
  7609.  
  7610. new object_array[sizeof(SirenObjects)];
  7611. for(new i = 0; i < sizeof(SirenObjects); i++)
  7612. {
  7613. object_array[i] = SirenObjects[i][0];
  7614. }
  7615.  
  7616. ShowModelSelectionMenuEx(playerid, object_array, sizeof(object_array), "Siren Editor", 18, 16.0, 0.0, -55.0);
  7617. }
  7618. case 1:
  7619. {
  7620. new count = 0;
  7621. for(new i = 0; i < MAX_VEHICLE_SIREN_OBJECTS; i++)
  7622. {
  7623. if(VehicleInfo[GetPlayerVehicleID(playerid)][vSirenObject][i] != 0)
  7624. {
  7625. count++;
  7626. }
  7627. }
  7628.  
  7629. if(count == 0)
  7630. {
  7631. ShowPlayerDialog(playerid, DIALOG_SIREN_EDITOR, DIALOG_STYLE_LIST, "Siren Editor", "Add a siren\nRemove a siren", "Select","Exit");
  7632. SendClientMessage(playerid, COLOR_GREY, "This vehicle has no siren objects to remove.");
  7633. return 1;
  7634. }
  7635.  
  7636. new vehicleid = GetPVarInt(playerid, "SirenEditorVehicleID");
  7637.  
  7638. for(new i = 0; i < MAX_VEHICLE_SIREN_OBJECTS; i++)
  7639. {
  7640. if(VehicleInfo[vehicleid][vSirenObject][i] != 0)
  7641. {
  7642. for(new i2 = 0; i2 < sizeof(SirenObjects); i2++)
  7643. {
  7644. if(VehicleInfo[vehicleid][vSirenObject][i] == SirenObjects[i2][0])
  7645. {
  7646. format(string, sizeof(string), "%s%s\n", string, SirenObjects[i2][1]);
  7647. }
  7648. }
  7649. }
  7650. }
  7651.  
  7652. ShowPlayerDialog(playerid, DIALOG_SIREN_EDITOR_REMOVE, DIALOG_STYLE_LIST, "Siren Editor", string, "Select","Back");
  7653. }
  7654. }
  7655. }
  7656. else
  7657. {
  7658. TogglePlayerControllable(playerid, 1);
  7659. }
  7660. return 1;
  7661. }
  7662. case DIALOG_SIREN_EDITOR_REMOVE:
  7663. {
  7664. if(response)
  7665. {
  7666. new vehicleid = GetPVarInt(playerid, "SirenEditorVehicleID");
  7667.  
  7668. DestroyDynamicObject(VehicleInfo[vehicleid][vSirenObjectID][listitem]);
  7669. VehicleInfo[vehicleid][vSirenObjectID][listitem] = 0;
  7670. VehicleInfo[vehicleid][vSirenObject][listitem] = 0;
  7671.  
  7672. ShowPlayerDialog(playerid, DIALOG_SIREN_EDITOR, DIALOG_STYLE_LIST, "Siren Editor", "Add a siren\nRemove a siren", "Select","Exit");
  7673. TogglePlayerControllable(playerid, 0);
  7674. }
  7675. else
  7676. {
  7677. ShowPlayerDialog(playerid, DIALOG_SIREN_EDITOR, DIALOG_STYLE_LIST, "Siren Editor", "Add a siren\nRemove a siren", "Select","Exit");
  7678. }
  7679. return 1;
  7680. }
  7681. case SPRAYTAG_DIALOG_RETURN: SprayTag_Dialog(playerid, TYPE_LIST_MENU);
  7682. case SPRAYTAG_MENU:
  7683. {
  7684. if(!response) return 1;
  7685. switch(listitem)
  7686. {
  7687. case 0: SprayTag_Dialog(playerid, TYPE_LIST_TAGS_CREATE);
  7688. case 1: SprayTag_Dialog(playerid, TYPE_LIST_TAGS);
  7689. case 2: SprayTag_Dialog(playerid, TYPE_LIST_TAGS_DELETE);
  7690. case 3: SprayTag_Dialog(playerid, TYPE_LIST_TAGS_FIND);
  7691. }
  7692. }
  7693. case SPRAYTAG_EDIT_MAIN:
  7694. {
  7695. if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_MENU);
  7696. new member = GetPVarInt(playerid, "Member");
  7697. if(member == 0) return 1;
  7698. if(SprayTags[member][listitem][_spPosX] == 0.0) return ShowPlayerDialog(playerid, SPRAYTAG_DIALOG_RETURN, DIALOG_STYLE_MSGBOX, "{F7EC6F}Spray Tag - {BD0000} Oops!!", "Oops! There's nothing in this slot.", "Go back", "");
  7699. spraytag_slot[playerid] = listitem;
  7700. spraytag_bold[playerid] = SprayTags[member][listitem][_spBold];
  7701. spraytag_color[playerid] = SprayTags[member][listitem][_spFontColor];
  7702. format(spraytag_text[playerid], 128, SprayTags[member][listitem][_spText]);
  7703. format(spraytag_font[playerid], 50, SprayTags[member][listitem][_spFont]);
  7704. spraytag_size[playerid] = SprayTags[member][listitem][_spFontSize];
  7705. SprayTag_Dialog(playerid, TYPE_LIST_EDIT);
  7706. }
  7707. case SPRAYTAG_DELETE:
  7708. {
  7709. if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_MENU);
  7710. if(SprayTags[GetPVarInt(playerid, "Member")][listitem][_spPosX] == 0.0) return ShowPlayerDialog(playerid, SPRAYTAG_DIALOG_RETURN, DIALOG_STYLE_MSGBOX, "{F7EC6F}Spray Tag - {BD0000} Oops!!", "Oops! There's nothing in this slot.", "Go back", "");
  7711. new szMessage[60];
  7712. SprayTag_Clear(playerid, listitem);
  7713. format(szMessage, sizeof szMessage, "[Spray Tag] The spray tag #%i has been deleted successfully.", listitem);
  7714. SendClientMessage(playerid, -1, szMessage);
  7715. SprayTag_Dialog(playerid, TYPE_LIST_MENU);
  7716. }
  7717. case SPRAYTAG_FIND:
  7718. {
  7719. if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_MENU);
  7720. new member = GetPVarInt(playerid, "Member");
  7721. if(member == 0) return 1;
  7722. if(SprayTags[member][listitem][_spPosX] == 0.0) return ShowPlayerDialog(playerid, SPRAYTAG_DIALOG_RETURN, DIALOG_STYLE_MSGBOX, "{F7EC6F}Spray Tag - {BD0000} Oops!!", "Oops! There's nothing in this slot.", "Go back", "");
  7723. new szMessage[60];
  7724. spraytag_find[playerid] = 1;
  7725. SetPlayerCheckpoint(playerid, SprayTags[member][listitem][_spPosX], SprayTags[member][listitem][_spPosY], SprayTags[member][listitem][_spPosZ], 3.0);
  7726. SetPVarInt(playerid, "TagToFind", listitem);
  7727. format(szMessage, sizeof szMessage, "[Spray Tag] A checkpoint was marked for spraytag #%i.", listitem);
  7728. SendClientMessage(playerid, -1, szMessage);
  7729. }
  7730. case SPRAYTAG_CREATE:
  7731. {
  7732. if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_MENU);
  7733. if(SprayTags[GetPVarInt(playerid, "Member")][listitem][_spPosX] == 0.0)
  7734. {
  7735. spraytag_slot[playerid] = listitem;
  7736. format(spraytag_text[playerid], 128, "Example");
  7737. format(spraytag_font[playerid], 50, "Arial");
  7738. spraytag_color[playerid] = -1;
  7739. spraytag_size[playerid] = 24;
  7740. spraytag_bold[playerid] = 0;
  7741. SprayTag_Dialog(playerid, TYPE_LIST_CREATE);
  7742. } else ShowPlayerDialog(playerid, SPRAYTAG_DIALOG_RETURN, DIALOG_STYLE_MSGBOX, "{F7EC6F}Spray Tag - {BD0000} Oops!!", "Oops! This slot is already taken.", "Go back", "");
  7743. }
  7744. case SPRAYTAG_EDIT_LIST:
  7745. {
  7746. if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_TAGS);
  7747. new iIndex = spraytag_slot[playerid];
  7748. switch(listitem)
  7749. {
  7750. case 0: ShowPlayerDialog(playerid, SPRAYTAG_EDIT_TEXT, DIALOG_STYLE_INPUT, "{F7EC6F}Spray Tag - {469BF0}Text", "Enter the text you want to appear on the Spray Tag", "Submit", "Go back");
  7751. case 1: ShowPlayerDialog(playerid, SPRAYTAG_EDIT_FONT, DIALOG_STYLE_LIST, "{F7EC6F}Spray Tag - {469BF0}Font", "Arial\nCourier\nImpact\nPricedown\nDaredevil\nBombing\naaaiight! fat\nFrom Street Art\nGhang\nGraffogie\nGraphers Blog\nNosegrind Demo", "Submit", "Go back");
  7752. case 2: ShowPlayerDialog(playerid, SPRAYTAG_EDIT_SIZE, DIALOG_STYLE_INPUT, "{F7EC6F}Spray Tag - {469BF0}Size", "Enter the size you want this Spray Tag to be", "Submit", "Go back");
  7753. case 3: ShowPlayerDialog(playerid, SPRAYTAG_EDIT_COLOR, DIALOG_STYLE_LIST, "{F7EC6F}Spray Tag - {469BF0}Color", "{FF0000}Red\n{04B404}Green\n{00B5CD}Light Blue\n{FFFF00}Yellow\n{0000FF}Blue\n{848484}Gray\n{FF00FF}Pink\n{FFFFFF}White", "Submit", "Go back");
  7754. case 4:
  7755. {
  7756. switch(spraytag_bold[playerid])
  7757. {
  7758. case 0: spraytag_bold[playerid] = 1;
  7759. case 1: spraytag_bold[playerid] = 0;
  7760. }
  7761. SprayTag_Dialog(playerid, TYPE_LIST_EDIT);
  7762. }
  7763. case 5:
  7764. {
  7765. Streamer_Update(playerid);
  7766. EditDynamicObject(playerid, SprayTags[GetPVarInt(playerid, "Member")][iIndex][_spObject]);
  7767. SetPVarInt(playerid, "SPRAYTAG_EDIT", 2);
  7768. }
  7769. }
  7770. }
  7771. case SPRAYTAG_EDIT_TEXT:
  7772. {
  7773. if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_EDIT);
  7774. format(spraytag_text[playerid], 128, inputtext);
  7775. SprayTag_Dialog(playerid, TYPE_LIST_EDIT);
  7776. }
  7777. case SPRAYTAG_EDIT_FONT:
  7778. {
  7779. if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_EDIT);
  7780. format(spraytag_font[playerid], 32, inputtext);
  7781. SprayTag_Dialog(playerid, TYPE_LIST_EDIT);
  7782. }
  7783. case SPRAYTAG_EDIT_SIZE:
  7784. {
  7785. if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_EDIT);
  7786. spraytag_size[playerid] = strval(inputtext);
  7787. SprayTag_Dialog(playerid, TYPE_LIST_EDIT);
  7788. }
  7789. case SPRAYTAG_EDIT_COLOR:
  7790. {
  7791. if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_EDIT);
  7792. new iColor;
  7793. switch(listitem)
  7794. {
  7795. case 0: iColor = HexToInt("0xFFFF0000");
  7796. case 1: iColor = HexToInt("0xFF04B404");
  7797. case 2: iColor = HexToInt("0xFF00B5CD");
  7798. case 3: iColor = HexToInt("0xFFFFFF00");
  7799. case 4: iColor = HexToInt("0xFF0000FF");
  7800. case 5: iColor = HexToInt("0xFF848484");
  7801. case 6: iColor = HexToInt("0xFFFF00FF");
  7802. case 7: iColor = HexToInt("0xFFFFFFFF");
  7803. }
  7804. spraytag_color[playerid] = iColor;
  7805. SprayTag_Dialog(playerid, TYPE_LIST_EDIT);
  7806. }
  7807. case SPRAYTAG_CREATE_MAIN:
  7808. {
  7809. if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_TAGS_CREATE);
  7810. switch(listitem)
  7811. {
  7812. case 0: ShowPlayerDialog(playerid, SPRAYTAG_CREATE_TEXT, DIALOG_STYLE_INPUT, "{F7EC6F}Spray Tag - {469BF0}Text", "Enter the text you want to appear on the Spray Tag", "Submit", "Go back");
  7813. case 1: ShowPlayerDialog(playerid, SPRAYTAG_CREATE_FONT, DIALOG_STYLE_LIST, "{F7EC6F}Spray Tag - {469BF0}Font", "Arial\nCourier\nImpact\nPricedown\nDaredevil\nBombing\naaaiight! fat\nFrom Street Art\nGhang\nGraffogie\nGraphers Blog\nNosegrind Demo", "Submit", "Go back");
  7814. case 2: ShowPlayerDialog(playerid, SPRAYTAG_CREATE_SIZE, DIALOG_STYLE_INPUT, "{F7EC6F}Spray Tag - {469BF0}Size", "Enter the size you want this Spray Tag to be", "Submit", "Go back");
  7815. case 3: ShowPlayerDialog(playerid, SPRAYTAG_CREATE_COLOR, DIALOG_STYLE_LIST, "{F7EC6F}Spray Tag - {469BF0}Color", "{FF0000}Red\n{04B404}Green\n{00B5CD}Light Blue\n{FFFF00}Yellow\n{0000FF}Blue\n{848484}Gray\n{FF00FF}Pink\n{FFFFFF}White", "Submit", "Go back");
  7816. case 4:
  7817. {
  7818. switch(spraytag_bold[playerid])
  7819. {
  7820. case 0: spraytag_bold[playerid] = 1;
  7821. case 1: spraytag_bold[playerid] = 0;
  7822. }
  7823. SprayTag_Dialog(playerid, TYPE_LIST_CREATE);
  7824. }
  7825. case 5:
  7826. {
  7827. new Float:Position[3];
  7828. GetPlayerPos(playerid, Position[0], Position[1], Position[2]);
  7829. new tagobj = 19353;
  7830. if(strlen(spraytag_text[playerid]) > 25) { tagobj=19445; }
  7831. spraytag_object[playerid] = CreateDynamicObject(tagobj, Position[0]-1.0, Position[1], Position[2], 0.0, 0.0, 0.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), -1, SPRAY_TAG_OBJECT_DISTANCE);
  7832. SetDynamicObjectMaterialText(spraytag_object[playerid], 0, spraytag_text[playerid], OBJECT_MATERIAL_SIZE_512x512, spraytag_font[playerid], spraytag_size[playerid], spraytag_bold[playerid], spraytag_color[playerid], 0, 1);
  7833. Streamer_Update(playerid);
  7834. EditDynamicObject(playerid, spraytag_object[playerid]);
  7835. SetPVarInt(playerid, "SPRAYTAG_EDIT", 1);
  7836. }
  7837. }
  7838. }
  7839. case SPRAYTAG_CREATE_TEXT:
  7840. {
  7841. if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_CREATE);
  7842. format(spraytag_text[playerid], 128, inputtext);
  7843. SprayTag_Dialog(playerid, TYPE_LIST_CREATE);
  7844. }
  7845. case SPRAYTAG_CREATE_FONT:
  7846. {
  7847. if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_CREATE);
  7848. format(spraytag_font[playerid], 50, inputtext);
  7849. SprayTag_Dialog(playerid, TYPE_LIST_CREATE);
  7850. }
  7851. case SPRAYTAG_CREATE_SIZE:
  7852. {
  7853. if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_CREATE);
  7854. spraytag_size[playerid] = strval(inputtext);
  7855. SprayTag_Dialog(playerid, TYPE_LIST_CREATE);
  7856. }
  7857. case SPRAYTAG_CREATE_COLOR:
  7858. {
  7859. if(!response) return SprayTag_Dialog(playerid, TYPE_LIST_CREATE);
  7860. new iColor;
  7861. switch(listitem)
  7862. {
  7863. case 0: iColor = HexToInt("0xFFFF0000");
  7864. case 1: iColor = HexToInt("0xFF04B404");
  7865. case 2: iColor = HexToInt("0xFF00B5CD");
  7866. case 3: iColor = HexToInt("0xFFFFFF00");
  7867. case 4: iColor = HexToInt("0xFF0000FF");
  7868. case 5: iColor = HexToInt("0xFF848484");
  7869. case 6: iColor = HexToInt("0xFFFF00FF");
  7870. case 7: iColor = HexToInt("0xFFFFFFFF");
  7871. }
  7872. spraytag_color[playerid] = iColor;
  7873. SprayTag_Dialog(playerid, TYPE_LIST_CREATE);
  7874. }
  7875. case DIALOG_VEHICLE_SPAWN: {
  7876. if(response) {
  7877. new query[95];
  7878. mysql_format(handlesql, query, sizeof(query), "SELECT `ID` FROM `vehicles` WHERE `Owner` = '%e' LIMIT %i, %i;", PlayerInfo[playerid][pUsername], listitem, listitem + 1);
  7879. mysql_tquery(handlesql, query, "vs_OnPlayerVehicleSpawnSelected", "i", playerid);
  7880. }
  7881. }
  7882. case DIALOG_VEHICLE_SELL: {
  7883. if(response) {
  7884. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You have to be in your vehicle in order to sell it.");
  7885. new vehicleID = GetPlayerVehicleID(playerid);
  7886. if(!PlayerOwnsVehicle(playerid, vehicleID)) return SendClientMessage(playerid, COLOR_GREY, "You don't own this vehicle.");
  7887. if(VehicleInfo[vehicleID][vDonate] != 0) return SendClientMessage(playerid, COLOR_GREY, "You cannot sell a donor vehicle.");
  7888. new msg[80],
  7889. sellPrice = VehicleInfo[vehicleID][vValue] / 3;
  7890.  
  7891. format(msg, sizeof(msg), "Vehicle sold for $%i.", sellPrice);
  7892. SendClientMessage(playerid, COLOR_WHITE, msg);
  7893. GivePlayerMoneyEx(playerid, sellPrice);
  7894. mysql_format(handlesql, msg, sizeof(msg), "DELETE FROM `vehicles` WHERE `ID` = %i;", VehicleInfo[vehicleID][vID]);
  7895. mysql_tquery(handlesql, msg);
  7896. mysql_format(handlesql, msg, sizeof(msg), "DELETE FROM `vehiclefurn` WHERE VID=%i;", VehicleInfo[vehicleID][vID]);
  7897. mysql_tquery(handlesql, msg);
  7898. DespawnVehicle(vehicleID);
  7899. }
  7900. }
  7901. case DIALOG_RADIO: {
  7902. if(response) {
  7903. switch(listitem) {
  7904. case 0: {
  7905. new dialogMsg[5000];
  7906. for(new i = 0; i < sizeof(CarRadio); i++) {
  7907. if(i == 0) {
  7908. format(dialogMsg, sizeof(dialogMsg), "%s", CarRadio[i][cName]);
  7909. } else {
  7910. format(dialogMsg, sizeof(dialogMsg), "%s\n%s", dialogMsg, CarRadio[i][cName]);
  7911. }
  7912. }
  7913.  
  7914. ShowPlayerDialog(playerid, DIALOG_RADIO_STATION, DIALOG_STYLE_LIST, "Radio Stations", dialogMsg, "Select", "Go Back");
  7915. }
  7916. case 1: {
  7917. ShowPlayerDialog(playerid, DIALOG_RADIO_CUSTOM, DIALOG_STYLE_INPUT, "Direct URL", "Enter the URL you would like to play:", "Enter", "Go Back");
  7918. }
  7919. case 2: {
  7920. new vehicleID = GetPlayerVehicleID(playerid);
  7921. if(vehicleID == 0 && IsValidCar(PlayerInfo[playerid][pInVehicle])) { vehicleID = PlayerInfo[playerid][pInVehicle]; }
  7922. if(vehicleID == -1 || vehicleID == 0) return SendClientMessage(playerid, COLOR_GREY, "You have to be in a vehicle with a radio installed.");
  7923. if(GetPlayerVehicleID(playerid) != vehicleID && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You have to be in the driver seat of your vehicle in order to set the radio station.");
  7924. strmid(VehicleInfo[vehicleID][vRadio], "None", 0, strlen("None"), VEHICLE_RADIO_URL_MAX_LENGTH);
  7925. GameTextForPlayer(playerid, "~w~Radio~n~~r~OFF", 4000, 3);
  7926. foreach(new i : Player) {
  7927. if(GetPlayerVehicleID(i) == vehicleID) {
  7928. StopAudioStreamForPlayerEx(i);
  7929. LoadRadios(i);
  7930. }
  7931. }
  7932. }
  7933. }
  7934. }
  7935. }
  7936. case DIALOG_RADIO_STATION: {
  7937. if(!response) {
  7938. return cmd_v(playerid, "radio");
  7939. } else {
  7940. new vehicleID = GetPlayerVehicleID(playerid);
  7941. if(vehicleID == 0 && IsValidCar(PlayerInfo[playerid][pInVehicle])) { vehicleID = PlayerInfo[playerid][pInVehicle]; }
  7942. if(vehicleID == -1 || vehicleID == 0) return SendClientMessage(playerid, COLOR_GREY, "You have to be in a vehicle with a radio installed.");
  7943. if(IsNotAEngineCar(vehicleID) && IsEnterableVehicle(vehicleID) == -1) return SendClientMessage(playerid, COLOR_GREY, "This vehicle does not have a radio installed.");
  7944. if(GetPlayerVehicleID(playerid) != vehicleID && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You have to be in the driver seat of your vehicle in order to set the radio station.");
  7945. if (listitem == 0) {
  7946. PlayRadioURL(vehicleID, RadioLSStream, 1);
  7947. } else PlayRadioURL(vehicleID, CarRadio[listitem][cURL]);
  7948. }
  7949. }
  7950. case DIALOG_RADIO_CUSTOM: {
  7951. if(!response) {
  7952. return cmd_v(playerid, "radio");
  7953. } else {
  7954. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_RADIO_CUSTOM, DIALOG_STYLE_INPUT, "Direct URL", "Enter the URL you would like to play:", "Enter", "Go Back");
  7955. if(strlen(inputtext) > VEHICLE_RADIO_URL_MAX_LENGTH) {
  7956. SendClientMessage(playerid, COLOR_GREY, "The URL you entered is too long, please try again.");
  7957. return ShowPlayerDialog(playerid, DIALOG_RADIO_CUSTOM, DIALOG_STYLE_INPUT, "Direct URL", "Enter the URL you would like to play:", "Enter", "Go Back");
  7958. }
  7959. new vehicleID = GetPlayerVehicleID(playerid);
  7960. if(vehicleID == 0 && IsValidCar(PlayerInfo[playerid][pInVehicle])) { vehicleID = PlayerInfo[playerid][pInVehicle]; }
  7961. if(vehicleID == -1 || vehicleID == 0) return SendClientMessage(playerid, COLOR_GREY, "You have to be in a vehicle with a radio installed.");
  7962. if(IsNotAEngineCar(vehicleID) && IsEnterableVehicle(vehicleID) == -1) return SendClientMessage(playerid, COLOR_GREY, "This vehicle does not have a radio installed.");
  7963. if(GetPlayerVehicleID(playerid) != vehicleID && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You have to be in the driver seat of your vehicle in order to set the radio station.");
  7964. PlayRadioURL(vehicleID, inputtext);
  7965. }
  7966. }
  7967. case DIALOG_MDC_SEARCH_CITIZEN: {
  7968. if(response) {
  7969. mdc_SearchCitizen(playerid, inputtext);
  7970. } else {
  7971. SelectTextDraw(playerid, -1);
  7972. }
  7973. }
  7974. case DIALOG_MDC_SEARCH_PHONE_NUMBER: {
  7975. if(response) {
  7976. if(!IsNumeric(inputtext)) {
  7977. SendClientMessage(playerid, COLOR_GREY, "You have to enter a valid numeric phone number.");
  7978. ShowPlayerDialog(playerid, DIALOG_MDC_SEARCH_PHONE_NUMBER, DIALOG_STYLE_INPUT, "{3D62A8}Search Phone Number", "Please enter the phone number below:", "Search", "Cancel");
  7979. } else {
  7980. new query[130];
  7981. mysql_format(handlesql, query, sizeof(query), "SELECT `Name`, `Model`, `Age`, `Sex`, `DriveLic`, `GunLic`, `JobID` FROM `accounts` WHERE `PhoneNum` = %i;", strval(inputtext));
  7982. mysql_tquery(handlesql, query, "mdc_SearchPhoneNumber", "ii", playerid, strval(inputtext));
  7983. }
  7984. } else {
  7985. SelectTextDraw(playerid, -1);
  7986. }
  7987. }
  7988. case DIALOG_MDC_SEARCH_SERIAL: {
  7989. if(response) {
  7990. if(!IsNumeric(inputtext)) {
  7991. SendClientMessage(playerid, COLOR_GREY, "You have to enter a numeric weapon serial number.");
  7992. ShowPlayerDialog(playerid, DIALOG_MDC_SEARCH_SERIAL, DIALOG_STYLE_INPUT, "{3D62A8}Search Weapon Serial", "Please enter the weapons serial number below:", "Search", "Cancel");
  7993. } else {
  7994. new query[140];
  7995. mysql_format(handlesql, query, sizeof(query), "SELECT `Name`, `Model`, `Age`, `Sex`, `DriveLic`, `GunLic`, `JobID`, `PhoneNum` FROM `accounts` WHERE `WepSerial` = %d;", strval(inputtext));
  7996. mysql_tquery(handlesql, query, "mdc_SearchSerial", "i", playerid);
  7997. }
  7998. } else {
  7999. SelectTextDraw(playerid, -1);
  8000. }
  8001. }
  8002. case DIALOG_MDC_SEARCH_PLATE: {
  8003. if(response) {
  8004. new query[140];
  8005. mysql_format(handlesql, query, sizeof(query), "SELECT `Model`, `ColorOne`, `ColorTwo`, `Owner`, `Insurance` FROM `vehicles` WHERE `Plate` = '%e';", inputtext);
  8006. mysql_tquery(handlesql, query, "mdc_SearchLicensePlate", "is", playerid, inputtext);
  8007. } else {
  8008. SelectTextDraw(playerid, -1);
  8009. }
  8010. }
  8011. case DIALOG_CLOSE: {
  8012. return 1;
  8013. }
  8014. //new case
  8015. }
  8016. return 1;
  8017. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement