dynjobcore.pwn 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808
  1. #include <YSI\y_hooks>
  2. #define PVAR_JOB_OBTAINING "JOB_OB"
  3. new JobCount = 0;
  4. hook OnGameModeInit() {
  5. //Jobpoints
  6. for(new i = 0; i < MAX_JOBPOINTS; i++) {
  7. JobData[i][jId] = -1;
  8. JobData[i][jType] = 0;
  9. JobData[i][jPos][0] = 0.0;
  10. JobData[i][jPos][1] = 0.0;
  11. JobData[i][jPos][2] = 0.0;
  12. JobData[i][jVw] = 0;
  13. JobData[i][jInt] = 0;
  14. JobData[i][jLevel] = 1;
  15. //JobData[i][jAreaID] =
  16. }
  17. for(new n = 1; n < MAX_JOBTYPES; n++) {
  18. format(JobName[n], 32, "-----");
  19. }
  20. //Jobvehs
  21. }
  22. hook OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
  23. if((newkeys & KEY_YES) && IsPlayerInAnyDynamicArea(playerid)) {
  24. new areaid[1];
  25. GetPlayerDynamicAreas(playerid, areaid);
  26. // new i = Streamer_GetIntData(STREAMER_TYPE_AREA, areaid[0], E_STREAMER_EXTRA_ID);
  27. if(areaid[0] != INVALID_STREAMER_ID) {
  28. for(new i; i < MAX_JOBPOINTS; ++i) {
  29. if(areaid[0] == JobData[i][jAreaID]) Job_GetJob(playerid, i);
  30. }
  31. }
  32. }
  33. }
  34. stock LoadJobNames()
  35. {
  36. printf("[Dynamic Jobs Names] Loading Dynamic Job names from the database, please wait...");
  37. mysql_tquery(MainPipeline, "SELECT * FROM `jobs_types`", "OnLoadJobNames", "");
  38. }
  39. forward OnLoadJobNames();
  40. public OnLoadJobNames()
  41. {
  42. szMiscArray[0] = 0;
  43. new i, rows;
  44. cache_get_row_count(rows);
  45. while(i < rows)
  46. {
  47. if(i < MAX_JOBTYPES) {
  48. cache_get_value_name(i, "name", JobName[i], 32);
  49. }
  50. i++;
  51. }
  52. if(i > 0) printf("[Dynamic Job Names] %d dynamic job names have been loaded.", i-1);
  53. else printf("[Dynamic Job Names] No dynamic job names have been loaded.");
  54. return 1;
  55. }
  56. stock LoadJobPoints()
  57. {
  58. LoadJobNames();
  59. printf("[Dynamic Jobs] Loading Dynamic Jobs from the database, please wait...");
  60. mysql_tquery(MainPipeline, "SELECT * FROM `jobs`", "OnLoadJobPoints", "");
  61. }
  62. forward OnLoadJobPoints();
  63. public OnLoadJobPoints()
  64. {
  65. szMiscArray[0] = 0;
  66. new i, rows, sqlid;
  67. cache_get_row_count(rows);
  68. while(i < rows)
  69. {
  70. cache_get_value_name_int(i, "id", JobData[i][jId]);
  71. if(i < MAX_JOBPOINTS) {
  72. cache_get_value_name_int(i, "type", JobData[i][jType]);
  73. cache_get_value_name_float(i, "posx", JobData[i][jPos][0]);
  74. cache_get_value_name_float(i, "posy", JobData[i][jPos][1]);
  75. cache_get_value_name_float(i, "posz", JobData[i][jPos][2]);
  76. cache_get_value_name_int(i, "vw", JobData[i][jVw]);
  77. cache_get_value_name_int(i, "int", JobData[i][jInt]);
  78. cache_get_value_name_int(i, "marker", JobData[i][jMarkerID]);
  79. cache_get_value_name_int(i, "level", JobData[i][jLevel]);
  80. UpdateJobPoint(i);
  81. ++JobCount;
  82. } else {
  83. mysql_format(MainPipeline, szMiscArray, sizeof(szMiscArray), "DELETE FROM `jobs` WHERE `id` = %d", sqlid);
  84. mysql_tquery(MainPipeline, szMiscArray, "OnQueryFinish", "i", SENDDATA_THREAD);
  85. }
  86. i++;
  87. }
  88. if(JobCount > 0) printf("[Dynamic Job Points] %d dynamic job points has been loaded.", i);
  89. else printf("[Dynamic Job Points] No dynamic job points has been loaded.");
  90. return 1;
  91. }
  92. stock SaveJobPoint(i) {
  93. new query[2048];
  94. format(query, 2048, "UPDATE `jobs` SET ");
  95. SaveInteger(query, "jobs", i+1, "type", JobData[i][jType]);
  96. SaveFloat(query, "jobs", i+1, "posx", JobData[i][jPos][0]);
  97. SaveFloat(query, "jobs", i+1, "posy", JobData[i][jPos][1]);
  98. SaveFloat(query, "jobs", i+1, "posz", JobData[i][jPos][2]);
  99. SaveInteger(query, "jobs", i+1, "vw", JobData[i][jVw]);
  100. SaveInteger(query, "jobs", i+1, "int", JobData[i][jInt]);
  101. SaveInteger(query, "jobs", i+1, "marker", JobData[i][jMarkerID]);
  102. SaveInteger(query, "jobs", i+1, "level", JobData[i][jLevel]);
  103. SQLUpdateFinish(query, "jobs", i+1);
  104. }
  105. forward UpdateJobPoint(id);
  106. public UpdateJobPoint(id)
  107. {
  108. szMiscArray[0] = 0;
  109. if(IsValidDynamicArea(JobData[id][jAreaID])) DestroyDynamicArea(JobData[id][jAreaID]);
  110. if(IsValidDynamicPickup(JobData[id][jPickupID])) DestroyDynamicPickup(JobData[id][jPickupID]);
  111. if(IsValidDynamic3DTextLabel(JobData[id][jTextID])) DestroyDynamic3DTextLabel(JobData[id][jTextID]);
  112. if(IsValidDynamicMapIcon(JobData[id][jMapMarker])) DestroyDynamicMapIcon(JobData[id][jMapMarker]);
  113. if(JobData[id][jPos][0] == 0.0) return 1;
  114. JobData[id][jAreaID] = CreateDynamicSphere(JobData[id][jPos][0], JobData[id][jPos][1], JobData[id][jPos][2], 3.0, .worldid = JobData[id][jVw], .interiorid = JobData[id][jInt]);
  115. JobData[id][jMapMarker] = CreateDynamicMapIcon(JobData[id][jPos][0], JobData[id][jPos][1], JobData[id][jPos][2], (JobData[id][jMarkerID] < 5 || JobData[id][jMarkerID] > 63) ? 56 : JobData[id][jMarkerID], 0, .streamdistance = 500.0, .style = MAPICON_GLOBAL);
  116. JobData[id][jPickupID] = CreateDynamicPickup(1239, 23, JobData[id][jPos][0], JobData[id][jPos][1], JobData[id][jPos][2], .worldid = JobData[id][jVw], .interiorid = JobData[id][jInt], .streamdistance = 200.0);
  117. format(szMiscArray, sizeof szMiscArray, "{FFFF00}Job Point ({FFFFFF}ID: %i{FFFF00})\n\nName: {FFFFFF}%s\n{FFFF00}Press {FFFFFF}~k~~CONVERSATION_YES~ {FFFF00}to obtain the job.", id, GetJobName(JobData[id][jType]));
  118. JobData[id][jTextID] = CreateDynamic3DTextLabel(szMiscArray, COLOR_YELLOW, JobData[id][jPos][0], JobData[id][jPos][1], JobData[id][jPos][2]+0.6, 10.0, .testlos = 1, .worldid = JobData[id][jVw], .interiorid = JobData[id][jInt], .streamdistance = 10.0);
  119. return 1;
  120. }
  121. /*LoadJobVehicles() {
  122. mysql_tquery(MainPipeline, "SELECT * FROM `jobs_vehicles`", true, "OnLoadJobVehicles", "");
  123. }
  124. forward OnLoadJobVehicles();
  125. public OnLoadJobVehicles()
  126. {
  127. new iRows = cache_get_row_count();
  128. if(!iRows) print("[Job Vehicles] There are no job vehicles in the database.");
  129. new iFields,
  130. idx,
  131. Float:fPos[2];
  132. cache_get_data(iRows, iFields, MainPipeline);
  133. while(idx < iRows) {
  134. fPos[0] = cache_get_field_content_float(idx, "posx", MainPipeline);
  135. fPos[1] = cache_get_field_content_float(idx, "posy", MainPipeline);
  136. if(fPos[0] != 0 && fPos[1] != 0) {
  137. JobVehData[idx][jveh_iTypeID] = cache_get_field_content_int(idx, "type", MainPipeline);
  138. Job_ProcessJobVehicle(idx,
  139. cache_get_field_content_int(idx, "vehid", MainPipeline),
  140. fPos[0],
  141. fPos[1],
  142. cache_get_field_content_float(idx, "posz", MainPipeline),
  143. cache_get_field_content_float(idx, "rotz", MainPipeline),
  144. cache_get_field_content_int(idx, "col1", MainPipeline),
  145. cache_get_field_content_int(idx, "col2", MainPipeline));
  146. }
  147. idx++;
  148. }
  149. printf("[Job Vehicles] Loaded %d job vehicles.", idx);
  150. }*/
  151. stock Job_GetPlayerJob(playerID)
  152. {
  153. if(PlayerInfo[playerID][pJob] <= 0)
  154. return 0;
  155. for(new i; i < MAX_JOBPOINTS; ++i) if(PlayerInfo[playerID][pJob] == JobData[i][jType]) return JobData[i][jType];
  156. return 0;
  157. }
  158. stock Job_GetPlayerJob2(playerID)
  159. {
  160. if(PlayerInfo[playerID][pJob2] == 0)
  161. return 0;
  162. for(new i; i < MAX_JOBPOINTS; ++i) if(PlayerInfo[playerID][pJob2] == JobData[i][jType]) return JobData[i][jType];
  163. return 0;
  164. }
  165. Job_GetJob(playerid, i)
  166. {
  167. if(PlayerInfo[playerid][pLevel] < JobData[i][jLevel])
  168. {
  169. format(szMiscArray, sizeof(szMiscArray), "You need to be level %i to get this job.", JobData[i][jLevel]);
  170. return SendClientMessageEx(playerid, COLOR_GRAD1, szMiscArray);
  171. }
  172. if(PlayerInfo[playerid][pJob] == JobData[i][jType] || PlayerInfo[playerid][pJob2] == JobData[i][jType] || PlayerInfo[playerid][pJob3] == JobData[i][jType]) {
  173. return SendClientMessageEx(playerid, COLOR_GRAD1, "You already have this job.");
  174. }
  175. if(PlayerInfo[playerid][pJob] == 0) format(szMiscArray, sizeof(szMiscArray), "Would you like to proceed a career as a {FFFF00}%s{FFFFFF}?", GetJobName(JobData[i][jType]));
  176. else if(0 < PlayerInfo[playerid][pDonateRank] < 4) format(szMiscArray, sizeof(szMiscArray), "Would you like to proceed a career as a {FFFF00}%s{FFFFFF}? (VIP Job)", GetJobName(JobData[i][jType]));
  177. else if(PlayerInfo[playerid][pDonateRank] > 3) format(szMiscArray, sizeof(szMiscArray), "Would you like to proceed a career as a {FFFF00}%s{FFFFFF}? (Platinum VIP Job)", GetJobName(JobData[i][jType]));
  178. else if(PlayerInfo[playerid][pFamed] > 0) format(szMiscArray, sizeof(szMiscArray), "Would you like to proceed a career as a {FFFF00}%s{FFFFFF}? (OS/Famed Job)", GetJobName(JobData[i][jType]));
  179. else if(PlayerInfo[playerid][pJob] > 0 && PlayerInfo[playerid][pDonateRank] == 0 && PlayerInfo[playerid][pFamed] == 0) return SendClientMessageEx(playerid, COLOR_GRAD1, "You already have a job, use '/quitjob' from your old job in order to obtain a new one.");
  180. SetPVarInt(playerid, PVAR_JOB_OBTAINING, JobData[i][jType]);
  181. Dialog_Show(playerid, acceptjob, DIALOG_STYLE_MSGBOX, "Job Point", szMiscArray, "Yes", "No");
  182. return 1;
  183. }
  184. stock GetJobName(i)
  185. {
  186. return JobName[i];
  187. }
  188. CMD:getjob(playerid, params[])
  189. {
  190. SendClientMessageEx(playerid, COLOR_GRAD1, "This command has been removed. Use ~k~~CONVERSATION_YES~ while near a job point.");
  191. return 1;
  192. }
  193. /*
  194. CMD:jobtypes(playerid) {
  195. szMiscArray = "Job Type ID\tName\n";
  196. for(new i; i < MAX_JOBTYPES; ++i)
  197. {
  198. if(!isnull(szJobNames[i])) format(szMiscArray, sizeof(szMiscArray), "%sID %d:\t%s\n", szMiscArray, i, szJobNames[i]);
  199. }
  200. ShowPlayerDialogEx(playerid, DIALOG_NOTHING, DIALOG_STYLE_TABLIST_HEADERS, "Job List", szMiscArray, "<<", "");
  201. return 1;
  202. }
  203. */
  204. CMD:jobpointhelp(playerid, params[])
  205. {
  206. if(PlayerInfo[playerid][pAdmin] >= 2) {
  207. SendClientMessageEx(playerid, COLOR_GREEN,"|____________________| Job Point Commands |____________________|");
  208. SendClientMessageEx(playerid, COLOR_GRAD2, "--* Job Commands --* '/gotojob'");
  209. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1) {
  210. SendClientMessageEx(playerid, COLOR_GRAD2, "--* Job Commands --* '/editjobpoint' - '/editjob'");
  211. // SendClientMessageEx(playerid, COLOR_GRAD1, "--* Job Vehicle Commands --* '/createjobtype' - '/jobtypes' - '/createjobveh' - '/deletejobveh'");
  212. }
  213. SendClientMessageEx(playerid, COLOR_GREEN,"_____________________________________________________________");
  214. }
  215. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorised to use this command.");
  216. return 1;
  217. }
  218. CMD:gotojob(playerid, params[]) {
  219. szMiscArray[0] = 0;
  220. new
  221. jobid;
  222. if(PlayerInfo[playerid][pAdmin] >= 2)
  223. {
  224. if(sscanf(params, "i", jobid))
  225. return SendClientMessageEx(playerid, COLOR_GRAD1, "/gotojob [jobid]");
  226. if(!(0 <= jobid < MAX_JOBPOINTS)) return SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid job ID provided must be 0 - 99.");
  227. if(JobData[jobid][jType] == 0 || JobData[jobid][jPos][0] == 0.0) return SendClientMessageEx(playerid, COLOR_GRAD2, "Job id given is not being used!");
  228. SetPlayerPos(playerid, JobData[jobid][jPos][0], JobData[jobid][jPos][1], JobData[jobid][jPos][2]);
  229. SetPlayerInterior(playerid, JobData[jobid][jInt]);
  230. PlayerInfo[playerid][pInt] = JobData[jobid][jInt];
  231. SetPlayerVirtualWorld(playerid, JobData[jobid][jVw]);
  232. PlayerInfo[playerid][pVW] = JobData[jobid][jVw];
  233. format(szMiscArray, sizeof szMiscArray, "You have teleported to job point ID %i.", jobid);
  234. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMiscArray);
  235. }
  236. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorised to use this command.");
  237. return 1;
  238. }
  239. CMD:editjobpoint(playerid, params[]) {
  240. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  241. {
  242. ListJobPoints(playerid);
  243. }
  244. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to do this!");
  245. return 1;
  246. }
  247. CMD:editjob(playerid, params[]) {
  248. szMiscArray[0] = 0;
  249. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  250. {
  251. for(new i = 1; i != MAX_JOBTYPES; i++)
  252. format(szMiscArray, sizeof(szMiscArray), "%s(%d) %s\n", szMiscArray, i, GetJobName(i));
  253. //strcat(szMiscArray, "\n"), strcat(szMiscArray, GetJobName(i));
  254. Dialog_Show(playerid, job_name, DIALOG_STYLE_LIST, "Edit Job Name", szMiscArray, "Select", "Cancel");
  255. }
  256. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to do thiS!");
  257. return 1;
  258. }
  259. Dialog:job_name(playerid, response, listitem, inputtext[]) {
  260. if(response) {
  261. szMiscArray[0] = 0;
  262. format(szMiscArray, sizeof(szMiscArray), "Please enter in a new name to replace job %s (ID: %d) with.", GetJobName(listitem+1), listitem+1);
  263. Dialog_Show(playerid, job_name_confirm, DIALOG_STYLE_INPUT, "Please specify a new job name", szMiscArray, "Edit", "Close");
  264. SetPVarInt(playerid, "JobEditName", listitem+1);
  265. }
  266. return 1;
  267. }
  268. Dialog:job_name_confirm(playerid, response, listitem, inputtext[]) {
  269. szMiscArray[0] = 0;
  270. if(response) {
  271. szMiscArray[0] = 0;
  272. new
  273. id = GetPVarInt(playerid, "JobEditName");
  274. if(!(1 < strlen(inputtext) < 32) || isnull(inputtext)) {
  275. format(szMiscArray, sizeof(szMiscArray), "Please enter in a new name to replace job %s (ID: %d) with.\n\nYou must specify a name and it must be between 1 and 32 characters in length!", GetJobName(id), id);
  276. return Dialog_Show(playerid, job_name_confirm, DIALOG_STYLE_INPUT, "Please specify a new job name", szMiscArray, "Edit", "Close");
  277. }
  278. format(szMiscArray, sizeof(szMiscArray), "%s has edited Job ID %d's name from %s to %s", GetPlayerNameEx(playerid), id, GetJobName(id), inputtext);
  279. Log("logs/jobedit.log", szMiscArray);
  280. SendClientMessageEx(playerid, COLOR_YELLOW, "You have changed job id: %d's name from %s to %s.", id, GetJobName(id), inputtext);
  281. mysql_escape_string(inputtext, JobName[id]);
  282. mysql_format(MainPipeline, szMiscArray, sizeof(szMiscArray), "UPDATE `jobs_types` SET `name` = '%e' WHERE `id` = %d", JobName[id], id);
  283. mysql_tquery(MainPipeline, szMiscArray, "OnQueryFinish", "i", SENDDATA_THREAD);
  284. for(new j; j < MAX_JOBPOINTS; j++) {
  285. if(JobData[j][jType] == id) {
  286. UpdateJobPoint(j);
  287. }
  288. }
  289. } else {
  290. DeletePVar(playerid, "JobEditName");
  291. }
  292. return 1;
  293. }
  294. stock ListJobPoints(playerid) {
  295. szMiscArray[0] = 0;
  296. new i = 0;
  297. while(i < MAX_JOBPOINTS) {
  298. if(strcmp(JobName[JobData[i][jType]], "-----", true) != 0)
  299. {
  300. format(szMiscArray, sizeof(szMiscArray), "%s\n(%i) %s{FFFFFF}", szMiscArray, i, JobName[JobData[i][jType]]);
  301. }
  302. else
  303. {
  304. format(szMiscArray, sizeof(szMiscArray), "%s\n(%i) (Not Placed)", szMiscArray, i);
  305. }
  306. ++i; // Outside.
  307. }
  308. return Dialog_Show(playerid, jobpoints, DIALOG_STYLE_LIST, "Edit Job Point", szMiscArray, "Select", "Close");
  309. }
  310. Dialog:jobpoints(playerid, response, listitem, inputtext[]) {
  311. if(response)
  312. {
  313. if(PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pASM] < 1) return 1;
  314. SetPVarInt(playerid, "JobEditID", listitem);
  315. JobEditID(playerid, listitem);
  316. }
  317. return 1;
  318. }
  319. stock JobEditID(playerid, jobid) {
  320. szMiscArray[0] = 0;
  321. new szTitle[52];
  322. format(szTitle, sizeof(szTitle), "Editing Job: %s | Job ID: %d", JobName[JobData[jobid][jType]], jobid);
  323. format(szMiscArray, sizeof(szMiscArray),
  324. "{BBBBBB}Job Type:\t{FFFFFF}%s\n\
  325. {BBBBBB}Move job point to my position\n\
  326. {BBBBBB}Player Level Required:\t{FFFFFF}%d\n\
  327. {BBBBBB}Delete Job Position\n",
  328. JobName[JobData[jobid][jType]],
  329. JobData[jobid][jLevel]
  330. );
  331. return Dialog_Show(playerid, editjob, DIALOG_STYLE_TABLIST, szTitle, szMiscArray, "Select", "Back");
  332. }
  333. Dialog:acceptjob(playerid, response, listitem, inputtext[]) {
  334. szMiscArray[0] = 0;
  335. if(response) {
  336. new iJob = GetPVarInt(playerid, PVAR_JOB_OBTAINING);
  337. if(PlayerInfo[playerid][pJob] == 0) {
  338. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Congratulations with your new Job, type /help to see your new command.");
  339. if(iJob == 21) {
  340. SendClientMessageEx(playerid, COLOR_WHITE, "You have been given a Pizza Stack uniform!");
  341. SendClientMessageEx(playerid, COLOR_WHITE, "You have been accepted to join the Pizza Nation; one of the most secret societies in the world.");
  342. SendClientMessageEx(playerid, COLOR_WHITE, "Remember: Do not consume the holy pizza, or else face a long, painful, imminent death.");
  343. SetPlayerSkin(playerid, 155);
  344. PlayerInfo[playerid][pModel] = 155;
  345. }
  346. PlayerInfo[playerid][pJob] = iJob;
  347. DeletePVar(playerid, PVAR_JOB_OBTAINING);
  348. return 1;
  349. }
  350. if((PlayerInfo[playerid][pDonateRank] > 0 || PlayerInfo[playerid][pFamed] > 0) && PlayerInfo[playerid][pJob2] == 0) {
  351. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Congratulations with your new Job, type /help to see your new command.");
  352. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You have taken this as a secondary job.");
  353. if(iJob == 21) {
  354. SendClientMessageEx(playerid, COLOR_WHITE, "You have been given a Pizza Stack uniform!");
  355. SendClientMessageEx(playerid, COLOR_WHITE, "You have been accepted to Pizza Nation; one of the most secret societies in the world.");
  356. SendClientMessageEx(playerid, COLOR_WHITE, "Remember: Do not consume the holy pizza, or else face a long, painful, imminent death.");
  357. SetPlayerSkin(playerid, 155);
  358. PlayerInfo[playerid][pModel] = 155;
  359. }
  360. PlayerInfo[playerid][pJob2] = iJob;
  361. DeletePVar(playerid, PVAR_JOB_OBTAINING);
  362. return 1;
  363. }
  364. if((PlayerInfo[playerid][pDonateRank] >= 3 || PlayerInfo[playerid][pFamed] > 0) && PlayerInfo[playerid][pJob3] == 0) {
  365. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "* Congratulations with your new Job, type /help to see your new command.");
  366. SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You have taken this as a third job.");
  367. if(iJob == 21) {
  368. SendClientMessageEx(playerid, COLOR_WHITE, "You have been given a Pizza Stack uniform!");
  369. SendClientMessageEx(playerid, COLOR_WHITE, "You have been accepted to Pizza Nation; one of the most secret societies in the world.");
  370. SendClientMessageEx(playerid, COLOR_WHITE, "Remember: Do not consume the holy pizza, or else face a long, painful, imminent death.");
  371. SetPlayerSkin(playerid, 155);
  372. PlayerInfo[playerid][pModel] = 155;
  373. }
  374. PlayerInfo[playerid][pJob3] = iJob;
  375. DeletePVar(playerid, PVAR_JOB_OBTAINING);
  376. return 1;
  377. }
  378. return SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot take any more jobs. Please use /quitjob to take this job.");
  379. }
  380. return 1;
  381. }
  382. Dialog:editjob(playerid, response, listitem, inputtext[]) {
  383. szMiscArray[0] = 0;
  384. if(response) {
  385. if(PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pASM] < 1) return 1;
  386. new
  387. jobid = GetPVarInt(playerid, "JobEditID"),
  388. szTitle[52];
  389. switch(listitem) {
  390. case 0: {
  391. for(new i = 1; i != MAX_JOBTYPES; i++)
  392. strcat(szMiscArray, "\n"), strcat(szMiscArray, GetJobName(i));
  393. format(szTitle, sizeof(szTitle), "Edit Job Type (%s) ID: %d", JobName[JobData[jobid][jType]], jobid);
  394. Dialog_Show(playerid, job_type, DIALOG_STYLE_LIST, szTitle, szMiscArray, "Select", "Cancel");
  395. }
  396. case 1: {
  397. format(szMiscArray, sizeof(szMiscArray), "Are you sure you want to move %s (ID: %d) to your current position?", GetJobName(JobData[jobid][jType]), jobid);
  398. Dialog_Show(playerid, moveconfirm, DIALOG_STYLE_MSGBOX, "Relocation Confirmation", szMiscArray, "Yes", "No");
  399. }
  400. case 2: {
  401. format(szTitle, sizeof(szTitle), "Edit player Level requirement (%s) ID: %d", JobName[JobData[jobid][jType]], jobid);
  402. format(szMiscArray, sizeof(szMiscArray), "Are you sure you want change Job ID: %d's level from %d?", jobid, JobData[jobid][jLevel]);
  403. Dialog_Show(playerid, job_level, DIALOG_STYLE_INPUT, szTitle, szMiscArray, "Yes", "No");
  404. }
  405. case 3: {
  406. format(szMiscArray, sizeof(szMiscArray), "Are you sure you want to delete job point: %s (ID: %d)?", GetJobName(JobData[jobid][jType]), jobid);
  407. Dialog_Show(playerid, pointdeleteconfirm, DIALOG_STYLE_MSGBOX, "Job Point Deletion Confirmation", szMiscArray, "Yes", "No");
  408. }
  409. }
  410. } else {
  411. if(GetPVarType(playerid, "JobEditID")) {
  412. SaveJobPoint(GetPVarInt(playerid, "JobEditID"));
  413. }
  414. DeletePVar(playerid, "JobEditID");
  415. return ListJobPoints(playerid);
  416. }
  417. return 1;
  418. }
  419. Dialog:job_level(playerid, response, listitem, inputtext[]) {
  420. szMiscArray[0] = 0;
  421. new
  422. jobid = GetPVarInt(playerid, "JobEditID");
  423. if(!(1 <= strval(inputtext))) return DeletePVar(playerid, "JobEditID"), SendClientMessageEx(playerid, COLOR_GRAD1, "The job Level may not be less than 1");
  424. if(!IsNumeric(inputtext)) return DeletePVar(playerid, "JobEditID"), SendClientMessageEx(playerid, COLOR_GRAD1, "You may only use numbers.");
  425. format(szMiscArray, sizeof(szMiscArray), "%s has edited Job Point %d's level from %d to %d", GetPlayerNameEx(playerid), jobid, JobData[jobid][jLevel], strval(inputtext));
  426. Log("logs/jobedit.log", szMiscArray);
  427. format(szMiscArray, sizeof(szMiscArray), "You have successfully changed Job ID: %d's level from %d to %d.", jobid, JobData[jobid][jLevel], strval(inputtext));
  428. JobData[jobid][jLevel] = strval(inputtext);
  429. SendClientMessageEx(playerid, COLOR_YELLOW, szMiscArray);
  430. SaveJobPoint(jobid);
  431. UpdateJobPoint(jobid);
  432. return JobEditID(playerid, jobid);
  433. }
  434. Dialog:pointdeleteconfirm(playerid, response, listitem, inputtext[]) {
  435. szMiscArray[0] = 0;
  436. new
  437. jobid = GetPVarInt(playerid, "JobEditID");
  438. if(!response) return SendClientMessageEx(playerid, COLOR_GRAD1, "You have chosen to not delete job point: (%s) ID: %d", JobName[JobData[jobid][jType]], jobid);
  439. format(szMiscArray, sizeof(szMiscArray), "%s has deleted Job Point %d (%s)", GetPlayerNameEx(playerid), jobid, JobName[JobData[jobid][jType]]);
  440. Log("logs/jobedit.log", szMiscArray);
  441. JobData[jobid][jId] = -1;
  442. JobData[jobid][jType] = 0;
  443. JobData[jobid][jPos][0] = 0.0;
  444. JobData[jobid][jPos][1] = 0.0;
  445. JobData[jobid][jPos][2] = 0.0;
  446. JobData[jobid][jVw] = 0;
  447. JobData[jobid][jInt] = 0;
  448. JobData[jobid][jLevel] = 1;
  449. SendClientMessageEx(playerid, COLOR_YELLOW, "You have successfully deleted this job point.");
  450. SaveJobPoint(jobid);
  451. UpdateJobPoint(jobid);
  452. return ListJobPoints(playerid);
  453. }
  454. Dialog:moveconfirm(playerid, response, listitem, inputtext[]) {
  455. szMiscArray[0] = 0;
  456. new
  457. jobid = GetPVarInt(playerid, "JobEditID"),
  458. Float:pos[3];
  459. if(!response) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are no longer editing (%s) ID: %d", JobName[JobData[jobid][jType]], jobid), JobEditID(playerid, jobid);
  460. GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
  461. format(szMiscArray, sizeof(szMiscArray), "%s has edited Job Point %d's Position (B: %f, %f, %f | A: %f, %f, %f)", GetPlayerNameEx(playerid), jobid, JobData[jobid][jPos][0], JobData[jobid][jPos][1], JobData[jobid][jPos][2], pos[0], pos[1], pos[2]);
  462. Log("logs/jobedit.log", szMiscArray);
  463. JobData[jobid][jPos][0] = pos[0];
  464. JobData[jobid][jPos][1] = pos[1];
  465. JobData[jobid][jPos][2] = pos[2];
  466. JobData[jobid][jInt] = GetPlayerInterior(playerid);
  467. JobData[jobid][jVw] = GetPlayerVirtualWorld(playerid);
  468. SendClientMessageEx(playerid, COLOR_YELLOW, "You have updated a job point position.");
  469. SaveJobPoint(jobid);
  470. UpdateJobPoint(jobid);
  471. return JobEditID(playerid, jobid);
  472. }
  473. /*
  474. {
  475. if(PlayerInfo[playerid][pLevel] < JobData[i][jLevel])
  476. {
  477. format(szMiscArray, sizeof(szMiscArray), "You need to be level %i to get this job.", JobData[i][jLevel]);
  478. return SendClientMessageEx(playerid, COLOR_GRAD1, szMiscArray);
  479. }
  480. if(PlayerInfo[playerid][pJob] == JobData[i][jType] || PlayerInfo[playerid][pJob2] == JobData[i][jType] || PlayerInfo[playerid][pJob3] == JobData[i][jType]) {
  481. return SendClientMessageEx(playerid, COLOR_GRAD1, "You already have this job.");
  482. }
  483. if(PlayerInfo[playerid][pJob] == 0) format(szMiscArray, sizeof(szMiscArray), "Would you like to proceed a career as a {FFFF00}%s{FFFFFF}?", GetJobName(JobData[i][jType]));
  484. else if(0 < PlayerInfo[playerid][pDonateRank] < 4) format(szMiscArray, sizeof(szMiscArray), "Would you like to proceed a career as a {FFFF00}%s{FFFFFF}? (VIP Job)", GetJobName(JobData[i][jType]));
  485. else if(PlayerInfo[playerid][pDonateRank] > 3) format(szMiscArray, sizeof(szMiscArray), "Would you like to proceed a career as a {FFFF00}%s{FFFFFF}? (Platinum VIP Job)", GetJobName(JobData[i][jType]));
  486. else if(PlayerInfo[playerid][pFamed] > 0) format(szMiscArray, sizeof(szMiscArray), "Would you like to proceed a career as a {FFFF00}%s{FFFFFF}? (OS/Famed Job)", GetJobName(JobData[i][jType]));
  487. else if(PlayerInfo[playerid][pJob] > 0 && PlayerInfo[playerid][pDonateRank] == 0 && PlayerInfo[playerid][pFamed] == 0) return SendClientMessageEx(playerid, COLOR_GRAD1, "You already have a job, use '/quitjob' from your old job in order to obtain a new one.");
  488. SetPVarInt(playerid, PVAR_JOB_OBTAINING, JobData[i][jType]);
  489. Dialog_Show(playerid, acceptjob, DIALOG_STYLE_MSGBOX, "Job Point", szMiscArray, "Yes", "No");
  490. return 1;
  491. }
  492. */
  493. Dialog:job_type(playerid, response, listitem, inputtext[]) {
  494. szMiscArray[0] = 0;
  495. new
  496. jobid = GetPVarInt(playerid, "JobEditID");
  497. szMiscArray[0] = 0;
  498. if(!response) return JobEditID(playerid, jobid);
  499. format(szMiscArray, sizeof(szMiscArray), "%s has edited Job Point %d's type from %s to %s.", GetPlayerNameEx(playerid), jobid, GetJobName(JobData[jobid][jType]), GetJobName(listitem+1));
  500. Log("logs/jobedit.log", szMiscArray);
  501. JobData[jobid][jType] = listitem+1;
  502. SendClientMessageEx(playerid, COLOR_YELLOW, "You have changed the job type to %s", GetJobName(listitem+1));
  503. SaveJobPoint(jobid);
  504. UpdateJobPoint(jobid);
  505. return JobEditID(playerid, jobid);
  506. }
  507. /*
  508. case DIALOG_GROUP_TYPE: {
  509. new
  510. iGroupID = GetPVarInt(playerid, "Group_EditID");
  511. if(response) {
  512. arrGroupData[iGroupID][g_iGroupType] = listitem;
  513. format(string, sizeof(string), "%s has changed group %d's type to %s", GetPlayerNameEx(playerid), iGroupID+1, Group_ReturnType(arrGroupData[iGroupID][g_iGroupType]));
  514. Log("logs/editgroup.log", string);
  515. }
  516. return Group_DisplayDialog(playerid, iGroupID);
  517. }
  518. */
  519. /*
  520. Dialog:job_name(playerid, response, listitem, inputtext[]) {
  521. new
  522. jobid = GetPVarInt(playerid, "JobEditName");
  523. szMiscArray[0] = 0;
  524. if(!response) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are no longer editing (%s) ID: %d", JobName[JobData[jobid][jType]], jobid);
  525. return Dialog_Show(playerid, job_name2, DIALOG_STYLE_INPUT, "Specify Job Name", "Please specify the job's name.", "Enter", "Back");
  526. }
  527. Dialog:job_name2(playerid, response, listitem, inputtext[]) {
  528. if(4 > strlen(inputtext) > MAX_JOBNAME_LEN) return DeletePVar(playerid, "JobEditName"), SendClientMessageEx(playerid, COLOR_GRAD1, "That name is either too short or long.");
  529. if(IsNumeric(inputtext)) return DeletePVar(playerid, "JobEditName"), SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot use numbers.");
  530. Job_CreateJobType(playerid, GetPVarInt(playerid, "JobEditName"), inputtext);
  531. format(szMiscArray, sizeof(szMiscArray), "You have successfully created the {FFFFFF}%s {FFFF00}job.", inputtext);
  532. SendClientMessageEx(playerid, COLOR_YELLOW, szMiscArray);
  533. DeletePVar(playerid, "JobEditName");
  534. return 1;
  535. }
  536. Job_CreateJobType(iPlayerID, i, name[]) {
  537. szMiscArray[0] = 0;
  538. mysql_format(MainPipeline, szMiscArray, sizeof(szMiscArray), "UPDATE `jobs_types` SET `name` = '%e' WHERE `id` = '%d'", name, i+1);
  539. mysql_tquery(MainPipeline, szMiscArray, false, "Job_OnCreateJobType", "iis", iPlayerID, i, name);
  540. }
  541. forward Job_OnCreateJobType(iPlayerID, i, name[]);
  542. public Job_OnCreateJobType(iPlayerID, i, name[])
  543. {
  544. if(mysql_affected_rows(MainPipeline)) {
  545. strcpy(JobName[i], name, 32); // Update the name variable to the new name.
  546. SendClientMessageEx(iPlayerID, COLOR_WHITE, "Job name has successfully been changed to %s", name);
  547. } else {
  548. SendClientMessageEx(iPlayerID, COLOR_RED, "There was an issue updating the job name!");
  549. }
  550. return 1;
  551. }*/
  552. /*
  553. forward Job_OnCreateJobType(iPlayerID, i, name[]);
  554. public Job_OnCreateJobType(iPlayerID, i, name[])
  555. {
  556. if(mysql_errno()) return SendClientMessageEx(iPlayerID, COLOR_GRAD1, "Something went wrong. Please try again later.");
  557. format(szMiscArray, sizeof(szMiscArray), "%s has created the %s job in slot %d", GetPlayerNameExt(iPlayerID), name, i);
  558. Log("logs/jobs/jobcreation.log", szMiscArray);
  559. return 1;
  560. }
  561. */
  562. /*
  563. case DIALOG_JOBS_EDITTYPE2:
  564. {
  565. if(4 > strlen(inputtext) > MAX_JOBNAME_LEN) return DeletePVar(playerid, PVAR_EDITINGJOBID), SendClientMessageEx(playerid, COLOR_GRAD1, "That name is either too short or long.");
  566. if(IsNumeric(inputtext)) return DeletePVar(playerid, PVAR_EDITINGJOBID), SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot use numbers.");
  567. Job_CreateJobType(playerid, GetPVarInt(playerid, PVAR_EDITINGJOBID), inputtext);
  568. format(szMiscArray, sizeof(szMiscArray), "You have successfully created the {FFFFFF}%s {FFFF00}job.", inputtext);
  569. SendClientMessageEx(playerid, COLOR_YELLOW, szMiscArray);
  570. DeletePVar(playerid, PVAR_EDITINGJOBID);
  571. return 1;
  572. }
  573. */
  574. /*CMD:createjobveh(playerid, params[]) {
  575. if(PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pASM] < 1) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use this command.");
  576. new iTypeID,
  577. iVehID,
  578. col[2];
  579. if(sscanf(params, "dddd", iTypeID, iVehID, col[0], col[1])) return SendClientMessageEx(playerid, COLOR_GRAD1, "Usage: /createjobveh [Job Type ID] [vehid] [col1] [col2]");
  580. if(!IsValidDynamic3DTextLabel(JobData[JobID][jTextID][0])) return SendClientMessageEx(playerid, COLOR_GRAD1, "This job type has not been setup yet.");
  581. if(!(400 <= iVehID <= 611)) return SendClientMessageEx(playerid, COLOR_GRAD1, "The vehicle ID must be between 400 and 611.");
  582. Job_CreateJobVehicle(playerid, iTypeID, iVehID, col[0], col[1]);
  583. return 1;
  584. }*/
  585. /*CJob_LoadJobVehicles() {
  586. mysql_tquery(MainPipeline, "SELECT * FROM `jobs_vehicles`", true, "Job_OnLoadJobVehicles", "");
  587. }
  588. forward Job_OnLoadJobVehicles();
  589. public Job_OnLoadJobVehicles()
  590. {
  591. new iRows = cache_get_row_count();
  592. if(!iRows) print("[Job Vehicles] There are no job vehicles in the database.");
  593. new iFields,
  594. idx,
  595. Float:fPos[2];
  596. cache_get_data(iRows, iFields, MainPipeline);
  597. while(idx < iRows) {
  598. fPos[0] = cache_get_field_content_float(idx, "posx", MainPipeline);
  599. fPos[1] = cache_get_field_content_float(idx, "posy", MainPipeline);
  600. if(fPos[0] != 0 && fPos[1] != 0) {
  601. arrJobVehData[idx][jveh_iTypeID] = cache_get_field_content_int(idx, "type", MainPipeline);
  602. Job_ProcessJobVehicle(idx,
  603. cache_get_field_content_int(idx, "vehid", MainPipeline),
  604. fPos[0],
  605. fPos[1],
  606. cache_get_field_content_float(idx, "posz", MainPipeline),
  607. cache_get_field_content_float(idx, "rotz", MainPipeline),
  608. cache_get_field_content_int(idx, "col1", MainPipeline),
  609. cache_get_field_content_int(idx, "col2", MainPipeline));
  610. }
  611. idx++;
  612. }
  613. printf("[Job Vehicles] Loaded %d job vehicles.", idx);
  614. }
  615. Job_ProcessJobVehicle(i, iVehID, Float:x, Float:y, Float:z, Float:rotz, color1, color2) {
  616. arrJobVehData[i][jveh_iVehID] = CreateVehicle(iVehID, x, y, z, rotz, color1, color2, 5000);
  617. }
  618. Job_CreateJobVehicle(iPlayerID, iTypeID, iVehID, color1, color2) {
  619. new i = Iter_Free(JobVehicle);
  620. if(i != -1)
  621. {
  622. new Float:fPos[4];
  623. GetPlayerPos(iPlayerID, fPos[0], fPos[1], fPos[2]);
  624. GetPlayerFacingAngle(iPlayerID, fPos[3]);
  625. format(szMiscArray, sizeof(szMiscArray), "UPDATE `jobs_vehicles` SET `typeid` = '%d', `vehid` = '%d', `posx` = '%f', `posy` = '%f', `posz` = '%f', \
  626. `rotz` = '%f', `vw` = '%d', `int` = '%d', `col1` = '%d', `col2` = '%d' WHERE `id` = '%d'",
  627. iTypeID, iVehID, fPos[0], fPos[1], fPos[2], fPos[3], GetPlayerVirtualWorld(iPlayerID), GetPlayerInterior(iPlayerID), color1, color2, i+1);
  628. mysql_tquery(MainPipeline, szMiscArray, true, "Job_OnCreateJobVehicle", "iiiffffii", i, iTypeID, iVehID, fPos[0], fPos[1], fPos[2], fPos[3], color1, color2);
  629. }
  630. else SendClientMessageEx(iPlayerID, COLOR_GRAD1, "You exceeded the maximum job vehicle quotum.");
  631. return 1;
  632. }
  633. Job_DeleteJobVehicle(iPlayerID, iVehID)
  634. {
  635. new i;
  636. foreach(i : JobVehicle) if(arrJobVehData[i][jveh_iVehID] == iVehID) break;
  637. format(szMiscArray, sizeof(szMiscArray), "UPDATE `jobs_vehicles` SET `posx` = '0', `posy` = '0', `posz` = '0' WHERE `id` = %d", i+1);
  638. return mysql_tquery(MainPipeline, szMiscArray, false, "Job_OnDeleteJobVehicle", "ii", iPlayerID, i);
  639. }
  640. forward Job_OnDeleteJobVehicle(iPlayerID, i);
  641. public Job_OnDeleteJobVehicle(iPlayerID, i)
  642. {
  643. if(mysql_errno()) return SendClientMessageEx(iPlayerID, COLOR_GRAD1, "Something went wrong. Please try again later.");
  644. Iter_Remove(JobVehicle, i);
  645. DestroyVehicle(arrJobVehData[i][jveh_iVehID]);
  646. return 1;
  647. }
  648. forward Job_OnCreateJobVehicle(i, iTypeID, iVehID, Float:x, Float:y, Float:z, Float:rotz, color1, color2);
  649. public Job_OnCreateJobVehicle(i, iTypeID, iVehID, Float:x, Float:y, Float:z, Float:rotz, color1, color2)
  650. {
  651. if(mysql_errno()) return printf("[Dynanmic Jobs System]: Couldn't create vehicle ID %d for job ID %d", iVehID, i);
  652. arrJobVehData[i][jveh_iTypeID] = iTypeID;
  653. arrJobVehData[i][jveh_iVehID] = CreateVehicle(iVehID, x, y, z, rotz, color1, color2, 5000);
  654. VehicleFuel[arrJobVehData[i][jveh_iVehID]] = 100.0;
  655. Iter_Add(JobVehicle, i);
  656. return 1;
  657. }
  658. CMD:createjobveh(playerid, params[])
  659. {
  660. if(PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pASM] < 1) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use this command.");
  661. new iTypeID,
  662. iVehID,
  663. col[2];
  664. if(sscanf(params, "dddd", iTypeID, iVehID, col[0], col[1])) return SendClientMessageEx(playerid, COLOR_GRAD1, "Usage: /createjobveh [Job Type ID] [vehid] [col1] [col2]");
  665. if(!Job_IsValidJob(iTypeID)) return SendClientMessageEx(playerid, COLOR_GRAD1, "This job type has not been setup yet.");
  666. if(!(400 <= iVehID <= 611)) return SendClientMessageEx(playerid, COLOR_GRAD1, "The vehicle ID must be between 400 and 611.");
  667. Job_CreateJobVehicle(playerid, iTypeID, iVehID, col[0], col[1]);
  668. return 1;
  669. }
  670. CMD:deletejobveh(playerid, params[])
  671. {
  672. if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use this command.");
  673. new iVehID;
  674. if(sscanf(params, "d", iVehID)) return SendClientMessageEx(playerid, COLOR_GRAD1, "Usage: /deletejobveh [vehid]");
  675. foreach(new i : JobVehicle)
  676. {
  677. if(arrJobVehData[i][jveh_iVehID] == iVehID) return Job_DeleteJobVehicle(playerid, i), 1;
  678. }
  679. SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid job vehicle ID specified.");
  680. return 1;
  681. }
  682. CMD:nearjobveh(playerid, params[])
  683. {
  684. if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use this command.");
  685. new Float:fPos2[3];
  686. GetPlayerPos(playerid, fPos2[0], fPos2[1], fPos2[2]);
  687. SendClientMessageEx(playerid, COLOR_GREEN, "[Job Vehicles] {FFFFFF} Listing all job vehicles within 30 meters of you.");
  688. foreach(new i : JobVehicle)
  689. {
  690. new Float:fPos[3];
  691. GetVehiclePos(arrJobVehData[i][jveh_iVehID], fPos[0], fPos[1], fPos[2]);
  692. if(IsPlayerInRangeOfPoint(playerid, 30.0, fPos[0], fPos[1], fPos[2]))
  693. {
  694. format(szMiscArray, sizeof(szMiscArray), "Job VehID: %d | Range: %.2f meters from you.", arrJobVehData[i][jveh_iVehID], GetDistanceBetweenPoints(fPos[0], fPos[1], fPos[2], fPos2[0], fPos2[1], fPos2[2]));
  695. SendClientMessageEx(playerid, COLOR_WHITE, szMiscArray);
  696. }
  697. }
  698. return 1;
  699. }*/