247items.pwn 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. 24/7 Items
  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. /*CMD:tie(playerid, params[])
  34. {
  35. if(PlayerInfo[playerid][pRope] > 0)
  36. {
  37. new string[128], giveplayerid;
  38. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /tie [player]");
  39. if(IsPlayerConnected(giveplayerid))
  40. {
  41. if(PlayerTied[giveplayerid] > 0)
  42. {
  43. SendClientMessageEx(playerid, COLOR_GREY, " person already Tied!");
  44. return 1;
  45. }
  46. if(PlayerCuffed[giveplayerid] != 0) return SendClientMessageEx(playerid, COLOR_GREY, "You can't tie a cuffed/tazed player.");
  47. if(PlayerInfo[giveplayerid][pJailTime] > 0)
  48. {
  49. SendClientMessageEx(playerid, COLOR_WHITE, "You can't tie a prisoned player." );
  50. return 1;
  51. }
  52. if( PlayerInfo[playerid][pRope] == 0 )
  53. {
  54. SendClientMessageEx( playerid, COLOR_WHITE, "You don't have any rope left." );
  55. }
  56. else
  57. {
  58. if (ProxDetectorS(8.0, playerid, giveplayerid))
  59. {
  60. new car = GetPlayerVehicleID(playerid);
  61. if(giveplayerid == playerid) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot tie up yourself!"); return 1; }
  62. if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == 2 && IsPlayerInVehicle(giveplayerid, car))
  63. {
  64. if(PlayerCuffed[giveplayerid] == 1 || PlayerCuffed[giveplayerid] == 2) {
  65. SendClientMessageEx(playerid, COLOR_GRAD2, "You can't do this right now.");
  66. return 1;
  67. }
  68. format(string, sizeof(string), "* You were tied up by %s.", GetPlayerNameEx(playerid));
  69. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  70. format(string, sizeof(string), "* You tied %s up.", GetPlayerNameEx(giveplayerid));
  71. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  72. switch( PlayerInfo[giveplayerid][pSex] ) {
  73. case 1: format(string, sizeof(string), "* %s ties %s up, so he won't go anywhere.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  74. case 2: format(string, sizeof(string), "* %s ties %s up, so she won't go anywhere.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  75. }
  76. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  77. GameTextForPlayer(giveplayerid, "~r~Tied", 2500, 3);
  78. SetPVarInt(giveplayerid, "IsFrozen", 1);
  79. TogglePlayerControllable(giveplayerid, 0);
  80. PlayerTied[giveplayerid] = 1;
  81. PlayerInfo[playerid][pRope]--;
  82. }
  83. else
  84. {
  85. SendClientMessageEx(playerid, COLOR_GREY, " person not in your Car, or you are not the Driver!");
  86. return 1;
  87. }
  88. }
  89. else
  90. {
  91. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  92. return 1;
  93. }
  94. }
  95. }
  96. else
  97. {
  98. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  99. return 1;
  100. }
  101. }
  102. else
  103. {
  104. SendClientMessageEx(playerid, COLOR_GREY, " You don't have a Rope!");
  105. }
  106. return 1;
  107. }
  108. CMD:untie(playerid, params[])
  109. {
  110. new string[128], giveplayerid;
  111. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /untie [player]");
  112. if(IsPlayerConnected(giveplayerid))
  113. {
  114. if (ProxDetectorS(8.0, playerid, giveplayerid))
  115. {
  116. if(giveplayerid == playerid) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot Untie yourself!"); return 1; }
  117. if(PlayerCuffed[giveplayerid] != 0) return SendClientMessageEx(playerid, COLOR_GREY, "You can't untie a cuffed/tazed player.");
  118. if(PlayerTied[giveplayerid])
  119. {
  120. DeletePVar(giveplayerid, "IsFrozen");
  121. format(string, sizeof(string), "* You were untied by %s.", GetPlayerNameEx(playerid));
  122. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  123. format(string, sizeof(string), "* You untied %s.", GetPlayerNameEx(giveplayerid));
  124. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  125. GameTextForPlayer(giveplayerid, "~g~Untied", 2500, 3);
  126. TogglePlayerControllable(giveplayerid, 1);
  127. PlayerTied[giveplayerid] = 0;
  128. }
  129. else
  130. {
  131. SendClientMessageEx(playerid, COLOR_GREY, " That person isn't Tied up!");
  132. return 1;
  133. }
  134. }
  135. else
  136. {
  137. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  138. return 1;
  139. }
  140. }
  141. else
  142. {
  143. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  144. return 1;
  145. }
  146. return 1;
  147. }*/
  148. CMD:tie(playerid, params[])
  149. {
  150. if(PlayerInfo[playerid][pRope] > 0)
  151. {
  152. new id;
  153. if(sscanf(params, "u", id)) return SendClientMessageEx(playerid, COLOR_WHITE, "SYNTAX: /tie [playerid]");
  154. if(IsPlayerConnected(id))
  155. {
  156. if(PlayerTied[id] > 0) return SendClientMessageEx(playerid, -1, "That player is already tied.");
  157. if(GetPVarInt(playerid, "Injured") || PlayerCuffed[playerid] > 0 || GetPVarInt(playerid, "IsInArena") || GetPVarInt(playerid, "EventToken") != 0 || PlayerInfo[playerid][pHospital] > 0) return SendClientMessageEx(playerid, -1, "You cannot do this right now!");
  158. if(PlayerCuffed[id] != 0) return SendClientMessageEx(playerid, -1, "You cannot do this to them right now.");
  159. if(ProxDetectorS(8.0, playerid, id))
  160. {
  161. szMiscArray[0] = 0;
  162. if(id == playerid) return SendClientMessageEx(playerid, -1, "You cannot tie yourself!");
  163. if(GetPVarInt(id, "Injured") == 1) return SendClientMessageEx(playerid, COLOR_GREY, "You cannot tie someone in a injured state.");
  164. if(GetPlayerSpecialAction(id) != SPECIAL_ACTION_HANDSUP) return SendClientMessage(playerid, -1, "This player is not restrained.");
  165. format(szMiscArray, sizeof(szMiscArray), "* %s has used some rope to tie %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(id));
  166. ProxDetector(30.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  167. ClearAnimationsEx(id);
  168. SetPlayerSpecialAction(id,SPECIAL_ACTION_NONE);
  169. SetPlayerSpecialAction(id,SPECIAL_ACTION_CUFFED);
  170. PlayerTied[id] = 1;
  171. PlayerInfo[playerid][pRope]--;
  172. }
  173. else return SendClientMessageEx(playerid, -1, "That person isn't near you.");
  174. }
  175. else return SendClientMessageEx(playerid, -1, "That player is not connected.");
  176. }
  177. else SendClientMessageEx(playerid, -1, "You do not have any rope!");
  178. return 1;
  179. }
  180. CMD:untie(playerid, params[])
  181. {
  182. new id;
  183. if(sscanf(params, "u", id)) return SendClientMessageEx(playerid, COLOR_WHITE, "SYNTAX: /untie [playerid]");
  184. if(IsPlayerConnected(id))
  185. {
  186. if(PlayerTied[id] == 0) return SendClientMessageEx(playerid, -1, "That player isn't tied.");
  187. if(GetPVarInt(playerid, "Injured") || PlayerCuffed[playerid] > 0 || GetPVarInt(playerid, "IsInArena") || GetPVarInt(playerid, "EventToken") != 0 || PlayerInfo[playerid][pHospital] > 0) return SendClientMessageEx(playerid, -1, "You cannot do this right now!");
  188. if(ProxDetectorS(8.0, playerid, id))
  189. {
  190. szMiscArray[0] = 0;
  191. if(id == playerid) return SendClientMessageEx(playerid, -1, "You cannot untie yourself!");
  192. format(szMiscArray, sizeof(szMiscArray), "* %s has untied %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(id));
  193. ProxDetector(30.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  194. SetPlayerSpecialAction(id,SPECIAL_ACTION_NONE);
  195. PlayerTied[id] = 0;
  196. }
  197. else return SendClientMessageEx(playerid, -1, "That person isn't near you.");
  198. }
  199. else SendClientMessageEx(playerid, -1, "That player is not connected.");
  200. return 1;
  201. }
  202. CMD:blindfold(playerid, params[])
  203. {
  204. if(PlayerInfo[playerid][pRags] > 0)
  205. {
  206. new id;
  207. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "SYNTAX: /blindfold [playerid]");
  208. if(IsPlayerConnected(id))
  209. {
  210. if(PlayerTied[id] == 0) return SendClientMessageEx(playerid, -1, "The person you are trying to blindfold must be tied.");
  211. if(GetPVarInt(playerid, "Injured") || PlayerCuffed[playerid] > 0 || GetPVarInt(playerid, "IsInArena") || GetPVarInt(playerid, "EventToken") != 0 || PlayerInfo[playerid][pHospital] > 0) return SendClientMessageEx(playerid, -1, "You cannot do this right now!");
  212. if(ProxDetectorS(8.0, playerid, id))
  213. {
  214. switch(GetPVarInt(id, "Blindfolded"))
  215. {
  216. case 0:
  217. {
  218. szMiscArray[0] = 0;
  219. if(id == playerid) return SendClientMessageEx(playerid, -1, "You cannot blindfold yourself!");
  220. format(szMiscArray, sizeof(szMiscArray), "* %s has placed a rag around %s's head, blinding them.", GetPlayerNameEx(playerid), GetPlayerNameEx(id));
  221. ProxDetector(30.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  222. TextDrawShowForPlayer(id, BFText);
  223. SetPVarInt(id, "Blindfolded", 1);
  224. PlayerInfo[playerid][pRags]--;
  225. }
  226. default:
  227. {
  228. szMiscArray[0] = 0;
  229. if(id == playerid) return SendClientMessageEx(playerid, -1, "You cannot unblindfold yourself!");
  230. format(szMiscArray, sizeof(szMiscArray), "* %s has removed the rag around %s's head.", GetPlayerNameEx(playerid), GetPlayerNameEx(id));
  231. ProxDetector(30.0, playerid, szMiscArray, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  232. TextDrawHideForPlayer(id, BFText);
  233. DeletePVar(id, "Blindfolded");
  234. }
  235. }
  236. }
  237. else return SendClientMessageEx(playerid, -1, "That person isn't near you.");
  238. }
  239. else return SendClientMessageEx(playerid, -1, "That player is not connected.");
  240. }
  241. else SendClientMessage(playerid, COLOR_WHITE, "You do not have any rags!");
  242. return 1;
  243. }
  244. CMD:usesprunk(playerid, params[])
  245. {
  246. if(GetPVarType(playerid, "IsInArena")) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this while being in an arena!");
  247. if(HungerPlayerInfo[playerid][hgInEvent] != 0) return SendClientMessageEx(playerid, COLOR_GREY, " You cannot do this while being in the Hunger Games Event!");
  248. #if defined zombiemode
  249. if(zombieevent == 1 && GetPVarType(playerid, "pIsZombie")) return SendClientMessageEx(playerid, COLOR_GREY, "Zombies can't use this.");
  250. #endif
  251. if(PlayerInfo[playerid][pSprunk] > 0)
  252. {
  253. if(GetPVarInt(playerid, "UsingSprunk") == 1) return SendClientMessageEx(playerid, COLOR_GRAD1, "You're already drinking a sprunk can.");
  254. if( PlayerCuffed[playerid] >= 1 || GetPVarInt(playerid, "Injured") == 1 || PlayerInfo[playerid][pHospital] > 0)
  255. {
  256. SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now.");
  257. return 1;
  258. }
  259. if(IsPlayerInAnyVehicle(playerid))
  260. {
  261. if(IsABike(GetPlayerVehicleID(playerid)))
  262. {
  263. SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this on a bike.");
  264. return 1;
  265. }
  266. }
  267. new string[128];
  268. SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_SPRUNK);
  269. format(string, sizeof(string), "* %s opens a can of sprunk.", GetPlayerNameEx(playerid));
  270. ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  271. SetPVarInt(playerid, "UsingSprunk", 1);
  272. SetPVarInt(playerid, "DrinkCooledDown", 1);
  273. PlayerInfo[playerid][pSprunk]--;
  274. return 1;
  275. }
  276. else
  277. {
  278. SendClientMessageEx(playerid, COLOR_GREY, "You don't have any sprunk, buy some from the 24/7!");
  279. return 1;
  280. }
  281. }
  282. CMD:usecigar(playerid, params[])
  283. {
  284. if(PlayerInfo[playerid][pCigar] > 0)
  285. {
  286. if( PlayerCuffed[playerid] >= 1 || GetPVarInt(playerid, "Injured") == 1 || PlayerInfo[playerid][pHospital] > 0)
  287. {
  288. SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now.");
  289. return 1;
  290. }
  291. new string[128];
  292. SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
  293. format(string, sizeof(string), "* %s takes out a cigar and lights it.", GetPlayerNameEx(playerid));
  294. ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  295. PlayerInfo[playerid][pCigar]--;
  296. return 1;
  297. }
  298. else
  299. {
  300. SendClientMessageEx(playerid, COLOR_GREY, "You don't have any cigars, buy some from the 24/7!");
  301. return 1;
  302. }
  303. }
  304. CMD:paintcar(playerid, params[]) {
  305. new iPaintID;
  306. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessageEx(playerid, COLOR_GRAD2, "You're not in a vehicle.");
  307. if(PlayerInfo[playerid][pSpraycan] == 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "Your spraycan is empty.");
  308. if(sscanf(params, "i", iPaintID)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /paintcar [0-6] (3 to remove a paintjob)");
  309. if(!(0 <= iPaintID <= 6)) return SendClientMessageEx(playerid, COLOR_GRAD2, "The specified paint job ID must be between 0 and 6.");
  310. for(new i = 0; i < MAX_PLAYERVEHICLES; i++)
  311. {
  312. if(IsPlayerInVehicle(playerid, PlayerVehicleInfo[playerid][i][pvId]))
  313. {
  314. PlayerVehicleInfo[playerid][i][pvPaintJob] = iPaintID;
  315. ChangeVehiclePaintjob(PlayerVehicleInfo[playerid][i][pvId], iPaintID);
  316. PlayerInfo[playerid][pSpraycan]--;
  317. g_mysql_SaveVehicle(playerid, i);
  318. return SendClientMessageEx(playerid, COLOR_GRAD2, "You have successfully applied a paint job to your vehicle.");
  319. }
  320. }
  321. for(new i = 0; i < sizeof(VIPVehicles); i++)
  322. {
  323. if(IsPlayerInVehicle(playerid, VIPVehicles[i]))
  324. {
  325. ChangeVehiclePaintjob(VIPVehicles[i], iPaintID);
  326. PlayerInfo[playerid][pSpraycan]--;
  327. return SendClientMessageEx(playerid, COLOR_GRAD2, "You have successfully applied a paint job to this vehicle.");
  328. }
  329. }
  330. for(new i = 0; i < sizeof(FamedVehicles); i++)
  331. {
  332. if(IsPlayerInVehicle(playerid, FamedVehicles[i]))
  333. {
  334. ChangeVehiclePaintjob(FamedVehicles[i], iPaintID);
  335. PlayerInfo[playerid][pSpraycan]--;
  336. return SendClientMessageEx(playerid, COLOR_GRAD2, "You have successfully applied a paint job to this vehicle.");
  337. }
  338. }
  339. SendClientMessageEx(playerid, COLOR_GREY, "You can't spray other people's vehicles.");
  340. return 1;
  341. }
  342. /*CMD:buylock(playerid, params[])
  343. {
  344. if(IsAt247(playerid))
  345. {
  346. ShowPlayerDialogEx(playerid, DIALOG_CDLOCKBUY, DIALOG_STYLE_LIST, "24/7", "Alarm Lock $10000\nElectric Lock $500000\nIndustrial Lock $50000", "Buy", "Cancel");
  347. return 1;
  348. }
  349. else
  350. {
  351. SendClientMessageEx(playerid, COLOR_GRAD2, " You are not in a 24-7 !");
  352. }
  353. return 1;
  354. }*/