paynsprays.pwn 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. Dynamic PaynSpray System
  11. Next Generation Gaming, LLC
  12. (created by Next Generation Gaming Development Team)
  13. * Copyright (c) 2016, Next Generation Gaming, LLC
  14. *
  15. * All rights reserved.
  16. *
  17. * Redistribution and use in source and binary forms, with or without modification,
  18. * are not permitted in any case.
  19. *
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  25. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  26. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  27. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  28. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  29. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  30. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  31. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. */
  33. forward PayNSpray(playerid, id, vehicleid);
  34. public PayNSpray(playerid, id, vehicleid)
  35. {
  36. if(DynVeh[vehicleid] != -1 && DynVehicleInfo[DynVeh[vehicleid]][gv_igID] != INVALID_GROUP_ID)
  37. {
  38. new iGroupID = DynVehicleInfo[DynVeh[vehicleid]][gv_igID];
  39. if(arrGroupData[iGroupID][g_iBudget] >= PayNSprays[id][pnsGroupCost])
  40. {
  41. arrGroupData[iGroupID][g_iBudget] -= PayNSprays[id][pnsGroupCost];
  42. new str[128];
  43. format(str, sizeof(str), "%s has repaired vehicle %d at a cost of $%s to %s's budget fund.", GetPlayerNameEx(playerid), GetPlayerVehicleID(playerid), number_format(PayNSprays[id][pnsGroupCost]), arrGroupData[iGroupID][g_szGroupName]);
  44. GroupPayLog(iGroupID, str);
  45. SendClientMessageEx(playerid, COLOR_GREY, "This is a group vehicle and the repair cost has been paid by your agency.");
  46. }
  47. else
  48. {
  49. SendClientMessage(playerid, COLOR_WHITE, "Your agency does not have enough money in their funds to pay for this!");
  50. TogglePlayerControllable(playerid, 1);
  51. return 1;
  52. }
  53. }
  54. else
  55. {
  56. if(PlayerInfo[playerid][pCash] >= PayNSprays[id][pnsRegCost])
  57. {
  58. GivePlayerCash(playerid, -PayNSprays[id][pnsRegCost]);
  59. }
  60. else
  61. {
  62. SendClientMessage(playerid, COLOR_WHITE, "You don't have enough money to pay for this!");
  63. TogglePlayerControllable(playerid, 1);
  64. return 1;
  65. }
  66. }
  67. RepairVehicle(vehicleid);
  68. Vehicle_Armor(vehicleid);
  69. if(IsTrailerAttachedToVehicle(vehicleid))
  70. {
  71. RepairVehicle(GetVehicleTrailer(vehicleid));
  72. Vehicle_Armor(GetVehicleTrailer(vehicleid));
  73. }
  74. SendClientMessage(playerid, COLOR_WHITE, "Your vehicle has been repaired!");
  75. PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
  76. TogglePlayerControllable(playerid, 1);
  77. return 1;
  78. }
  79. CMD:pnsedit(playerid, params[])
  80. {
  81. if(PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pASM] < 1)
  82. {
  83. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use that command.");
  84. return 1;
  85. }
  86. new string[128], choice[32], id, amount;
  87. if(sscanf(params, "s[32]dD", choice, id, amount))
  88. {
  89. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /pnsedit [name] [id] [amount]");
  90. SendClientMessageEx(playerid, COLOR_GREY, "Available names: Position, GroupCost, RegCost, Delete");
  91. return 1;
  92. }
  93. if(id >= MAX_PAYNSPRAYS)
  94. {
  95. SendClientMessageEx(playerid, COLOR_WHITE, "Invalid Pay N' Spray ID!");
  96. return 1;
  97. }
  98. if(strcmp(choice, "position", true) == 0)
  99. {
  100. if(PayNSprays[id][pnsStatus] == 0)
  101. {
  102. PayNSprays[id][pnsStatus] = 1;
  103. }
  104. GetPlayerPos(playerid, PayNSprays[id][pnsPosX], PayNSprays[id][pnsPosY], PayNSprays[id][pnsPosZ]);
  105. PayNSprays[id][pnsInt] = GetPlayerInterior(playerid);
  106. PayNSprays[id][pnsVW] = GetPlayerVirtualWorld(playerid);
  107. format(string, sizeof(string), "You have changed the position on Pay N' Spray #%d.", id);
  108. SendClientMessageEx(playerid, COLOR_WHITE, string);
  109. DestroyDynamicPickup(PayNSprays[id][pnsPickupID]);
  110. DestroyDynamic3DTextLabel(PayNSprays[id][pnsTextID]);
  111. DestroyDynamicMapIcon(PayNSprays[id][pnsMapIconID]);
  112. format(string, sizeof(string), "/repaircar\nRepair Cost -- Regular: $%s | Faction: $%s\nID: %d", number_format(PayNSprays[id][pnsRegCost]), number_format(PayNSprays[id][pnsGroupCost]), id);
  113. PayNSprays[id][pnsTextID] = CreateDynamic3DTextLabel(string, COLOR_RED, PayNSprays[id][pnsPosX], PayNSprays[id][pnsPosY], PayNSprays[id][pnsPosZ]+0.5,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, PayNSprays[id][pnsVW], PayNSprays[id][pnsInt], -1);
  114. PayNSprays[id][pnsPickupID] = CreateDynamicPickup(1239, 23, PayNSprays[id][pnsPosX], PayNSprays[id][pnsPosY], PayNSprays[id][pnsPosZ], PayNSprays[id][pnsVW]);
  115. PayNSprays[id][pnsMapIconID] = CreateDynamicMapIcon(PayNSprays[id][pnsPosX], PayNSprays[id][pnsPosY], PayNSprays[id][pnsPosZ], 63, 0, PayNSprays[id][pnsVW], PayNSprays[id][pnsInt], -1, 500.0);
  116. SavePayNSpray(id);
  117. format(string, sizeof(string), "%s has edited Pay N' Spray ID %d's position.", GetPlayerNameEx(playerid), id);
  118. Log("logs/pnsedit.log", string);
  119. return 1;
  120. }
  121. else if(strcmp(choice, "groupcost", true) == 0)
  122. {
  123. if(PayNSprays[id][pnsStatus] == 0)
  124. {
  125. format(string, sizeof(string), "Pay N' Spray #%d does not exist.", id);
  126. SendClientMessageEx(playerid, COLOR_WHITE, string);
  127. return 1;
  128. }
  129. PayNSprays[id][pnsGroupCost] = amount;
  130. format(string, sizeof(string), "You have changed the group cost for Pay N' Spray #%d to $%s.", id, number_format(amount));
  131. SendClientMessageEx(playerid, COLOR_WHITE, string);
  132. DestroyDynamic3DTextLabel(PayNSprays[id][pnsTextID]);
  133. format(string, sizeof(string), "/repaircar\nRepair Cost -- Regular: $%s | Faction: $%s\nID: %d", number_format(PayNSprays[id][pnsRegCost]), number_format(PayNSprays[id][pnsGroupCost]), id);
  134. PayNSprays[id][pnsTextID] = CreateDynamic3DTextLabel(string, COLOR_RED, PayNSprays[id][pnsPosX], PayNSprays[id][pnsPosY], PayNSprays[id][pnsPosZ]+0.5,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, PayNSprays[id][pnsVW], PayNSprays[id][pnsInt], -1);
  135. SavePayNSpray(id);
  136. format(string, sizeof(string), "%s has changed the group cost on Pay N' Spray ID %d to $%s.", GetPlayerNameEx(playerid), id, number_format(amount));
  137. Log("logs/pnsedit.log", string);
  138. return 1;
  139. }
  140. else if(strcmp(choice, "regcost", true) == 0)
  141. {
  142. if(PayNSprays[id][pnsStatus] == 0)
  143. {
  144. format(string, sizeof(string), "Pay N' Spray #%d does not exist.", id);
  145. SendClientMessageEx(playerid, COLOR_WHITE, string);
  146. return 1;
  147. }
  148. PayNSprays[id][pnsRegCost] = amount;
  149. format(string, sizeof(string), "You have changed the regular cost for Pay N' Spray #%d to $%s.", id, number_format(amount));
  150. SendClientMessageEx(playerid, COLOR_WHITE, string);
  151. DestroyDynamic3DTextLabel(PayNSprays[id][pnsTextID]);
  152. format(string, sizeof(string), "/repaircar\nRepair Cost -- Regular: $%s | Faction: $%s\nID: %d", number_format(PayNSprays[id][pnsRegCost]), number_format(PayNSprays[id][pnsGroupCost]), id);
  153. PayNSprays[id][pnsTextID] = CreateDynamic3DTextLabel(string, COLOR_RED, PayNSprays[id][pnsPosX], PayNSprays[id][pnsPosY], PayNSprays[id][pnsPosZ]+0.5,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, PayNSprays[id][pnsVW], PayNSprays[id][pnsInt], -1);
  154. SavePayNSpray(id);
  155. format(string, sizeof(string), "%s has changed the regular cost on Pay N' Spray ID %d to $%s.", GetPlayerNameEx(playerid), id, number_format(amount));
  156. Log("logs/pnsedit.log", string);
  157. return 1;
  158. }
  159. else if(strcmp(choice, "delete", true) == 0)
  160. {
  161. if(PayNSprays[id][pnsStatus] == 0)
  162. {
  163. format(string, sizeof(string), "Pay N' Spray #%d does not exist.", id);
  164. SendClientMessageEx(playerid, COLOR_WHITE, string);
  165. return 1;
  166. }
  167. DestroyDynamicPickup(PayNSprays[id][pnsPickupID]);
  168. DestroyDynamic3DTextLabel(PayNSprays[id][pnsTextID]);
  169. DestroyDynamicMapIcon(PayNSprays[id][pnsMapIconID]);
  170. PayNSprays[id][pnsStatus] = 0;
  171. PayNSprays[id][pnsPosX] = 0.0;
  172. PayNSprays[id][pnsPosY] = 0.0;
  173. PayNSprays[id][pnsPosZ] = 0.0;
  174. PayNSprays[id][pnsVW] = 0;
  175. PayNSprays[id][pnsInt] = 0;
  176. PayNSprays[id][pnsGroupCost] = 0;
  177. PayNSprays[id][pnsRegCost] = 0;
  178. SavePayNSpray(id);
  179. format(string, sizeof(string), "You have deleted Pay N' Spray #%d.", id);
  180. SendClientMessageEx(playerid, COLOR_WHITE, string);
  181. format(string, sizeof(string), "%s has deleted Pay N' Spray ID %d.", GetPlayerNameEx(playerid), id);
  182. Log("logs/pnsedit.log", string);
  183. return 1;
  184. }
  185. return 1;
  186. }
  187. CMD:pnsstatus(playerid, params[])
  188. {
  189. new id;
  190. if(sscanf(params, "i", id))
  191. {
  192. SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /pnsstatus [id]");
  193. return 1;
  194. }
  195. if (PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  196. {
  197. new string[128];
  198. format(string,sizeof(string),"|___________ Pay N' Spray Status (ID: %d) ___________|", id);
  199. SendClientMessageEx(playerid, COLOR_GREEN, string);
  200. format(string, sizeof(string), "[Position] X: %f | Y: %f | Z: %f | VW: %d | Int: %d", PayNSprays[id][pnsPosX], PayNSprays[id][pnsPosY], PayNSprays[id][pnsPosZ], PayNSprays[id][pnsVW], PayNSprays[id][pnsInt]);
  201. SendClientMessageEx(playerid, COLOR_WHITE, string);
  202. format(string, sizeof(string), "Group Cost: $%s | Regular Cost: $%s", number_format(PayNSprays[id][pnsGroupCost]), number_format(PayNSprays[id][pnsRegCost]));
  203. SendClientMessageEx(playerid, COLOR_WHITE, string);
  204. }
  205. else
  206. {
  207. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  208. }
  209. return 1;
  210. }
  211. CMD:pnsnext(playerid, params[])
  212. {
  213. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  214. {
  215. SendClientMessageEx(playerid, COLOR_RED, "* Listing next available Pay N' Spray...");
  216. for(new x = 0; x < MAX_PAYNSPRAYS; x++)
  217. {
  218. if(PayNSprays[x][pnsStatus] == 0)
  219. {
  220. new string[128];
  221. format(string, sizeof(string), "%d is available to use.", x);
  222. SendClientMessageEx(playerid, COLOR_WHITE, string);
  223. break;
  224. }
  225. }
  226. }
  227. else
  228. {
  229. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use that command.");
  230. return 1;
  231. }
  232. return 1;
  233. }
  234. CMD:gotopaynspray(playerid, params[])
  235. {
  236. if(PlayerInfo[playerid][pAdmin] >= 4 || PlayerInfo[playerid][pASM] >= 1)
  237. {
  238. new id;
  239. if(sscanf(params, "d", id)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /gotopaynspray [id]");
  240. SetPlayerPos(playerid, PayNSprays[id][pnsPosX], PayNSprays[id][pnsPosY], PayNSprays[id][pnsPosZ]);
  241. SetPlayerInterior(playerid, PayNSprays[id][pnsInt]);
  242. PlayerInfo[playerid][pInt] = PayNSprays[id][pnsInt];
  243. SetPlayerVirtualWorld(playerid, PayNSprays[id][pnsVW]);
  244. PlayerInfo[playerid][pVW] = PayNSprays[id][pnsVW];
  245. }
  246. return 1;
  247. }
  248. CMD:repaircar(playerid, params[])
  249. {
  250. if(zombieevent) return SendClientMessageEx(playerid, -1, "You can't use Pay N' Spray's during the Zombie Event!");
  251. if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  252. {
  253. for(new i; i < MAX_PAYNSPRAYS; i++)
  254. {
  255. if(IsPlayerInRangeOfPoint(playerid, 3.0, PayNSprays[i][pnsPosX], PayNSprays[i][pnsPosY], PayNSprays[i][pnsPosZ]) && GetPlayerVirtualWorld(playerid) == PayNSprays[i][pnsVW] && GetPlayerInterior(playerid) == PayNSprays[i][pnsInt])
  256. {
  257. if(PayNSprays[i][pnsStatus] > 0)
  258. {
  259. if(DynVeh[GetPlayerVehicleID(playerid)] != -1 && DynVehicleInfo[DynVeh[GetPlayerVehicleID(playerid)]][gv_igID] != INVALID_GROUP_ID)
  260. {
  261. new iGroupID = DynVehicleInfo[DynVeh[GetPlayerVehicleID(playerid)]][gv_igID];
  262. if(arrGroupData[iGroupID][g_iBudget] >= PayNSprays[i][pnsGroupCost])
  263. {
  264. }
  265. else return SendClientMessage(playerid, COLOR_WHITE, "Your agency does not have enough money in their funds to pay for this!");
  266. }
  267. else
  268. {
  269. if(PlayerInfo[playerid][pCash] >= PayNSprays[i][pnsRegCost])
  270. {
  271. }
  272. else return SendClientMessage(playerid, COLOR_WHITE, "You don't have enough money to pay for this!");
  273. }
  274. SetTimerEx("PayNSpray", 5000, false, "iii", playerid, i, GetPlayerVehicleID(playerid));
  275. TogglePlayerControllable(playerid, 0);
  276. GameTextForPlayer(playerid, "Repairing...", 5000, 5);
  277. return 1;
  278. }
  279. }
  280. }
  281. SendClientMessage(playerid, COLOR_WHITE, "You are not at a Pay N' Spray!");
  282. }
  283. else SendClientMessage(playerid, COLOR_WHITE, "You are not in a car!");
  284. return 1;
  285. }
  286. stock SavePayNSpray(id)
  287. {
  288. new string[1024];
  289. mysql_format(MainPipeline, string, sizeof(string), "UPDATE `paynsprays` SET \
  290. `Status`=%d, \
  291. `PosX`=%f, \
  292. `PosY`=%f, \
  293. `PosZ`=%f, \
  294. `VW`=%d, \
  295. `Int`=%d, \
  296. `GroupCost`=%d, \
  297. `RegCost`=%d WHERE `id`=%d",
  298. PayNSprays[id][pnsStatus],
  299. PayNSprays[id][pnsPosX],
  300. PayNSprays[id][pnsPosY],
  301. PayNSprays[id][pnsPosZ],
  302. PayNSprays[id][pnsVW],
  303. PayNSprays[id][pnsInt],
  304. PayNSprays[id][pnsGroupCost],
  305. PayNSprays[id][pnsRegCost],
  306. id
  307. );
  308. mysql_tquery(MainPipeline, string, "OnQueryFinish", "i", SENDDATA_THREAD);
  309. }
  310. stock SavePayNSprays()
  311. {
  312. for(new i = 0; i < MAX_PAYNSPRAYS; i++)
  313. {
  314. SavePayNSpray(i);
  315. }
  316. return 1;
  317. }
  318. stock RehashPayNSpray(id)
  319. {
  320. DestroyDynamicPickup(PayNSprays[id][pnsPickupID]);
  321. DestroyDynamic3DTextLabel(PayNSprays[id][pnsTextID]);
  322. DestroyDynamicMapIcon(PayNSprays[id][pnsMapIconID]);
  323. PayNSprays[id][pnsSQLId] = -1;
  324. PayNSprays[id][pnsStatus] = 0;
  325. PayNSprays[id][pnsPosX] = 0.0;
  326. PayNSprays[id][pnsPosY] = 0.0;
  327. PayNSprays[id][pnsPosZ] = 0.0;
  328. PayNSprays[id][pnsVW] = 0;
  329. PayNSprays[id][pnsInt] = 0;
  330. PayNSprays[id][pnsGroupCost] = 0;
  331. PayNSprays[id][pnsRegCost] = 0;
  332. LoadPayNSpray(id);
  333. }
  334. stock RehashPayNSprays()
  335. {
  336. printf("[RehashPayNSprays] Deleting Pay N' Sprays from server...");
  337. for(new i = 0; i < MAX_PAYNSPRAYS; i++)
  338. {
  339. RehashPayNSpray(i);
  340. }
  341. LoadPayNSprays();
  342. }
  343. stock LoadPayNSpray(id)
  344. {
  345. new string[128];
  346. format(string, sizeof(string), "SELECT * FROM `paynsprays` WHERE `id`=%d", id);
  347. mysql_tquery(MainPipeline, string, "OnLoadPayNSpray", "i", id);
  348. }
  349. stock LoadPayNSprays()
  350. {
  351. printf("[LoadPayNSprays] Loading data from database...");
  352. mysql_tquery(MainPipeline, "SELECT * FROM `paynsprays`", "OnLoadPayNSprays", "");
  353. }
  354. forward OnLoadPayNSpray(index);
  355. public OnLoadPayNSpray(index)
  356. {
  357. new rows;
  358. szMiscArray[0] = 0;
  359. cache_get_row_count(rows);
  360. for(new row; row < rows; row++)
  361. {
  362. cache_get_value_name_int(row, "id", PayNSprays[index][pnsSQLId]);
  363. cache_get_value_name_int(row, "Status", PayNSprays[index][pnsStatus]);
  364. cache_get_value_name_float(row, "PosX", PayNSprays[index][pnsPosX]);
  365. cache_get_value_name_float(row, "PosY", PayNSprays[index][pnsPosY]);
  366. cache_get_value_name_float(row, "PosZ", PayNSprays[index][pnsPosZ]);
  367. cache_get_value_name_int(row, "VW", PayNSprays[index][pnsVW]);
  368. cache_get_value_name_int(row, "Int", PayNSprays[index][pnsInt]);
  369. cache_get_value_name_int(row, "GroupCost", PayNSprays[index][pnsGroupCost]);
  370. cache_get_value_name_int(row, "RegCost", PayNSprays[index][pnsRegCost]);
  371. if(PayNSprays[index][pnsStatus] > 0)
  372. {
  373. format(szMiscArray, sizeof(szMiscArray), "/repaircar\nRepair Cost -- Regular: $%s | Faction: $%s\nID: %d", number_format(PayNSprays[index][pnsRegCost]), number_format(PayNSprays[index][pnsGroupCost]), index);
  374. PayNSprays[index][pnsTextID] = CreateDynamic3DTextLabel(szMiscArray, COLOR_RED, PayNSprays[index][pnsPosX], PayNSprays[index][pnsPosY], PayNSprays[index][pnsPosZ]+0.5,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, PayNSprays[index][pnsVW], PayNSprays[index][pnsInt], -1);
  375. PayNSprays[index][pnsPickupID] = CreateDynamicPickup(1239, 23, PayNSprays[index][pnsPosX], PayNSprays[index][pnsPosY], PayNSprays[index][pnsPosZ], PayNSprays[index][pnsVW]);
  376. PayNSprays[index][pnsMapIconID] = CreateDynamicMapIcon(PayNSprays[index][pnsPosX], PayNSprays[index][pnsPosY], PayNSprays[index][pnsPosZ], 63, 0, PayNSprays[index][pnsVW], PayNSprays[index][pnsInt], -1, 500.0);
  377. }
  378. }
  379. return 1;
  380. }
  381. forward OnLoadPayNSprays();
  382. public OnLoadPayNSprays()
  383. {
  384. new i, rows;
  385. szMiscArray[0] = 0;
  386. cache_get_row_count(rows);
  387. while(i < rows)
  388. {
  389. /*PayNSprays[i][pnsSQLId] = cache_get_field_content_int(i, "id", MainPipeline);
  390. PayNSprays[i][pnsStatus] = cache_get_field_content_int(i, "Status", MainPipeline);
  391. PayNSprays[i][pnsPosX] = cache_get_field_content_float(i, "PosX", MainPipeline);
  392. PayNSprays[i][pnsPosY] = cache_get_field_content_float(i, "PosY", MainPipeline);
  393. PayNSprays[i][pnsPosZ] = cache_get_field_content_float(i, "PosZ", MainPipeline);
  394. PayNSprays[i][pnsVW] = cache_get_field_content_int(i, "VW", MainPipeline);
  395. PayNSprays[i][pnsInt] = cache_get_field_content_int(i, "Int", MainPipeline);
  396. PayNSprays[i][pnsGroupCost] = cache_get_field_content_int(i, "GroupCost", MainPipeline);
  397. PayNSprays[i][pnsRegCost] = cache_get_field_content_int(i, "RegCost", MainPipeline);
  398. if(PayNSprays[i][pnsStatus] > 0)
  399. {
  400. if(PayNSprays[i][pnsPosX] != 0.0)
  401. {
  402. format(szMiscArray, sizeof(szMiscArray), "/repaircar\nRepair Cost -- Regular: $%s | Faction: $%s\nID: %d", number_format(PayNSprays[i][pnsRegCost]), number_format(PayNSprays[i][pnsGroupCost]), i);
  403. PayNSprays[i][pnsTextID] = CreateDynamic3DTextLabel(szMiscArray, COLOR_RED, PayNSprays[i][pnsPosX], PayNSprays[i][pnsPosY], PayNSprays[i][pnsPosZ]+0.5,10.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, PayNSprays[i][pnsVW], PayNSprays[i][pnsInt], -1);
  404. PayNSprays[i][pnsPickupID] = CreateDynamicPickup(1239, 23, PayNSprays[i][pnsPosX], PayNSprays[i][pnsPosY], PayNSprays[i][pnsPosZ], PayNSprays[i][pnsVW]);
  405. PayNSprays[i][pnsMapIconID] = CreateDynamicMapIcon(PayNSprays[i][pnsPosX], PayNSprays[i][pnsPosY], PayNSprays[i][pnsPosZ], 63, 0, PayNSprays[i][pnsVW], PayNSprays[i][pnsInt], -1, 500.0);
  406. }
  407. }*/
  408. LoadPayNSpray(i);
  409. i++;
  410. }
  411. }