VLP.pwn 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. VLP 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. UpdateVLPTextDraws(playerid, vehicleid, TYPE = 0) {
  34. new tdMessage[9 + MAX_ZONE_NAME], tdCarLocation[MAX_ZONE_NAME], Float:CarPos[3];
  35. GetVehiclePos(vehicleid, CarPos[0], CarPos[1], CarPos[2]);
  36. Get3DZone(CarPos[0], CarPos[1], CarPos[2], tdCarLocation, sizeof(tdCarLocation));
  37. format(tdMessage, sizeof(tdMessage), "%s Robbery", tdCarLocation);
  38. PlayerTextDrawSetString(playerid, VLPTextDraws[playerid][0], tdMessage);
  39. switch(TYPE) {
  40. case 0: {
  41. PlayerTextDrawSetString(playerid, VLPTextDraws[playerid][0], "Attempting to lock pick vehicle");
  42. format(tdMessage, sizeof(tdMessage), "%s", ConvertTimeS(GetPVarInt(playerid, "LockPickCountdown"), 1));
  43. PlayerTextDrawSetString(playerid, VLPTextDraws[playerid][3], tdMessage);
  44. }
  45. case 1: {
  46. PlayerTextDrawSetString(playerid, VLPTextDraws[playerid][0], "Attempting to crack the trunk");
  47. format(tdMessage, sizeof(tdMessage), "%s", ConvertTimeS(GetPVarInt(playerid, "CrackTrunkCountdown"), 1));
  48. PlayerTextDrawSetString(playerid, VLPTextDraws[playerid][3], tdMessage);
  49. }
  50. case 2: {
  51. PlayerTextDrawSetString(playerid, VLPTextDraws[playerid][0], "Deliver Vehicle");
  52. format(tdMessage, sizeof(tdMessage), "00:%d", GetPVarInt(playerid, "DeliveringVehicleTime"));
  53. PlayerTextDrawSetString(playerid, VLPTextDraws[playerid][3], tdMessage);
  54. }
  55. }
  56. }
  57. DestroyVLPTextDraws(playerid) {
  58. for(new i = 0; i < 4; i++)
  59. PlayerTextDrawDestroy(playerid, VLPTextDraws[playerid][i]);
  60. }
  61. //Vehicle Lock Pick Textdraws
  62. /*CreateVLPTextDraws(playerid)
  63. {
  64. VLPTextDraws[playerid][0] = CreatePlayerTextDraw(playerid, 638.264770, 390.386749, "Attempting to lock pick vehicle");
  65. PlayerTextDrawLetterSize(playerid, VLPTextDraws[playerid][0], 0.449999, 1.600000);
  66. PlayerTextDrawTextSize(playerid, VLPTextDraws[playerid][0], 342.399902, -321.813293);
  67. PlayerTextDrawAlignment(playerid, VLPTextDraws[playerid][0], 3);
  68. PlayerTextDrawColor(playerid, VLPTextDraws[playerid][0], 41215);
  69. PlayerTextDrawUseBox(playerid, VLPTextDraws[playerid][0], true);
  70. PlayerTextDrawBoxColor(playerid, VLPTextDraws[playerid][0], 77);
  71. PlayerTextDrawSetShadow(playerid, VLPTextDraws[playerid][0], 0);
  72. PlayerTextDrawSetOutline(playerid, VLPTextDraws[playerid][0], 1);
  73. PlayerTextDrawBackgroundColor(playerid, VLPTextDraws[playerid][0], 154);
  74. PlayerTextDrawFont(playerid, VLPTextDraws[playerid][0], 3);
  75. PlayerTextDrawSetProportional(playerid, VLPTextDraws[playerid][0], 1);
  76. VLPTextDraws[playerid][1] = CreatePlayerTextDraw(playerid, 638.464538, 411.413299, "Location");
  77. PlayerTextDrawLetterSize(playerid, VLPTextDraws[playerid][1], 0.449999, 1.600000);
  78. PlayerTextDrawTextSize(playerid, VLPTextDraws[playerid][1], -585.599975, 212.053375);
  79. PlayerTextDrawAlignment(playerid, VLPTextDraws[playerid][1], 3);
  80. PlayerTextDrawColor(playerid, VLPTextDraws[playerid][1], -1805713409);
  81. PlayerTextDrawUseBox(playerid, VLPTextDraws[playerid][1], true);
  82. PlayerTextDrawBoxColor(playerid, VLPTextDraws[playerid][1], 77);
  83. PlayerTextDrawSetShadow(playerid, VLPTextDraws[playerid][1], 0);
  84. PlayerTextDrawSetOutline(playerid, VLPTextDraws[playerid][1], 1);
  85. PlayerTextDrawBackgroundColor(playerid, VLPTextDraws[playerid][1], 255);
  86. PlayerTextDrawFont(playerid, VLPTextDraws[playerid][1], 3);
  87. PlayerTextDrawSetProportional(playerid, VLPTextDraws[playerid][1], 1);
  88. VLPTextDraws[playerid][2] = CreatePlayerTextDraw(playerid, 572.635070, 432.238861, "Please wait:");
  89. PlayerTextDrawLetterSize(playerid, VLPTextDraws[playerid][2], 0.449999, 1.600000);
  90. PlayerTextDrawTextSize(playerid, VLPTextDraws[playerid][2], -585.599975, 212.053375);
  91. PlayerTextDrawAlignment(playerid, VLPTextDraws[playerid][2], 3);
  92. PlayerTextDrawColor(playerid, VLPTextDraws[playerid][2], -1);
  93. PlayerTextDrawUseBox(playerid, VLPTextDraws[playerid][2], true);
  94. PlayerTextDrawBoxColor(playerid, VLPTextDraws[playerid][2], 77);
  95. PlayerTextDrawSetShadow(playerid, VLPTextDraws[playerid][2], 0);
  96. PlayerTextDrawSetOutline(playerid, VLPTextDraws[playerid][2], -1);
  97. PlayerTextDrawBackgroundColor(playerid, VLPTextDraws[playerid][2], 255);
  98. PlayerTextDrawFont(playerid, VLPTextDraws[playerid][2], 3);
  99. PlayerTextDrawSetProportional(playerid, VLPTextDraws[playerid][2], 1);
  100. VLPTextDraws[playerid][3] = CreatePlayerTextDraw(playerid, 607.519653, 432.095947, "00:12");
  101. PlayerTextDrawLetterSize(playerid, VLPTextDraws[playerid][3], 0.449999, 1.600000);
  102. PlayerTextDrawTextSize(playerid, VLPTextDraws[playerid][3], 172.000000, -70.933380);
  103. PlayerTextDrawAlignment(playerid, VLPTextDraws[playerid][3], 2);
  104. PlayerTextDrawColor(playerid, VLPTextDraws[playerid][3], 104202495);
  105. PlayerTextDrawUseBox(playerid, VLPTextDraws[playerid][3], true);
  106. PlayerTextDrawBoxColor(playerid, VLPTextDraws[playerid][3], 77);
  107. PlayerTextDrawSetShadow(playerid, VLPTextDraws[playerid][3], 0);
  108. PlayerTextDrawSetOutline(playerid, VLPTextDraws[playerid][3], 1);
  109. PlayerTextDrawBackgroundColor(playerid, VLPTextDraws[playerid][3], 51);
  110. PlayerTextDrawFont(playerid, VLPTextDraws[playerid][3], 1);
  111. PlayerTextDrawSetProportional(playerid, VLPTextDraws[playerid][3], 1);
  112. }*/
  113. /*ShowVLPTextDraws(playerid, vehicleid, TYPE = 0) {
  114. CreateVLPTextDraws(playerid);
  115. new tdMessage[9 + MAX_ZONE_NAME], tdCarLocation[MAX_ZONE_NAME], Float:CarPos[3];
  116. GetVehiclePos(vehicleid, CarPos[0], CarPos[1], CarPos[2]);
  117. Get3DZone(CarPos[0], CarPos[1], CarPos[2], tdCarLocation, sizeof(tdCarLocation));
  118. format(tdMessage, sizeof(tdMessage), "%s", tdCarLocation);
  119. PlayerTextDrawSetString(playerid, VLPTextDraws[playerid][1], tdMessage);
  120. switch(TYPE) {
  121. case 0: {
  122. PlayerTextDrawSetString(playerid, VLPTextDraws[playerid][0], "Attempting to lock pick vehicle");
  123. format(tdMessage, sizeof(tdMessage), "%s", ConvertTimeS(GetPVarInt(playerid, "LockPickCountdown"), 1));
  124. PlayerTextDrawSetString(playerid, VLPTextDraws[playerid][3], tdMessage);
  125. }
  126. case 1: {
  127. PlayerTextDrawSetString(playerid, VLPTextDraws[playerid][0], "Attempting to crack the trunk");
  128. format(tdMessage, sizeof(tdMessage), "%s", ConvertTimeS(GetPVarInt(playerid, "CrackTrunkCountdown"), 1));
  129. PlayerTextDrawSetString(playerid, VLPTextDraws[playerid][3], tdMessage);
  130. }
  131. case 2: {
  132. PlayerTextDrawSetString(playerid, VLPTextDraws[playerid][0], "Deliver Vehicle");
  133. format(tdMessage, sizeof(tdMessage), "00:%d", GetPVarInt(playerid, "DeliveringVehicleTime"));
  134. PlayerTextDrawSetString(playerid, VLPTextDraws[playerid][3], tdMessage);
  135. }
  136. }
  137. for(new i = 0; i < 4; i++)
  138. PlayerTextDrawShow(playerid, VLPTextDraws[playerid][i]);
  139. }*/
  140. CMD:pickvehicle(playerid, params[])
  141. {
  142. return cmd_pickveh(playerid, params);
  143. }
  144. CMD:pickveh(playerid, params[])
  145. {
  146. /*
  147. new szMessage[150], Float: vehSize[3], Float: Pos[3], Float:a, success;
  148. if(gettime() < PlayerInfo[playerid][pLockPickTime]) {
  149. format(szMessage, sizeof(szMessage), "You must wait %s in order to attempt another lock pick.", ConvertTimeS(PlayerInfo[playerid][pLockPickTime] - gettime()));
  150. return SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
  151. }
  152. if(GetPVarType(playerid, "AttemptingLockPick")) return SendClientMessageEx(playerid, COLOR_WHITE, "You are already attempting a lockpick, please wait.");
  153. if(GetPVarType(playerid, "DeliveringVehicleTime")) return SendClientMessageEx(playerid, COLOR_WHITE, "Deliver the vehicle you lock picked first or wait some time.");
  154. if(!PlayerInfo[playerid][pToolBox]) return SendClientMessageEx(playerid, COLOR_WHITE, "You need a Tool Box in order to lock pick a vehicle, get one from a Craftsman.");
  155. if(!PlayerInfo[playerid][pScrewdriver]) return SendClientMessageEx(playerid, COLOR_WHITE, "You need a Screwdriver in order to lock pick a vehicle, get one from a Craftsman.");
  156. if(GetPVarType(playerid, "PlayerCuffed") || GetPVarInt(playerid, "pBagged") >= 1 || GetPVarType(playerid, "Injured") || GetPVarType(playerid, "IsFrozen") || GetPVarType(playerid, "IsInArena") || GetPVarInt( playerid, "EventToken") || IsPlayerInAnyVehicle(playerid) || HungerPlayerInfo[playerid][hgInEvent])
  157. return SendClientMessage(playerid, COLOR_GRAD2, "You can't do that at this time!");
  158. new vehicleid = GetClosestCar(playerid);
  159. if(IsAPlane(vehicleid) || IsWeaponizedVehicle(GetVehicleModel(vehicleid)) || IsABike(vehicleid))
  160. return SendClientMessageEx(playerid,COLOR_GREY,"(( You can't pick lock this vehicle. ))");
  161. for(new d = 0 ; d < MAX_PLAYERVEHICLES; d++)
  162. if(PlayerVehicleInfo[playerid][d][pvId] == vehicleid) return SendClientMessageEx(playerid,COLOR_GREY,"You cannot lock pick any vehicle that you own.");
  163. for(new i = 1; i < sizeof(ParkingMeterInformation); i++)
  164. if(ParkingMeterInformation[i][AssignedVehicle] == vehicleid) return SendClientMessageEx(playerid,COLOR_GREY,"You cannot lock pick any vehicle that is attached to a parking meter.");
  165. GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_SIZE, vehSize[0], vehSize[1], vehSize[2]);
  166. GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_FRONTSEAT, Pos[0], Pos[1], Pos[2]);
  167. GetVehicleRelativePos(vehicleid, Pos[0], Pos[1], Pos[2], Pos[0]+((vehSize[0] / 2)-(vehSize[0])), Pos[1], 0.0);
  168. if(IsPlayerInRangeOfPoint(playerid, 1.0, Pos[0], Pos[1], Pos[2])) {
  169. foreach(new i: Player)
  170. {
  171. new v = GetPlayerVehicle(i, vehicleid);
  172. if(v != -1) {
  173. if(PlayerVehicleInfo[i][v][pvLock] == 0 || PlayerVehicleInfo[i][v][pvLocksLeft] <= 0)
  174. return SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: You can't pick lock vehicles that don't have a lock.");
  175. if(IsABike(PlayerVehicleInfo[i][v][pvModelId])) return SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: You can't pick lock bikes.");
  176. if(PlayerVehicleInfo[i][v][pvBeingPickLocked] > 0)
  177. return SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: This vehicle is already being lock picked.");
  178. if(PlayerVehicleInfo[i][v][pvAllowedPlayerId] == playerid)
  179. return SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: You can't pick lock vehicles that you have the keys of them.");
  180. new status, waittime, vipperk, randskill = random(100);
  181. switch(PlayerInfo[playerid][pDonateRank]) {
  182. case 1: vipperk = 5;
  183. case 2: vipperk = 10;
  184. case 3, 4, 5: vipperk = 15;
  185. }
  186. switch(PlayerInfo[playerid][pCarLockPickSkill]) {
  187. case 0 .. 49: if(0 <= randskill < (25+vipperk)) waittime = 180, status = 1; //Success
  188. case 50 .. 124: if(0 <= randskill < (35+vipperk)) waittime = 170, status = 1; //Success
  189. case 125 .. 224: if(0 <= randskill < (45+vipperk)) waittime = 160, status = 1; //Success
  190. case 225 .. 349: if(0 <= randskill < (55+vipperk)) waittime = 150, status = 1; //Success
  191. default: if(0 <= randskill < (65+vipperk)) waittime = 130, status = 1; //Success
  192. }
  193. format(szMessage, sizeof(szMessage), "* %s attempts to pick lock a nearby vehicle.", GetPlayerNameEx(playerid));
  194. ProxDetector(30.0, playerid, szMessage, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  195. PlayerInfo[playerid][pLockPickTime] = gettime() + 10;
  196. if(status) {
  197. SetPVarInt(playerid, "AttemptingLockPick", 1);
  198. SetPVarInt(playerid, "LockPickCountdown", waittime);
  199. SetPVarInt(playerid, "LockPickTotalTime", waittime);
  200. SetPVarInt(playerid, "LockPickVehicle", vehicleid);
  201. SetPVarInt(playerid, "LockPickPlayer", i);
  202. DeletePVar(playerid, "TrunkAlreadyCracked");
  203. PlayerVehicleInfo[i][v][pvBeingPickLocked] = 1;
  204. PlayerVehicleInfo[i][v][pvBeingPickLockedBy] = playerid;
  205. SendClientMessageEx(playerid, COLOR_PURPLE, "(( You've successfully managed to start pick locking this vehicle, you are now attempting to break into it. /stoplockpick ))");
  206. SendClientMessageEx(playerid, COLOR_YELLOW, "Warning{FFFFFF}: Please stay still, if you move or get shot you may fail lock picking the vehicle.");
  207. ShowVLPTextDraws(playerid, vehicleid);
  208. GetVehicleZAngle(vehicleid, a);
  209. SetPlayerFacingAngle(playerid, a-90);
  210. ApplyAnimation(playerid, "COP_AMBIENT", "Copbrowse_loop", 4.1, 1, 0, 0, 0, 0, 1);
  211. new ip[MAX_PLAYER_NAME], ip2[MAX_PLAYER_NAME];
  212. GetPlayerIp(playerid, ip, sizeof(ip));
  213. GetPlayerIp(i, ip2, sizeof(ip2));
  214. format(szMessage, sizeof(szMessage), "[LOCK PICK] %s(%d) (IP:%s) is attempting to lock pick a %s(VID:%d Slot %d) owned by %s(IP:%s)", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ip, GetVehicleName(PlayerVehicleInfo[i][v][pvId]), PlayerVehicleInfo[playerid][v][pvId], v, GetPlayerNameEx(i), ip2);
  215. Log("logs/playervehicle.log", szMessage);
  216. }
  217. else {
  218. SendClientMessageEx(playerid, COLOR_PURPLE, "(( Your attempt to lock pick this vehicle failed! Try again or move on. ))");
  219. }
  220. success = 1;
  221. break;
  222. }
  223. }
  224. if(!success) {
  225. return SendClientMessageEx(playerid, COLOR_WHITE, "This vehicle is not available to be pick locked.");
  226. }
  227. }
  228. else {
  229. return SendClientMessageEx(playerid, COLOR_WHITE, "You need to be next to the drivers door in order to lock pick it.");
  230. }
  231. */
  232. SendClientMessageEx(playerid, COLOR_WHITE, "This command has been disabled temporaly disabled due to an unknown issue.");
  233. SendClientMessageEx(playerid, COLOR_WHITE, "Please do not report about this being disabled, we are testing something.");
  234. return 1;
  235. }
  236. CMD:cracktrunk(playerid, params[])
  237. {
  238. /*
  239. if(PlayerInfo[playerid][pWRestricted] || PlayerInfo[playerid][pConnectHours] < 2) return SendClientMessageEx(playerid, COLOR_GRAD1, "You cannot use this command while having a weapon restriction.");
  240. new szMessage[150], Float: x, Float: y, Float: z;
  241. if(gettime() < PlayerInfo[playerid][pLockPickTime]) {
  242. format(szMessage, sizeof(szMessage), "You must wait %s in order to attempt another crack trunk.", ConvertTimeS(PlayerInfo[playerid][pLockPickTime] - gettime()));
  243. return SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
  244. }
  245. if(!PlayerInfo[playerid][pToolBox]) return SendClientMessageEx(playerid, COLOR_WHITE, "You need a Tool Box in order to lock pick a vehicle, get one from a Craftsman.");
  246. if(!PlayerInfo[playerid][pCrowBar]) return SendClientMessageEx(playerid, COLOR_WHITE, "You need a Crow Bar in order to crack this trunk, get one from a Craftsman.");
  247. if(!PlayerInfo[playerid][pScrewdriver]) return SendClientMessageEx(playerid, COLOR_WHITE, "You need a Screwdriver in order to lock pick a vehicle, get one from a Craftsman.");
  248. if(GetPVarType(playerid, "TrunkAlreadyCracked")) return SendClientMessageEx(playerid, COLOR_WHITE, "You already cracked the trunk of this vehicle.");
  249. if(GetPVarType(playerid, "PlayerCuffed") || GetPVarInt(playerid, "pBagged") >= 1 || GetPVarType(playerid, "Injured") || GetPVarType(playerid, "IsFrozen") || GetPVarType(playerid, "IsInArena") || GetPVarInt( playerid, "EventToken") || IsPlayerInAnyVehicle(playerid) || HungerPlayerInfo[playerid][hgInEvent])
  250. return SendClientMessage(playerid, COLOR_GRAD2, "You can't do that at this time!");
  251. new vehicleid = GetClosestCar(playerid);
  252. GetPosBehindVehicle(vehicleid, x, y, z, 1.0);
  253. if(IsPlayerInRangeOfPoint(playerid, 1.0, x, y, z) && GetPVarInt(playerid, "LockPickVehicle") == vehicleid) {
  254. if(GetPVarType(playerid, "AttemptingCrackTrunk")) return SendClientMessageEx(playerid, COLOR_WHITE, "You are already attempting to crack a trunk, please wait for the trunk to be opened.");
  255. if(!GetPVarType(playerid, "DeliveringVehicleTime")) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't open this trunk yet.");
  256. new status, randskill = random(100);
  257. switch(PlayerInfo[playerid][pCarLockPickSkill]) {
  258. case 0 .. 49: if(0 <= randskill < 25) status = 1; //Success
  259. case 50 .. 124: if(0 <= randskill < 35) status = 1; //Success
  260. case 125 .. 224: if(0 <= randskill < 45)status = 1; //Success
  261. case 225 .. 349: if(0 <= randskill < 55) status = 1; //Success
  262. default: if(0 <= randskill < 65) status = 1; //Success
  263. }
  264. format(szMessage, sizeof(szMessage), "* %s is attempting to crack the vehicle's trunk with his crowbar.", GetPlayerNameEx(playerid));
  265. ProxDetector(30.0, playerid, szMessage, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  266. PlayerInfo[playerid][pLockPickTime] = gettime() + 10;
  267. if(status) {
  268. SetPVarInt(playerid, "AttemptingCrackTrunk", 1);
  269. SetPVarInt(playerid, "CrackTrunkCountdown", 60);
  270. SendClientMessageEx(playerid, COLOR_PURPLE, "(( You're now cracking this vehicle's trunk with your crowbar, please wait. /stopcracking ))");
  271. SendClientMessageEx(playerid, COLOR_YELLOW, "Warning{FFFFFF}: Please stay still, if you move or get shot you may fail cracking this vehicle trunk.");
  272. ShowVLPTextDraws(playerid, vehicleid, 1);
  273. GetVehicleZAngle(vehicleid, z);
  274. SetPlayerFacingAngle(playerid, z);
  275. ApplyAnimation(playerid, "COP_AMBIENT", "Copbrowse_loop", 4.1, 1, 0, 0, 0, 0, 1);
  276. if(GetPVarType(playerid, "LockPickVehicleSQLId")) {
  277. new ip[MAX_PLAYER_NAME];
  278. GetPlayerIp(playerid, ip, sizeof(ip));
  279. format(szMessage, sizeof(szMessage), "[LOCK PICK] %s(%d) (IP:%s) is attempting to crack trunk a %s(VID:%d SQLId: %d) owned by %s(Offline SQLId: %d)", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ip, GetVehicleName(GetPVarInt(playerid, "LockPickVehicle")), GetPVarInt(playerid, "LockPickVehicle"), GetPVarInt(playerid, "LockPickVehicleSQLId"), GetPlayerNameEx(GetPVarInt(playerid, "LockPickPlayer")), GetPVarInt(playerid, "LockPickPlayerSQLId"));
  280. Log("logs/playervehicle.log", szMessage);
  281. }
  282. else {
  283. new ip[MAX_PLAYER_NAME], ip2[MAX_PLAYER_NAME], v = GetPlayerVehicle(GetPVarInt(playerid, "LockPickPlayer"), GetPVarInt(playerid, "LockPickVehicle"));
  284. GetPlayerIp(playerid, ip, sizeof(ip));
  285. GetPlayerIp(GetPVarInt(playerid, "LockPickPlayer"), ip2, sizeof(ip2));
  286. format(szMessage, sizeof(szMessage), "[LOCK PICK] %s(%d) (IP:%s) is attempting to crack trunk a %s(VID:%d Slot %d) owned by %s(IP:%s SQLId: %d)", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), ip, GetVehicleName(PlayerVehicleInfo[GetPVarInt(playerid, "LockPickPlayer")][v][pvId]), PlayerVehicleInfo[GetPVarInt(playerid, "LockPickPlayer")][v][pvId], v, GetPlayerNameEx(GetPVarInt(playerid, "LockPickPlayer")), ip2, GetPlayerSQLId(GetPVarInt(playerid, "LockPickPlayer")));
  287. Log("logs/playervehicle.log", szMessage);
  288. }
  289. }
  290. else {
  291. SendClientMessageEx(playerid, COLOR_PURPLE, "(( Your attempt to crack this vehicle's trunk failed! Try again or move on. ))");
  292. }
  293. }
  294. else {
  295. return SendClientMessageEx(playerid, COLOR_WHITE, "You need to be at the back of the car that you lock picked.");
  296. }*/
  297. SendClientMessageEx(playerid, COLOR_WHITE, "This command has been disabled temporaly disabled due to an unknown issue.");
  298. SendClientMessageEx(playerid, COLOR_WHITE, "Please do not report about this being disabled, we are testing something.");
  299. return 1;
  300. }
  301. CMD:stoplockpick(playerid, params[])
  302. {
  303. if(GetPVarType(playerid, "AttemptingLockPick")) {
  304. DeletePVar(playerid, "AttemptingLockPick");
  305. DeletePVar(playerid, "LockPickCountdown");
  306. DeletePVar(playerid, "LockPickTotalTime");
  307. if(GetPVarType(playerid, "LockPickVehicleSQLId")) {
  308. DeletePVar(playerid, "LockPickVehicleSQLId");
  309. DeletePVar(playerid, "LockPickPlayerSQLId");
  310. DeletePVar(playerid, "LockPickPlayerName");
  311. DestroyVehicle(GetPVarInt(playerid, "LockPickVehicle"));
  312. }
  313. else {
  314. new slot = GetPlayerVehicle(GetPVarInt(playerid, "LockPickPlayer"), GetPVarInt(playerid, "LockPickVehicle"));
  315. PlayerVehicleInfo[GetPVarInt(playerid, "LockPickPlayer")][slot][pvBeingPickLocked] = 0;
  316. PlayerVehicleInfo[GetPVarInt(playerid, "LockPickPlayer")][slot][pvBeingPickLockedBy] = INVALID_PLAYER_ID;
  317. }
  318. DeletePVar(playerid, "LockPickVehicle");
  319. DeletePVar(playerid, "LockPickPlayer");
  320. DestroyVLPTextDraws(playerid);
  321. ClearAnimationsEx(playerid, 1);
  322. SendClientMessageEx(playerid, COLOR_WHITE, "You have successfully prevented yourself from this lock pick.");
  323. }
  324. return 1;
  325. }
  326. CMD:stopcracking(playerid, params[])
  327. {
  328. if(GetPVarType(playerid, "AttemptingCrackTrunk")) {
  329. DeletePVar(playerid, "AttemptingCrackTrunk");
  330. DeletePVar(playerid, "CrackTrunkCountdown");
  331. DestroyVLPTextDraws(playerid);
  332. ClearAnimationsEx(playerid, 1);
  333. SendClientMessageEx(playerid, COLOR_WHITE, "You have successfully prevented yourself from this lock pick.");
  334. }
  335. return 1;
  336. }
  337. DeliverVehicleTimer(i)
  338. {
  339. szMiscArray[0] = 0;
  340. if(GetPVarType(i, "DeliveringVehicleTime")) {
  341. new Float: x,
  342. Float: y,
  343. Float: z,
  344. int = GetPlayerInterior(i),
  345. ownerid = GetPVarInt(i, "LockPickPlayer");
  346. GetVehiclePos(GetPVarInt(i, "LockPickVehicle"), x, y, z);
  347. if(GetPVarInt(i, "DeliveringVehicleTime") < gettime() || !IsPlayerInRangeOfPoint(i, 50.0, x, y, z) && int == 0) {
  348. SendClientMessageEx(i, COLOR_YELLOW, "You failed to deliver the vehicle, the vehicle has been restored.");
  349. if(GetPVarType(i, "LockPickVehicleSQLId"))
  350. {
  351. mysql_format(MainPipeline, szMiscArray, sizeof(szMiscArray), "UPDATE `vehicles` SET `pvFuel` = %0.5f WHERE `id` = '%d' AND `sqlID` = '%d'", VehicleFuel[GetPVarInt(i, "LockPickVehicle")], GetPVarInt(i, "LockPickVehicleSQLId"), GetPVarInt(i, "LockPickPlayerSQLId"));
  352. mysql_tquery(MainPipeline, szMiscArray, "OnQueryFinish", "ii", SENDDATA_THREAD, i);
  353. DeletePVar(i, "LockPickVehicleSQLId");
  354. DeletePVar(i, "LockPickPlayerSQLId");
  355. DeletePVar(i, "LockPickPlayerName");
  356. }
  357. else {
  358. new slot = GetPlayerVehicle(GetPVarInt(i, "LockPickPlayer"), GetPVarInt(i, "LockPickVehicle"));
  359. --PlayerCars;
  360. VehicleSpawned[ownerid]--;
  361. PlayerVehicleInfo[ownerid][slot][pvBeingPickLocked] = 0;
  362. PlayerVehicleInfo[ownerid][slot][pvBeingPickLockedBy] = INVALID_PLAYER_ID;
  363. PlayerVehicleInfo[ownerid][slot][pvAlarmTriggered] = 0;
  364. PlayerVehicleInfo[ownerid][slot][pvSpawned] = 0;
  365. PlayerVehicleInfo[ownerid][slot][pvFuel] = VehicleFuel[GetPVarInt(i, "LockPickVehicle")];
  366. GetVehicleHealth(PlayerVehicleInfo[ownerid][slot][pvId], PlayerVehicleInfo[ownerid][slot][pvHealth]);
  367. PlayerVehicleInfo[ownerid][slot][pvId] = INVALID_PLAYER_VEHICLE_ID;
  368. g_mysql_SaveVehicle(ownerid, slot);
  369. }
  370. DestroyVehicle(GetPVarInt(i, "LockPickVehicle"));
  371. DisablePlayerCheckpoint(i);
  372. DeletePVar(i, "DeliveringVehicleTime");
  373. DeletePVar(i, "LockPickVehicle");
  374. DeletePVar(i, "LockPickPlayer");
  375. }
  376. }
  377. }