1
0

deluxegps.pwn 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. Next Generation Gaming, LLC
  11. (created by Next Generation Gaming Development Team)
  12. Developers:
  13. (***) Austin
  14. (***) Connor
  15. (***) Jingles
  16. * Copyright (c) 2016, Next Generation Gaming, LLC
  17. *
  18. * All rights reserved.
  19. *
  20. * Redistribution and use in source and binary forms, with or without modification,
  21. * are not permitted in any case.
  22. *
  23. *
  24. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  25. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  26. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  27. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  28. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  29. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  30. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  31. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  32. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  33. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  34. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  35. */
  36. #include <YSI\y_hooks>
  37. #define DIALOG_GPS_ONE 9800
  38. #define DIALOG_GPS_TWO 9801
  39. #define DIALOG_GPS_GEN 9802
  40. #define DIALOG_GPS_THREE 9984
  41. #define DIALOG_GPS_BCATS 9986
  42. #define DIALOG_GPS_BSELECT 9987
  43. #define DIALOG_GPS_BIZCONF 9988
  44. #define DIALOG_GPS_FAVS 9809
  45. #define DIALOG_GPS_SETFAV 9808
  46. #define DIALOG_GPS_SETFAVNAME 9708
  47. #define DIALOG_MAP_BUSINESSES 9709
  48. #define DIALOG_MAP_BUSINESSES2 9710
  49. #define DIALOG_MAP_JOBS 9711
  50. #define CHECKPOINT_GEN_LOCATION 4500
  51. #define CHECKPOINT_BUSINESS 4501
  52. #define CHECKPOINT_JOB 4502
  53. #define CHECKPOINT_DOOR 4503
  54. #define CHECKPOINT_HOUSE 4504
  55. #define MAX_GPSFAV (5)
  56. /*
  57. enum gpsFavs
  58. {
  59. FavName[128],
  60. Float:FavPos[3]
  61. }
  62. new GPSFav[MAX_PLAYERS][MAX_GPSFAV][gpsFavs];
  63. */
  64. new Float:gpsZones[][4] = {
  65. {1555.1693, -1675.6151, 16.1953}, // LSPD
  66. {626.9811,-571.8036,17.9207,110.9859}, // SASD
  67. {-1605.7848,710.9673,13.8672,175.0478}, // SFPD
  68. {327.9552,-1512.2510,36.0325,88.4196}, // FBI
  69. {-1944.2158,457.2660,35.1719,224.4054}, // FBI SF
  70. {-2028.5834,-100.6595,35.1641,235.1625}, // DOC
  71. {1295.7305,-2526.1033,13.9679,189.1324}, //FDSA HQ
  72. {648.2982,-1357.5068,13.5716,331.5677}, // SA News HQ
  73. {-54.6465,-1152.5557,2.1316,64.1502}, // RCTR // Dialog 1 END -- (8)
  74. {-1580.5352,903.4696,7.6953,149.5203}, // SF Bank
  75. {1456.8411,-1011.4421,26.8438,57.0505}, // Mullholand Bank
  76. {2462.5857,2244.9272,10.8203,310.6805}, // LV Bank
  77. {595.3816,-1249.2163,18.2463,136.4379}, // Rodeo Bank
  78. {648.4630,-519.8029,16.5537,347.8049}, // Dillimore Bank -- Dialog 2 End -- (13)
  79. {-2455.3552,503.7207,30.0781,81.6989}, // SF Vip
  80. {1797.4575,-1578.9565,14.0856,120.4249}, // LSVIP
  81. {1930.8643,1345.4410,9.9688,145.0573}, // LV Vip
  82. {2017.6354,-1311.6549,23.9861,332.9441}, // Glen Park VIP
  83. {1022.0172,-1122.0380,23.8709,297.9781}, // Famed Lounge -- Dialog 3 End -- (18)
  84. {-2653.6384,638.8214,14.4531,43.3566}, // SF Hospital
  85. {2034.3092,-1402.3984,17.2961,339.7592}, // County Hospital
  86. {1172.1243,-1323.2010,15.4027,99.1248}, // All Saints
  87. {1241.3552,326.6962,19.7555,154.6608}, // Montgomery Hospital -- Dialog 4 End -- (22)
  88. {-560.008483, -1020.256652, 24.084102}, // Flint Hospital
  89. {-2413.4434,2251.3003,4.8138,267.8773}, // Bayside Appts.
  90. {-2436.0908,2305.2141,4.9844,132.8512}, // Bayside VIP
  91. {-2544.1807,2346.4771,4.9844,44.3360}, // TR Capitol Building
  92. {-2630.0063,2272.8008,8.3225,111.7500}, // TRES HQ
  93. {-1390.6035,2638.3354,55.9844,282.1874}, // TRAF HQ Elque
  94. {-1439.2744,2591.3591,55.8359,342.5681}, // TRES Recruitment office
  95. {-1514.5067,2520.9653,55.8705,164.9699}, // Elquebrado's Hospital
  96. {-827.9031,1504.0640,19.8300,322.0778}, // Las Barancas Bank
  97. {-319.8820,1049.0958,20.3403,142.6894}, // Fort Carson Hospital -- Dialog 5 End -- (33)
  98. {1481.0574,-1772.0535,18.7958,178.1923}, // LS City Hall
  99. {-2765.8823,375.7053,6.3347,74.5302}, // SF City Hall
  100. {-1750.6162,964.0596,24.8906,4.3083}, // SF Appts.
  101. {288.1022,-1600.4684,32.7701,203.7112}, // NG Recuruitment Office
  102. {-2056.9709,228.3147,35.3800,265.4275}, // Donahue Family Condo's SF
  103. {2025.7943,-1296.6964,23.9861,195.1668}, // Glen Park Community Center
  104. {2634.0679,-1384.9991,30.4456,281.2836}, // Los Flores Hotel
  105. {2752.2041,-1962.6484,13.5469,124.7719}, // Seville Appts.
  106. {2248.1704,-1795.4705,13.5469,138.6487}, // Ganton Appts.
  107. {1863.7871,-1599.4569,13.9770,298.1175}, // Idlewood Appts.
  108. {487.3402,-1640.4919,23.7031,10.7028}, // Trump Industries
  109. {607.6238,-1458.9736,14.3879,94.2657}, // Fuente's Rodeo Appts
  110. {1117.4316,-1380.5221,15.3364,49.8436}, // Mall Appts.
  111. {994.3275,-1211.3960,16.9375,355.9103}, // Market Appts.
  112. {1241.7294,-1259.3480,13.5300,7.8954}, // Donahue Family Condos, Market
  113. {1420.0615,-1623.9930,13.5469,333.2560}, // Commerce Appts.
  114. {1498.6129,-1584.3176,13.5469,7.0856} // Pershing Square Appts. -- Dialog 6 End --
  115. };
  116. new gpsZoneName[50][] = {
  117. "LSPD",
  118. "SASD",
  119. "SFPD",
  120. "FBI",
  121. "FBI SF",
  122. "DoC",
  123. "FDSA",
  124. "SANews",
  125. "RCTR",
  126. "SF Bank",
  127. "Mullholand Bank",
  128. "LV Bank",
  129. "Rodeo Bank",
  130. "Dillimore Bank",
  131. "SF VIP",
  132. "LS VIP",
  133. "LV VIP",
  134. "Glen Park VIP",
  135. "Famed Lounge",
  136. "SF Hospital",
  137. "County Hospital",
  138. "All Saints Hospital",
  139. "Montgomery Hospital",
  140. "Flint Hospital",
  141. "Bayside Apartments",
  142. "Bayside VIP",
  143. "TR Capitol",
  144. "TRES",
  145. "TRAF El Quebrados",
  146. "TRES Recruitment",
  147. "El Quebrados Hospital",
  148. "Los Barrancas Bank",
  149. "Fort Carson Hospital",
  150. "City Hall",
  151. "SF City Hall",
  152. "SF Apartments",
  153. "Nation Guard Recruitment",
  154. "Donahue Condos - SF",
  155. "Glen Park Community Center",
  156. "Los Flores Hotel",
  157. "Seville Apartments",
  158. "Ganton Apartments",
  159. "Idlewood Apartments",
  160. "Rodeo Apartments",
  161. "Fuente's Rodeo Apartments",
  162. "Mall Apartments",
  163. "Market Apartments",
  164. "Donahue Condos - Market",
  165. "Commerce Apartments",
  166. "Pershing Square Apartments"
  167. };
  168. GetEntity3DZone(entityID, type, zone[], len, Float:x2 = 0.0, Float:y2 = 0.0, Float:z2 = 0.0) //Credits to Cueball, Betamaster, Mabako, and Simon.
  169. {
  170. new Float:x, Float:y, Float:z;
  171. switch(type) {
  172. case 0: {
  173. x = Businesses[entityID][bExtPos][0];
  174. y = Businesses[entityID][bExtPos][1];
  175. z = Businesses[entityID][bExtPos][2];
  176. }
  177. case 1: {
  178. x = HouseInfo[entityID][hExteriorX];
  179. y = HouseInfo[entityID][hExteriorY];
  180. z = HouseInfo[entityID][hExteriorZ];
  181. }
  182. case 2: {
  183. x = DDoorsInfo[entityID][ddExteriorX];
  184. y = DDoorsInfo[entityID][ddExteriorY];
  185. z = DDoorsInfo[entityID][ddExteriorZ];
  186. }
  187. case 3: {
  188. x = x2;
  189. y = y2;
  190. z = z2;
  191. }
  192. }
  193. for(new i = 0; i != sizeof(gSAZones); i++) {
  194. if(x >= gSAZones[i][SAZONE_AREA][0]
  195. && x <= gSAZones[i][SAZONE_AREA][3]
  196. && y >= gSAZones[i][SAZONE_AREA][1]
  197. && y <= gSAZones[i][SAZONE_AREA][4]
  198. && z >= gSAZones[i][SAZONE_AREA][2]
  199. && z <= gSAZones[i][SAZONE_AREA][5]) {
  200. return format(zone, len, gSAZones[i][SAZONE_NAME], 0);
  201. }
  202. }
  203. return 0;
  204. }
  205. /*
  206. CMD:gpsfaves(playerid,params[])
  207. {
  208. new string[128];
  209. for(new i = 0; i < MAX_GPSFAV; i++)
  210. {
  211. format(string,sizeof(string), "%s\n%s", string, GPSFav[playerid][i][FavName]);
  212. }
  213. ShowPlayerDialogEx(playerid, DIALOG_GPS_SETFAV, DIALOG_STYLE_LIST, "Delux GPS - Save Favorite", string, "Save Favorite", "Cancel");
  214. return 1;
  215. }
  216. */
  217. CMD:map(playerid, params[]) {
  218. Phone_Map(playerid);
  219. return 1;
  220. }
  221. CMD:mygps(playerid, params[]) {
  222. if(CheckPointCheck(playerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint).");
  223. ShowPlayerDialogEx(playerid, DIALOG_GPS_ONE, DIALOG_STYLE_LIST, "Doodle Maps | Main Menu", "Businesses\n\
  224. Jobs\n\
  225. General Locations\n\
  226. Business Address\n\
  227. House Address\n\
  228. Door Address\n", "Okay", "Cancel");
  229. return 1;
  230. }
  231. hook OnPlayerEnterCheckpoint(playerid)
  232. {
  233. switch(gPlayerCheckpointStatus[playerid])
  234. {
  235. case CHECKPOINT_GEN_LOCATION:
  236. {
  237. GetPVarString(playerid, "gpsName", szMiscArray, sizeof(szMiscArray));
  238. format(szMiscArray, sizeof(szMiscArray),"You have arrived at {33CCFF}%s{FFFFFF}.", szMiscArray);
  239. SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  240. DeletePVar(playerid,"gpsName");
  241. DisablePlayerCheckpoint(playerid);
  242. gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
  243. }
  244. case CHECKPOINT_BUSINESS:
  245. {
  246. new id = GetPVarInt(playerid,"gpsBiz");
  247. format(szMiscArray, sizeof(szMiscArray), "You have arrived at {33CCFF}%s{FFFFFF}.", Businesses[id][bName]);
  248. SendClientMessageEx(playerid,COLOR_WHITE, szMiscArray);
  249. DisablePlayerCheckpoint(playerid);
  250. gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
  251. }
  252. case CHECKPOINT_JOB:
  253. {
  254. new id = GetPVarInt(playerid,"gpsJob");
  255. format(szMiscArray, sizeof(szMiscArray), "You have arrived at {33CCFF}%s{FFFFFF}.", GetJobName(JobData[id][jType]));
  256. SendClientMessageEx(playerid,COLOR_WHITE, szMiscArray);
  257. DisablePlayerCheckpoint(playerid);
  258. gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
  259. }
  260. case CHECKPOINT_HOUSE:
  261. {
  262. new id = GetPVarInt(playerid,"gpsHouse");
  263. format(szMiscArray, sizeof(szMiscArray), "You have arrived at house #{33CCFF}%i{FFFFFF}.", id);
  264. SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  265. DisablePlayerCheckpoint(playerid);
  266. gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
  267. }
  268. case CHECKPOINT_DOOR:
  269. {
  270. new id = GetPVarInt(playerid,"gpsDoor");
  271. format(szMiscArray, sizeof(szMiscArray), "You have arrived at door #%i ({33CCFF}%s{FFFFFF}).", id,DDoorsInfo[id][ddDescription]);
  272. SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  273. DisablePlayerCheckpoint(playerid);
  274. gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
  275. }
  276. /*
  277. case CHECKPOINT_FAVORITES:
  278. {
  279. new id = GetPVarInt(playerid, "gpsFav");
  280. DeletePVar(playerid, "gpsFav");
  281. format(szMiscArray, sizeof(szMiscArray), "You have arrived at {33CCFF}%s{FFFFFF}.", GPSFav[playerid][id][FavName]);
  282. SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  283. DisablePlayerCheckpoint(playerid);
  284. }
  285. */
  286. }
  287. }
  288. hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
  289. if(arrAntiCheat[playerid][ac_iFlags][AC_DIALOGSPOOFING] > 0) return 1;
  290. switch(dialogid) {
  291. case DIALOG_MAP_BUSINESSES: {
  292. if(!response) {
  293. return ShowPlayerDialogEx(playerid, DIALOG_GPS_ONE, DIALOG_STYLE_LIST, "Doodle Maps | Main Menu", "Businesses\n\
  294. Jobs\n\
  295. General Locations\n\
  296. Business Address\n\
  297. House Address\n\
  298. Door Address\n", "Okay", "Cancel");
  299. }
  300. Map_ShowBusinesses(playerid, listitem);
  301. return 1;
  302. }
  303. case DIALOG_MAP_BUSINESSES2: {
  304. if(!response) {
  305. return ShowPlayerDialogEx(playerid, DIALOG_MAP_BUSINESSES, DIALOG_STYLE_LIST, "San Andreas | Map | Businesses", "\
  306. 24/7\n\
  307. Clothing Stores\n\
  308. Restaurants\n\
  309. Bars\n\
  310. Gun Stores\n\
  311. Petrol Stations\n\
  312. Car Dealerships\n\
  313. Clubs", "Select", "Back");
  314. }
  315. else {
  316. new id = ListItemTrackId[playerid][listitem];
  317. GetEntity3DZone(id, 0, szMiscArray, sizeof(szMiscArray));
  318. format(szMiscArray,sizeof(szMiscArray),"Your GPS Destination has been set to {33CCFF}%s{FFFFFF} in the area of {FF0000}%s{FFFFFF}.", Businesses[id][bName], szMiscArray);
  319. SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  320. gPlayerCheckpointStatus[playerid] = CHECKPOINT_BUSINESS;
  321. DisablePlayerCheckpoint(playerid);
  322. SetPlayerCheckpoint(playerid, Businesses[id][bExtPos][0], Businesses[id][bExtPos][1], Businesses[id][bExtPos][2], 15.0);
  323. }
  324. return 1;
  325. }
  326. case DIALOG_MAP_JOBS: if(response) return Map_ShowJobs(playerid, listitem);
  327. case DIALOG_GPS_ONE: {
  328. if(!response) return 1;
  329. switch(listitem) {
  330. case 0:
  331. {
  332. if(!response) return 1;
  333. ShowPlayerDialogEx(playerid, DIALOG_MAP_BUSINESSES, DIALOG_STYLE_LIST, "San Andreas | Map | Businesses", "\
  334. 24/7\n\
  335. Clothing Stores\n\
  336. Restaurants\n\
  337. Bars\n\
  338. Gun Stores\n\
  339. Petrol Stations\n\
  340. Car Dealerships\n\
  341. Clubs", "Select", "Back");
  342. }
  343. case 1:
  344. {
  345. for(new i; i < MAX_JOBTYPES; ++i)
  346. {
  347. format(szMiscArray, sizeof(szMiscArray), "%s%s\n", szMiscArray, JobName[i]);
  348. }
  349. return ShowPlayerDialogEx(playerid, DIALOG_MAP_JOBS, DIALOG_STYLE_LIST, "San Andreas | Map | Jobs", szMiscArray, "Select", "Back");
  350. }
  351. case 2: {
  352. SetPVarInt(playerid, "gpsUsingID", 0);
  353. ShowPlayerDialogEx(playerid, DIALOG_GPS_TWO, DIALOG_STYLE_LIST, "General Locations", "Faction HQs\nBanks\nVIP Areas\nHospitals\nNew Robada\nMiscellaneous", "Okay", "Cancel");
  354. }
  355. case 3: {
  356. SetPVarInt(playerid, "gpsUsingID", 1);
  357. ShowPlayerDialogEx(playerid, DIALOG_GPS_TWO, DIALOG_STYLE_INPUT, "Find Business", "Enter the address of the business (ID)", "Okay", "Cancel");
  358. }
  359. case 4: {
  360. SetPVarInt(playerid, "gpsUsingID", 2);
  361. ShowPlayerDialogEx(playerid, DIALOG_GPS_TWO, DIALOG_STYLE_INPUT, "Find House", "Enter the address of the house (ID)", "Okay", "Cancel");
  362. }
  363. case 5: {
  364. SetPVarInt(playerid, "gpsUsingID", 3);
  365. ShowPlayerDialogEx(playerid, DIALOG_GPS_TWO, DIALOG_STYLE_INPUT, "Find Door", "Enter the address of the building (ID)", "Okay", "Cancel");
  366. }
  367. }
  368. }
  369. case DIALOG_GPS_TWO: {
  370. if(!response) return 1;
  371. switch(GetPVarInt(playerid, "gpsUsingID")) {
  372. case 0: {
  373. SetPVarInt(playerid, "gpsUsingID", listitem);
  374. switch(listitem) {
  375. case 0: {
  376. ShowPlayerDialogEx(playerid, DIALOG_GPS_GEN, DIALOG_STYLE_LIST, "HQs", "LSPD\nSASD\nSFPD\nFBI\nFBI SF\nDoC\nFDSA\nSAN NEWS\nRCTR", "Okay", "Cancel");
  377. }
  378. case 1: {
  379. ShowPlayerDialogEx(playerid, DIALOG_GPS_GEN, DIALOG_STYLE_LIST, "Banks", "San Fierro\nMullholand\nLas Venturas\nRodeo\nDillimore", "Okay", "Cancel");
  380. }
  381. case 2: {
  382. ShowPlayerDialogEx(playerid, DIALOG_GPS_GEN, DIALOG_STYLE_LIST, "VIP", "San Fierro\nLos Santos\nLas Venturas\nGlen Park\nFamed Lounge", "Okay", "Cancel");
  383. }
  384. case 3: {
  385. ShowPlayerDialogEx(playerid, DIALOG_GPS_GEN, DIALOG_STYLE_LIST, "Hospitals", "San Fierro\nCounty General\nAll Saints\nMontgomery Hospital", "Okay", "Cancel");
  386. }
  387. case 4:
  388. {
  389. ShowPlayerDialogEx(playerid, DIALOG_GPS_GEN, DIALOG_STYLE_LIST, "New Robada", "Flint Hospital\nBayside Apartments\nBayside VIP\nCapitol\nTRES HQ\n\
  390. TRAF HQ\nTRES Recruitment\nEl Quebrados Hospital\nLas Barranca Bank\nFort Carsonal Hospital", "Okay", "Cancel");
  391. }
  392. case 5:
  393. {
  394. ShowPlayerDialogEx(playerid, DIALOG_GPS_GEN, DIALOG_STYLE_LIST, "Miscellaneous","LS City Hall\nSF City Hall\nSF Apartments\nNG Recruitment\nDonahue Condos SF\nGlen Park Community Center\n\
  395. Los Flores Hotel\nSeville Apartments\nGanton Apartments\nIdlewood\nRodeo Apartments\nFuente's Rodeo Apartments\n\
  396. Mall Apartments\nMarket Apartments\nDonahue Apartments LS\nCommerce Apartments\nPershing Sq. Apartments", "Okay", "Cancel");
  397. }
  398. }
  399. }
  400. case 1: {
  401. for (new i = 0, j = strlen(inputtext); i < j; i++) {
  402. if(inputtext[i] > '9' || inputtext[i] < '0') {
  403. SendClientMessageEx(playerid, COLOR_WHITE, "You must input a numerical value. In this case, the ID of the business.");
  404. return 1;
  405. }
  406. }
  407. new id = strval(inputtext);
  408. if(!IsValidBusinessID(id)) {
  409. SendClientMessageEx(playerid, COLOR_WHITE, "That business does not exist.");
  410. return 1;
  411. }
  412. GetEntity3DZone(id, 0, szMiscArray, sizeof(szMiscArray));
  413. format(szMiscArray, sizeof(szMiscArray), "{FFFFFF}Would you like to set your destination to:\n\n\
  414. {33CCFF}%s{FFFFFF} in the area of {FF0000}%s{FFFFFF}?", Businesses[id][bName], szMiscArray);
  415. SetPVarInt(playerid, "gpsUsingID", 1);
  416. SetPVarInt(playerid,"gpsBiz", id);
  417. ShowPlayerDialogEx(playerid, DIALOG_GPS_THREE, DIALOG_STYLE_MSGBOX, "{FF0000}Delux GPS - Business", szMiscArray, "Yes", "Cancel");
  418. }
  419. case 2:
  420. {
  421. for (new i = 0, j = strlen(inputtext); i < j; i++) {
  422. if (inputtext[i] > '9' || inputtext[i] < '0')
  423. {
  424. SendClientMessageEx(playerid, COLOR_WHITE, "You must input a numerical value. In this case, the ID of the house.");
  425. return 1;
  426. }
  427. }
  428. new id = strval(inputtext);
  429. SetPVarInt(playerid, "gpsHouse", id);
  430. if(HouseInfo[id][hOwned] == 0)
  431. {
  432. SendClientMessageEx(playerid, COLOR_WHITE, "That house address is invalid.");
  433. return 1;
  434. }
  435. GetEntity3DZone(id, 1, szMiscArray, sizeof(szMiscArray));
  436. SetPVarInt(playerid, "gpsUsingID", 2);
  437. format(szMiscArray,sizeof(szMiscArray),"{FFFFFF}Would you like to set your destination to:\n\n\
  438. house {33CCFF}#%i{FFFFFF} in the area of {FF0000}%s{FFFFFF}?", id, szMiscArray);
  439. ShowPlayerDialogEx(playerid, DIALOG_GPS_THREE, DIALOG_STYLE_MSGBOX, "{FF0000}Delux GPS - House", szMiscArray, "Yes", "Cancel");
  440. }
  441. case 3:
  442. {
  443. for (new i = 0, j = strlen(inputtext); i < j; i++) {
  444. if (inputtext[i] > '9' || inputtext[i] < '0') {
  445. SendClientMessageEx(playerid, COLOR_WHITE, "You must input a numerical value. In this case, the ID of the door.");
  446. return 1;
  447. }
  448. }
  449. new id = strval(inputtext);
  450. SetPVarInt(playerid, "gpsDoor", id);
  451. if(DDoorsInfo[id][ddDescription] == 0)
  452. {
  453. SendClientMessageEx(playerid, COLOR_WHITE, "That house address is invalid.");
  454. return 1;
  455. }
  456. GetEntity3DZone(id, 2, szMiscArray, sizeof(szMiscArray));
  457. SetPVarInt(playerid, "gpsUsingID", 3);
  458. format(szMiscArray,sizeof(szMiscArray),"{FFFFFF}Would you like to set your destination to:\n\n\
  459. Door #%i ({33CCFF}%s{FFFFFF}) in the area of {FF0000}%s{FFFFFF}?", id, DDoorsInfo[id][ddDescription], szMiscArray);
  460. ShowPlayerDialogEx(playerid, DIALOG_GPS_THREE, DIALOG_STYLE_MSGBOX, "{FF0000}Delux GPS - Door", szMiscArray, "Yes", "Cancel");
  461. }
  462. }
  463. }
  464. case DIALOG_GPS_GEN: {
  465. if(!response) return 1;
  466. new gpsItemStart;
  467. switch(GetPVarInt(playerid, "gpsUsingID")) {
  468. case 0: gpsItemStart = 0;
  469. case 1: gpsItemStart = 9;
  470. case 2: gpsItemStart = 14;
  471. case 3: gpsItemStart = 19;
  472. case 4: gpsItemStart = 23;
  473. case 5: gpsItemStart = 33;
  474. }
  475. GetEntity3DZone(0, 3, szMiscArray, sizeof(szMiscArray), gpsZones[gpsItemStart + listitem][0], gpsZones[gpsItemStart + listitem][1], gpsZones[gpsItemStart + listitem][2]);
  476. DisablePlayerCheckpoint(playerid);
  477. SetPlayerCheckpoint(playerid, gpsZones[gpsItemStart + listitem][0], gpsZones[gpsItemStart + listitem][1], gpsZones[gpsItemStart + listitem][2] , 15.0);
  478. format(szMiscArray,sizeof(szMiscArray),"Your GPS Destination has been set to {33CCFF}%s{FFFFFF} in the area of {FF0000}%s{FFFFFF}.", gpsZoneName[gpsItemStart + listitem], szMiscArray);
  479. SendClientMessage(playerid, COLOR_WHITE, szMiscArray);
  480. SetPVarString(playerid, "gpsName", gpsZoneName[gpsItemStart + listitem]);
  481. }
  482. case DIALOG_GPS_THREE:{
  483. if(!response) return 1;
  484. switch(GetPVarInt(playerid,"gpsUsingID"))
  485. {
  486. case 1:
  487. {
  488. new id = GetPVarInt(playerid,"gpsBiz");
  489. GetEntity3DZone(id, 1, szMiscArray, sizeof(szMiscArray));
  490. format(szMiscArray,sizeof(szMiscArray),"Your GPS Destination has been set to {33CCFF}%s{FFFFFF} in the area of {FF0000}%s{FFFFFF}.", Businesses[id][bName], szMiscArray);
  491. SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  492. DisablePlayerCheckpoint(playerid);
  493. SetPlayerCheckpoint(playerid, Businesses[id][bExtPos][0], Businesses[id][bExtPos][1], Businesses[id][bExtPos][2], 15.0);
  494. }
  495. case 2:
  496. {
  497. new id = GetPVarInt(playerid,"gpsHouse");
  498. GetEntity3DZone(id, 1, szMiscArray, sizeof(szMiscArray));
  499. format(szMiscArray,sizeof(szMiscArray),"Your GPS Destination has been set to house #{33CCFF}%i{FFFFFF} in the area of {FF0000}%s{FFFFFF}.", id, szMiscArray);
  500. SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  501. gPlayerCheckpointStatus[playerid] = CHECKPOINT_HOUSE;
  502. DisablePlayerCheckpoint(playerid);
  503. SetPlayerCheckpoint(playerid, HouseInfo[id][hExteriorX], HouseInfo[id][hExteriorY], HouseInfo[id][hExteriorZ], 15.0);
  504. }
  505. case 3:
  506. {
  507. new id = GetPVarInt(playerid,"gpsDoor");
  508. GetEntity3DZone(id, 1, szMiscArray, sizeof(szMiscArray));
  509. format(szMiscArray,sizeof(szMiscArray),"Your GPS Destination has been set to door #%i ({33CCFF}%s{FFFFFF}) in the area of {FF0000}%s{FFFFFF}.", id, DDoorsInfo[id][ddDescription], szMiscArray);
  510. SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  511. gPlayerCheckpointStatus[playerid] = CHECKPOINT_DOOR;
  512. DisablePlayerCheckpoint(playerid);
  513. SetPlayerCheckpoint(playerid, DDoorsInfo[id][ddExteriorX], DDoorsInfo[id][ddExteriorY], DDoorsInfo[id][ddExteriorZ], 15.0);
  514. }
  515. }
  516. }
  517. /*
  518. case DIALOG_GPS_FAVS:
  519. {
  520. if(!response) return 1;
  521. if(!strcmp(inputtext, "None", true)) return SendClientMessageEx(playerid, COLOR_WHITE, "You don't have a favorite stored in that slot.");
  522. GetEntity3DZone(listitem, 3, szMiscArray, sizeof(szMiscArray), GPSFav[playerid][listitem][FavPos][0], GPSFav[playerid][listitem][FavPos][1], GPSFav[playerid][listitem][FavPos][2]);
  523. format(szMiscArray, sizeof(szMiscArray), "Your GPS Destination has been set to {33CCFF}%s{FFFFFF} in the area of {FF0000}%s{FFFFFF}.", GPSFav[playerid][listitem][FavName], szMiscArray);
  524. SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  525. gPlayerCheckpointStatus[playerid] = CHECKPOINT_FAVORITES;
  526. SetPVarInt(playerid, "gpsFav", listitem);
  527. SetPlayerCheckpoint(playerid, GPSFav[playerid][listitem][FavPos][0],GPSFav[playerid][listitem][FavPos][1],GPSFav[playerid][listitem][FavPos][2], 15.0);
  528. }
  529. case DIALOG_GPS_SETFAV:
  530. {
  531. if(!response) return 1;
  532. SetPVarInt(playerid, "sFav", listitem);
  533. ShowPlayerDialogEx(playerid, DIALOG_GPS_SETFAVNAME, DIALOG_STYLE_INPUT, "Enter Favorite Name", "Please enter a name for your favorite.\n\nIt will be saved in the slot you have selected.", "Submit", "Cancel");
  534. }
  535. case DIALOG_GPS_SETFAVNAME:
  536. {
  537. if(!response) return 1;
  538. new sFav = GetPVarInt(playerid, "sFav");
  539. strcpy(GPSFav[playerid][sFav][FavName], inputtext, 128);
  540. GetPlayerPos(playerid, GPSFav[playerid][sFav][FavPos][0],GPSFav[playerid][sFav][FavPos][1],GPSFav[playerid][sFav][FavPos][2]);
  541. SendClientMessage(playerid,COLOR_WHITE, "GPS Location Saved!");
  542. new szQuery[256];
  543. format(szQuery, sizeof(szQuery), "UPDATE `GPSFavs` SET `Fav%i` = '%s|%f|%f|%f' WHERE `SQLid` = %d", sFav+1, GPSFav[playerid][sFav][FavName], GPSFav[playerid][sFav][FavPos][0],GPSFav[playerid][sFav][FavPos][1],GPSFav[playerid][sFav][FavPos][2], GetPlayerSQLId(playerid));
  544. mysql_tquery(MainPipeline, szQuery, false, "OnQueryFinish", "ii", SENDDATA_THREAD, playerid);
  545. }
  546. */
  547. }
  548. return 0;
  549. }
  550. Map_ShowBusinesses(playerid, btype)
  551. {
  552. szMiscArray[0] = 0;
  553. new szStatus[20],
  554. j;
  555. switch(btype)
  556. {
  557. case 0:
  558. {
  559. for(new i; i < MAX_BUSINESSES; ++i)
  560. {
  561. if(Businesses[i][bType] == BUSINESS_TYPE_STORE)
  562. {
  563. switch(Businesses[i][bStatus])
  564. {
  565. case 0: szStatus = "{FF0000} CLOSED";
  566. case 1: szStatus = "{00FF00} OPEN";
  567. }
  568. format(szMiscArray, sizeof(szMiscArray), "%s%s\t%s\n", szMiscArray, Businesses[i][bName], szStatus);
  569. ListItemTrackId[playerid][j++] = i;
  570. }
  571. }
  572. }
  573. case 1:
  574. {
  575. for(new i; i < MAX_BUSINESSES; ++i)
  576. {
  577. if(Businesses[i][bType] == BUSINESS_TYPE_CLOTHING)
  578. {
  579. switch(Businesses[i][bStatus])
  580. {
  581. case 0: szStatus = "{FF0000} CLOSED";
  582. case 1: szStatus = "{00FF00} OPEN";
  583. }
  584. format(szMiscArray, sizeof(szMiscArray), "%s%s\t%s\n", szMiscArray, Businesses[i][bName], szStatus);
  585. ListItemTrackId[playerid][j++] = i;
  586. }
  587. }
  588. }
  589. case 2:
  590. {
  591. for(new i; i < MAX_BUSINESSES; ++i)
  592. {
  593. if(Businesses[i][bType] == BUSINESS_TYPE_RESTAURANT)
  594. {
  595. switch(Businesses[i][bStatus])
  596. {
  597. case 0: szStatus = "{FF0000} CLOSED";
  598. case 1: szStatus = "{00FF00} OPEN";
  599. }
  600. format(szMiscArray, sizeof(szMiscArray), "%s%s\t%s\n", szMiscArray, Businesses[i][bName], szStatus);
  601. ListItemTrackId[playerid][j++] = i;
  602. }
  603. }
  604. if(j == 0) return SendClientMessage(playerid, COLOR_GRAD1, "There are none.");
  605. }
  606. case 3:
  607. {
  608. for(new i; i < MAX_BUSINESSES; ++i)
  609. {
  610. if(Businesses[i][bType] == BUSINESS_TYPE_BAR)
  611. {
  612. switch(Businesses[i][bStatus])
  613. {
  614. case 0: szStatus = "{FF0000} CLOSED";
  615. case 1: szStatus = "{00FF00} OPEN";
  616. }
  617. format(szMiscArray, sizeof(szMiscArray), "%s%s\t%s\n", szMiscArray, Businesses[i][bName], szStatus);
  618. ListItemTrackId[playerid][j++] = i;
  619. }
  620. }
  621. if(j == 0) return SendClientMessage(playerid, COLOR_GRAD1, "There are none.");
  622. }
  623. case 4:
  624. {
  625. for(new i; i < MAX_BUSINESSES; ++i)
  626. {
  627. if(Businesses[i][bType] == BUSINESS_TYPE_GUNSHOP)
  628. {
  629. switch(Businesses[i][bStatus])
  630. {
  631. case 0: szStatus = "{FF0000} CLOSED";
  632. case 1: szStatus = "{00FF00} OPEN";
  633. }
  634. format(szMiscArray, sizeof(szMiscArray), "%s%s\t%s\n", szMiscArray, Businesses[i][bName], szStatus);
  635. ListItemTrackId[playerid][j++] = i;
  636. }
  637. }
  638. if(j == 0) return SendClientMessage(playerid, COLOR_GRAD1, "There are none.");
  639. }
  640. case 5:
  641. {
  642. for(new i; i < MAX_BUSINESSES; ++i)
  643. {
  644. if(Businesses[i][bType] == BUSINESS_TYPE_GASSTATION)
  645. {
  646. switch(Businesses[i][bStatus])
  647. {
  648. case 0: szStatus = "{FF0000} CLOSED";
  649. case 1: szStatus = "{00FF00} OPEN";
  650. }
  651. format(szMiscArray, sizeof(szMiscArray), "%s%s\t%s\n", szMiscArray, Businesses[i][bName], szStatus);
  652. ListItemTrackId[playerid][j++] = i;
  653. }
  654. }
  655. if(j == 0) return SendClientMessage(playerid, COLOR_GRAD1, "There are none.");
  656. }
  657. case 6:
  658. {
  659. for(new i; i < MAX_BUSINESSES; ++i)
  660. {
  661. if(Businesses[i][bType] == BUSINESS_TYPE_NEWCARDEALERSHIP)
  662. {
  663. switch(Businesses[i][bStatus])
  664. {
  665. case 0: szStatus = "{FF0000} CLOSED";
  666. case 1: szStatus = "{00FF00} OPEN";
  667. }
  668. format(szMiscArray, sizeof(szMiscArray), "%s%s\t%s\n", szMiscArray, Businesses[i][bName], szStatus);
  669. ListItemTrackId[playerid][j++] = i;
  670. }
  671. }
  672. if(j == 0) return SendClientMessage(playerid, COLOR_GRAD1, "There are none.");
  673. }
  674. case 7:
  675. {
  676. for(new i; i < MAX_BUSINESSES; ++i)
  677. {
  678. if(Businesses[i][bType] == BUSINESS_TYPE_CLUB)
  679. {
  680. switch(Businesses[i][bStatus])
  681. {
  682. case 0: szStatus = "{FF0000} CLOSED";
  683. case 1: szStatus = "{00FF00} OPEN";
  684. }
  685. format(szMiscArray, sizeof(szMiscArray), "%s%s\t%s\n", szMiscArray, Businesses[i][bName], szStatus);
  686. ListItemTrackId[playerid][j++] = i;
  687. }
  688. }
  689. if(j == 0) return SendClientMessage(playerid, COLOR_GRAD1, "There are none.");
  690. }
  691. }
  692. ShowPlayerDialogEx(playerid, DIALOG_MAP_BUSINESSES2, DIALOG_STYLE_TABLIST, "San Andreas | Map | Businesses", szMiscArray, "Select", "Back");
  693. return 1;
  694. }
  695. Map_ShowJobs(playerid, iJobType)
  696. {
  697. if(!(1 <= iJobType < MAX_JOBPOINTS)) return SendClientMessageEx(playerid, COLOR_GREY, "Invalid job type specified.");
  698. for(new i; i < MAX_JOBPOINTS; ++i) {
  699. if(JobData[i][jType] == iJobType) {
  700. gPlayerCheckpointStatus[playerid] = CHECKPOINT_JOB;
  701. SetPVarInt(playerid, "gpsJob", i);
  702. SetPlayerCheckpoint(playerid, JobData[i][jPos][0], JobData[i][jPos][1], JobData[i][jPos][2], 5.0);
  703. SendClientMessage(playerid, COLOR_YELLOW, "A checkpoint has been marked on your map.");
  704. return 1;
  705. }
  706. }
  707. SendClientMessage(playerid, COLOR_GRAD1, "Applications are currently closed for that job.");
  708. return 1;
  709. }