Guest User

Untitled

a guest
Jan 3rd, 2017
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.60 KB | None | 0 0
  1. //NEW
  2. new PickLockTimer[MAX_PLAYERS];
  3. new LockPicking[MAX_PLAYERS];
  4. //FORWARD
  5.  
  6. forward Lockpick(playerid);
  7. forward Lockpickmove(playerid);
  8. forward Lockpickmove2(playerid);
  9. forward Lockpicked(playerid);
  10. forward Startalarm(playerid);
  11. forward Breakin(playerid);
  12. forward Breakinmove(playerid);
  13. forward Breakinmove2(playerid);
  14. forward Breakin2(playerid);
  15. forward RobHouse1(playerid);
  16. forward RobInHouse(playerid);
  17. forward RobInHouse2(playerid);
  18. forward RobbedHouse(playerid)
  19. //ENUM
  20. enum pInfo
  21. {
  22. pSpraycan,
  23. pScrew,
  24. pCrowbar,
  25. pHammer,
  26. pWrench,
  27. Lockpicking,
  28. CLockpick,
  29. HLockpick,
  30. RobHouse,
  31. RobHouseTime,
  32. RobHouseID,
  33. };
  34. new PlayerInfo[MAX_PLAYERS][pInfo];
  35. //
  36. public OnPlayerConnect(playerid)
  37. {
  38. LockPicking[playerid] = 999;
  39. PlayerInfo[playerid][Lockpicking] = 0;
  40. return 1;
  41. }
  42. public OnPlayerDisconnect(playerid, reason)
  43. {
  44. if(PlayerInfo[playerid][Lockpicking] != 0)
  45. {
  46. PlayerInfo[playerid][Lockpicking] = 0;
  47. PlayerInfo[playerid][CLockpick] = 0;
  48. PlayerInfo[playerid][HLockpick] = 999;
  49. }
  50. public OnPlayerDeath(playerid, killerid, reason)
  51. {
  52. wrench[playerid] = 0;
  53. hammer[playerid] = 0;
  54. crowbar[playerid] = 0;
  55. screwdriver[playerid] = 0;
  56. if(PlayerInfo[playerid][Lockpicking] > 0)
  57. {
  58. PlayerInfo[playerid][Lockpicking] = 0;
  59. PlayerInfo[playerid][CLockpick] = 0;
  60. PlayerInfo[playerid][HLockpick] = 999;
  61. return 1;
  62. }
  63. public Breakin(playerid)
  64. {
  65. if(PlayerInfo[playerid][Lockpicking] == 20)
  66. {
  67. new string[60];
  68. SetTimerEx("Breakin", 1000, false, "d", playerid);
  69. format(string, sizeof(string), "~g~20");
  70. GameTextForPlayer(playerid, string, 1000, 5);
  71. PlayerInfo[playerid][Lockpicking] = 19;
  72. }
  73. else if(PlayerInfo[playerid][Lockpicking] == 19)
  74. {
  75. new string[60];
  76. SetTimerEx("Breakin", 1000, false, "d", playerid);
  77. format(string, sizeof(string), "~g~19");
  78. GameTextForPlayer(playerid, string, 1000, 5);
  79. PlayerInfo[playerid][Lockpicking] = 18;
  80. }
  81. else if(PlayerInfo[playerid][Lockpicking] == 1
  82. {
  83. new string[60];
  84. SetTimerEx("Breakin", 1000, false, "d", playerid);
  85. format(string, sizeof(string), "~g~18");
  86. GameTextForPlayer(playerid, string, 1000, 5);
  87. PlayerInfo[playerid][Lockpicking] = 17;
  88. }
  89. else if(PlayerInfo[playerid][Lockpicking] == 17)
  90. {
  91. new string[60];
  92. SetTimerEx("Breakin", 1000, false, "d", playerid);
  93. format(string, sizeof(string), "~g~17");
  94. GameTextForPlayer(playerid, string, 1000, 5);
  95. PlayerInfo[playerid][Lockpicking] = 16;
  96. }
  97. else if(PlayerInfo[playerid][Lockpicking] == 16)
  98. {
  99. new string[60];
  100. SetTimerEx("Breakin", 1000, false, "d", playerid);
  101. format(string, sizeof(string), "~g~16");
  102. GameTextForPlayer(playerid, string, 1000, 5);
  103. PlayerInfo[playerid][Lockpicking] = 15;
  104. }
  105. else if(PlayerInfo[playerid][Lockpicking] == 15)
  106. {
  107. new string[60];
  108. SetTimerEx("Breakin", 1000, false, "d", playerid);
  109. format(string, sizeof(string), "~g~15");
  110. GameTextForPlayer(playerid, string, 1000, 5);
  111. PlayerInfo[playerid][Lockpicking] = 14;
  112. }
  113. else if(PlayerInfo[playerid][Lockpicking] == 14)
  114. {
  115. new string[60];
  116. SetTimerEx("Breakin", 1000, false, "d", playerid);
  117. format(string, sizeof(string), "~g~14");
  118. GameTextForPlayer(playerid, string, 1000, 5);
  119. PlayerInfo[playerid][Lockpicking] = 13;
  120. }
  121. else if(PlayerInfo[playerid][Lockpicking] == 13)
  122. {
  123. new string[60];
  124. SetTimerEx("Breakin", 1000, false, "d", playerid);
  125. format(string, sizeof(string), "~g~13");
  126. GameTextForPlayer(playerid, string, 1000, 5);
  127. PlayerInfo[playerid][Lockpicking] = 12;
  128. }
  129. else if(PlayerInfo[playerid][Lockpicking] == 12)
  130. {
  131. new string[60];
  132. SetTimerEx("Breakin", 1000, false, "d", playerid);
  133. format(string, sizeof(string), "~g~12");
  134. GameTextForPlayer(playerid, string, 1000, 5);
  135. PlayerInfo[playerid][Lockpicking] = 11;
  136. }
  137. else if(PlayerInfo[playerid][Lockpicking] == 11)
  138. {
  139. new string[60];
  140. SetTimerEx("Breakin", 1000, false, "d", playerid);
  141. format(string, sizeof(string), "~g~11");
  142. GameTextForPlayer(playerid, string, 1000, 5);
  143. PlayerInfo[playerid][Lockpicking] = 10;
  144. }
  145. else if(PlayerInfo[playerid][Lockpicking] == 10)
  146. {
  147. new string[60];
  148. SetTimerEx("Breakin", 1000, false, "d", playerid);
  149. format(string, sizeof(string), "~r~10");
  150. GameTextForPlayer(playerid, string, 1000, 5);
  151. PlayerInfo[playerid][Lockpicking] = 9;
  152. }
  153. else if(PlayerInfo[playerid][Lockpicking] == 9)
  154. {
  155. new string[60];
  156. SetTimerEx("Breakin", 1000, false, "d", playerid);
  157. format(string, sizeof(string), "~r~9");
  158. GameTextForPlayer(playerid, string, 1000, 5);
  159. PlayerInfo[playerid][Lockpicking] = 8;
  160. }
  161. else if(PlayerInfo[playerid][Lockpicking] ==
  162. {
  163. new string[60];
  164. SetTimerEx("Breakin", 1000, false, "d", playerid);
  165. format(string, sizeof(string), "~r~8");
  166. GameTextForPlayer(playerid, string, 1000, 5);
  167. PlayerInfo[playerid][Lockpicking] = 7;
  168. }
  169. else if(PlayerInfo[playerid][Lockpicking] == 7)
  170. {
  171. new string[60];
  172. SetTimerEx("Breakin", 1000, false, "d", playerid);
  173. format(string, sizeof(string), "~r~7");
  174. GameTextForPlayer(playerid, string, 1000, 5);
  175. PlayerInfo[playerid][Lockpicking] = 6;
  176. }
  177. else if(PlayerInfo[playerid][Lockpicking] == 6)
  178. {
  179. new string[60];
  180. SetTimerEx("Breakin", 1000, false, "d", playerid);
  181. format(string, sizeof(string), "~r~6");
  182. GameTextForPlayer(playerid, string, 1000, 5);
  183. PlayerInfo[playerid][Lockpicking] = 5;
  184. }
  185. else if(PlayerInfo[playerid][Lockpicking] == 5)
  186. {
  187. new string[60];
  188. SetTimerEx("Breakin", 1000, false, "d", playerid);
  189. format(string, sizeof(string), "~r~5");
  190. GameTextForPlayer(playerid, string, 1000, 5);
  191. PlayerInfo[playerid][Lockpicking] = 4;
  192. }
  193. else if(PlayerInfo[playerid][Lockpicking] == 4)
  194. {
  195. new string[60];
  196. SetTimerEx("Breakin", 1000, false, "d", playerid);
  197. format(string, sizeof(string), "~r~4");
  198. GameTextForPlayer(playerid, string, 1000, 5);
  199. PlayerInfo[playerid][Lockpicking] = 3;
  200. }
  201. else if(PlayerInfo[playerid][Lockpicking] == 3)
  202. {
  203. new string[60];
  204. SetTimerEx("Breakin", 1000, false, "d", playerid);
  205. format(string, sizeof(string), "~r~3");
  206. GameTextForPlayer(playerid, string, 1000, 5);
  207. PlayerInfo[playerid][Lockpicking] = 2;
  208. }
  209. else if(PlayerInfo[playerid][Lockpicking] == 2)
  210. {
  211. new string[60];
  212. SetTimerEx("Breakin", 1000, false, "d", playerid);
  213. format(string, sizeof(string), "~r~2");
  214. GameTextForPlayer(playerid, string, 1000, 5);
  215. PlayerInfo[playerid][Lockpicking] = 1;
  216. }
  217. else if(PlayerInfo[playerid][Lockpicking] == 1)
  218. {
  219. new string[60];
  220. SetTimerEx("Breakin2", 1, false, "d", playerid);
  221. format(string, sizeof(string), "~r~1");
  222. GameTextForPlayer(playerid, string, 1000, 5);
  223. }
  224. }
  225.  
  226. public Breakinmove(playerid)
  227. {
  228. if(PlayerInfo[playerid][Lockpicking] > 0)
  229. {
  230. new house = PlayerInfo[playerid][HLockpick];
  231. if(IsPlayerInRangeOfPoint(playerid, 2.0, HouseInfo[house][hLocation_x],HouseInfo[house][hLocation_y],HouseInfo[house][hLocation_z]))
  232. {
  233. SetTimerEx("Breakinmove", 1000, false, "d", playerid);
  234. return 1;
  235. }
  236. else
  237. {
  238. SetTimerEx("Breakinmove2", 1, false, "d", playerid);
  239. return 1;
  240. }
  241. }
  242. return 1;
  243. }
  244.  
  245. public Breakinmove2(playerid)
  246. {
  247. if(PlayerInfo[playerid][Lockpicking] > 0)
  248. {
  249. new house = PlayerInfo[playerid][HLockpick];
  250. if(IsPlayerInRangeOfPoint(playerid, 2.0, HouseInfo[house][hLocation_x],HouseInfo[house][hLocation_y],HouseInfo[house][hLocation_z]))
  251. {
  252. SetTimerEx("Breakinmove", 1, false, "d", playerid);
  253. return 1;
  254. }
  255. else
  256. {
  257. new string[128];
  258. format(string,sizeof(string),"** You moved from your position, lockpick failed.");
  259. SendClientMessage(playerid, COLOR_WHITE, string);
  260. PlayerInfo[playerid][Lockpicking] = 0;
  261. PlayerInfo[playerid][HLockpick] = 999;
  262. return 1;
  263. }
  264. }
  265. return 1;
  266. }
  267.  
  268. public Breakin2(playerid)
  269. {
  270. new string[128];
  271. new sendername[MAX_PLAYER_NAME];
  272. GetPlayerNameEx(playerid, sendername, sizeof(sendername));
  273. if(PlayerInfo[playerid][Lockpicking] > 0)
  274. {
  275. new house = PlayerInfo[playerid][HLockpick];
  276. SendClientMessage(playerid, COLOR_WHITE, "Door {2F991A}unlocked!");
  277. PlayerInfo[playerid][Lockpicking] = 0;
  278. PlayerInfo[playerid][HLockpick] = 999;
  279. HouseInfo[house][hLocked] = 0;
  280. if(PlayerInfo[playerid][pMask] == 1){ sendername = "Stranger"; }
  281. format(string, sizeof(string), "* %s has successfully unlocked the door.", sendername);
  282. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
  283. return 1;
  284. }
  285. return 1;
  286. }
  287.  
  288.  
  289. public Lockpick(playerid)
  290. {
  291. if(PlayerInfo[playerid][Lockpicking] == 60)
  292. {
  293. new string[60];
  294. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  295. format(string, sizeof(string), "~g~60");
  296. GameTextForPlayer(playerid, string, 1000, 5);
  297. PlayerInfo[playerid][Lockpicking] = 59;
  298. }
  299. else if(PlayerInfo[playerid][Lockpicking] == 59)
  300. {
  301. new string[60];
  302. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  303. format(string, sizeof(string), "~g~59");
  304. GameTextForPlayer(playerid, string, 1000, 5);
  305. PlayerInfo[playerid][Lockpicking] = 58;
  306. }
  307. else if(PlayerInfo[playerid][Lockpicking] == 5
  308. {
  309. new string[60];
  310. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  311. format(string, sizeof(string), "~g~58");
  312. GameTextForPlayer(playerid, string, 1000, 5);
  313. PlayerInfo[playerid][Lockpicking] = 57;
  314. }
  315. else if(PlayerInfo[playerid][Lockpicking] == 57)
  316. {
  317. new string[60];
  318. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  319. format(string, sizeof(string), "~g~57");
  320. GameTextForPlayer(playerid, string, 1000, 5);
  321. PlayerInfo[playerid][Lockpicking] = 56;
  322. }
  323. else if(PlayerInfo[playerid][Lockpicking] == 56)
  324. {
  325. new string[60];
  326. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  327. format(string, sizeof(string), "~g~56");
  328. GameTextForPlayer(playerid, string, 1000, 5);
  329. PlayerInfo[playerid][Lockpicking] = 55;
  330. }
  331. else if(PlayerInfo[playerid][Lockpicking] == 55)
  332. {
  333. new string[60];
  334. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  335. format(string, sizeof(string), "~g~55");
  336. GameTextForPlayer(playerid, string, 1000, 5);
  337. PlayerInfo[playerid][Lockpicking] = 54;
  338. }
  339. else if(PlayerInfo[playerid][Lockpicking] == 54)
  340. {
  341. new string[60];
  342. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  343. format(string, sizeof(string), "~g~54");
  344. GameTextForPlayer(playerid, string, 1000, 5);
  345. PlayerInfo[playerid][Lockpicking] = 53;
  346. }
  347. else if(PlayerInfo[playerid][Lockpicking] == 53)
  348. {
  349. new string[60];
  350. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  351. format(string, sizeof(string), "~g~53");
  352. GameTextForPlayer(playerid, string, 1000, 5);
  353. PlayerInfo[playerid][Lockpicking] = 52;
  354. }
  355. else if(PlayerInfo[playerid][Lockpicking] == 52)
  356. {
  357. new string[60];
  358. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  359. format(string, sizeof(string), "~g~52");
  360. GameTextForPlayer(playerid, string, 1000, 5);
  361. PlayerInfo[playerid][Lockpicking] = 51;
  362. }
  363. else if(PlayerInfo[playerid][Lockpicking] == 51)
  364. {
  365. new string[60];
  366. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  367. format(string, sizeof(string), "~g~51");
  368. GameTextForPlayer(playerid, string, 1000, 5);
  369. PlayerInfo[playerid][Lockpicking] = 50;
  370. }
  371. else if(PlayerInfo[playerid][Lockpicking] == 50)
  372. {
  373. new string[60];
  374. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  375. format(string, sizeof(string), "~g~50");
  376. GameTextForPlayer(playerid, string, 1000, 5);
  377. PlayerInfo[playerid][Lockpicking] = 49;
  378. }
  379. else if(PlayerInfo[playerid][Lockpicking] == 49)
  380. {
  381. new string[60];
  382. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  383. format(string, sizeof(string), "~g~49");
  384. GameTextForPlayer(playerid, string, 1000, 5);
  385. PlayerInfo[playerid][Lockpicking] = 48;
  386. }
  387. else if(PlayerInfo[playerid][Lockpicking] == 4
  388. {
  389. new string[60];
  390. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  391. format(string, sizeof(string), "~g~48");
  392. GameTextForPlayer(playerid, string, 1000, 5);
  393. PlayerInfo[playerid][Lockpicking] = 47;
  394. }
  395. else if(PlayerInfo[playerid][Lockpicking] == 47)
  396. {
  397. new string[60];
  398. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  399. format(string, sizeof(string), "~g~47");
  400. GameTextForPlayer(playerid, string, 1000, 5);
  401. PlayerInfo[playerid][Lockpicking] = 46;
  402. }
  403. else if(PlayerInfo[playerid][Lockpicking] == 46)
  404. {
  405. new string[60];
  406. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  407. format(string, sizeof(string), "~g~46");
  408. GameTextForPlayer(playerid, string, 1000, 5);
  409. PlayerInfo[playerid][Lockpicking] = 45;
  410. }
  411. else if(PlayerInfo[playerid][Lockpicking] == 45)
  412. {
  413. new string[60];
  414. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  415. format(string, sizeof(string), "~g~45");
  416. GameTextForPlayer(playerid, string, 1000, 5);
  417. PlayerInfo[playerid][Lockpicking] = 44;
  418. }
  419. else if(PlayerInfo[playerid][Lockpicking] == 44)
  420. {
  421. new string[60];
  422. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  423. format(string, sizeof(string), "~g~44");
  424. GameTextForPlayer(playerid, string, 1000, 5);
  425. PlayerInfo[playerid][Lockpicking] = 43;
  426. }
  427. else if(PlayerInfo[playerid][Lockpicking] == 43)
  428. {
  429. new string[60];
  430. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  431. format(string, sizeof(string), "~g~43");
  432. GameTextForPlayer(playerid, string, 1000, 5);
  433. PlayerInfo[playerid][Lockpicking] = 42;
  434. }
  435. else if(PlayerInfo[playerid][Lockpicking] == 42)
  436. {
  437. new string[60];
  438. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  439. format(string, sizeof(string), "~g~42");
  440. GameTextForPlayer(playerid, string, 1000, 5);
  441. PlayerInfo[playerid][Lockpicking] = 41;
  442. }
  443. else if(PlayerInfo[playerid][Lockpicking] == 41)
  444. {
  445. new string[60];
  446. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  447. SetTimerEx("Startalarm", 1000, false, "d", playerid);
  448. format(string, sizeof(string), "~g~41");
  449. GameTextForPlayer(playerid, string, 1000, 5);
  450. PlayerInfo[playerid][Lockpicking] = 40;
  451. }
  452. else if(PlayerInfo[playerid][Lockpicking] == 40)
  453. {
  454. new string[60];
  455. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  456. format(string, sizeof(string), "~g~40");
  457. GameTextForPlayer(playerid, string, 1000, 5);
  458. PlayerInfo[playerid][Lockpicking] = 39;
  459. }
  460. else if(PlayerInfo[playerid][Lockpicking] == 39)
  461. {
  462. new string[60];
  463. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  464. format(string, sizeof(string), "~g~39");
  465. GameTextForPlayer(playerid, string, 1000, 5);
  466. PlayerInfo[playerid][Lockpicking] = 38;
  467. }
  468. else if(PlayerInfo[playerid][Lockpicking] == 3
  469. {
  470. new string[60];
  471. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  472. format(string, sizeof(string), "~g~38");
  473. GameTextForPlayer(playerid, string, 1000, 5);
  474. PlayerInfo[playerid][Lockpicking] = 37;
  475. }
  476. else if(PlayerInfo[playerid][Lockpicking] == 37)
  477. {
  478. new string[60];
  479. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  480. format(string, sizeof(string), "~g~37");
  481. GameTextForPlayer(playerid, string, 1000, 5);
  482. PlayerInfo[playerid][Lockpicking] = 36;
  483. }
  484. else if(PlayerInfo[playerid][Lockpicking] == 36)
  485. {
  486. new string[60];
  487. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  488. format(string, sizeof(string), "~g~36");
  489. GameTextForPlayer(playerid, string, 1000, 5);
  490. PlayerInfo[playerid][Lockpicking] = 35;
  491. }
  492. else if(PlayerInfo[playerid][Lockpicking] == 35)
  493. {
  494. new string[60];
  495. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  496. format(string, sizeof(string), "~g~35");
  497. GameTextForPlayer(playerid, string, 1000, 5);
  498. PlayerInfo[playerid][Lockpicking] = 34;
  499. }
  500. else if(PlayerInfo[playerid][Lockpicking] == 34)
  501. {
  502. new string[60];
  503. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  504. format(string, sizeof(string), "~g~34");
  505. GameTextForPlayer(playerid, string, 1000, 5);
  506. PlayerInfo[playerid][Lockpicking] = 33;
  507. }
  508. else if(PlayerInfo[playerid][Lockpicking] == 33)
  509. {
  510. new string[60];
  511. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  512. format(string, sizeof(string), "~g~33");
  513. GameTextForPlayer(playerid, string, 1000, 5);
  514. PlayerInfo[playerid][Lockpicking] = 32;
  515. }
  516. else if(PlayerInfo[playerid][Lockpicking] == 32)
  517. {
  518. new string[60];
  519. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  520. format(string, sizeof(string), "~g~32");
  521. GameTextForPlayer(playerid, string, 1000, 5);
  522. PlayerInfo[playerid][Lockpicking] = 31;
  523. }
  524. else if(PlayerInfo[playerid][Lockpicking] == 31)
  525. {
  526. new string[60];
  527. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  528. format(string, sizeof(string), "~g~31");
  529. GameTextForPlayer(playerid, string, 1000, 5);
  530. PlayerInfo[playerid][Lockpicking] = 30;
  531. }
  532. else if(PlayerInfo[playerid][Lockpicking] == 30)
  533. {
  534. new string[60];
  535. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  536. format(string, sizeof(string), "~g~30");
  537. GameTextForPlayer(playerid, string, 1000, 5);
  538. PlayerInfo[playerid][Lockpicking] = 29;
  539. }
  540. else if(PlayerInfo[playerid][Lockpicking] == 29)
  541. {
  542. new string[60];
  543. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  544. format(string, sizeof(string), "~g~29");
  545. GameTextForPlayer(playerid, string, 1000, 5);
  546. PlayerInfo[playerid][Lockpicking] = 28;
  547. }
  548. else if(PlayerInfo[playerid][Lockpicking] == 2
  549. {
  550. new string[60];
  551. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  552. format(string, sizeof(string), "~g~28");
  553. GameTextForPlayer(playerid, string, 1000, 5);
  554. PlayerInfo[playerid][Lockpicking] = 27;
  555. }
  556. else if(PlayerInfo[playerid][Lockpicking] == 27)
  557. {
  558. new string[60];
  559. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  560. format(string, sizeof(string), "~g~27");
  561. GameTextForPlayer(playerid, string, 1000, 5);
  562. PlayerInfo[playerid][Lockpicking] = 26;
  563. }
  564. else if(PlayerInfo[playerid][Lockpicking] == 26)
  565. {
  566. new string[60];
  567. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  568. format(string, sizeof(string), "~g~26");
  569. GameTextForPlayer(playerid, string, 1000, 5);
  570. PlayerInfo[playerid][Lockpicking] = 25;
  571. }
  572. else if(PlayerInfo[playerid][Lockpicking] == 25)
  573. {
  574. new string[60];
  575. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  576. format(string, sizeof(string), "~g~25");
  577. GameTextForPlayer(playerid, string, 1000, 5);
  578. PlayerInfo[playerid][Lockpicking] = 24;
  579. }
  580. else if(PlayerInfo[playerid][Lockpicking] == 24)
  581. {
  582. new string[60];
  583. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  584. format(string, sizeof(string), "~g~24");
  585. GameTextForPlayer(playerid, string, 1000, 5);
  586. PlayerInfo[playerid][Lockpicking] = 23;
  587. }
  588. else if(PlayerInfo[playerid][Lockpicking] == 23)
  589. {
  590. new string[60];
  591. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  592. format(string, sizeof(string), "~g~23");
  593. GameTextForPlayer(playerid, string, 1000, 5);
  594. PlayerInfo[playerid][Lockpicking] = 22;
  595. }
  596. else if(PlayerInfo[playerid][Lockpicking] == 22)
  597. {
  598. new string[60];
  599. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  600. format(string, sizeof(string), "~g~22");
  601. GameTextForPlayer(playerid, string, 1000, 5);
  602. PlayerInfo[playerid][Lockpicking] = 21;
  603. }
  604. else if(PlayerInfo[playerid][Lockpicking] == 21)
  605. {
  606. new string[60];
  607. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  608. SetTimerEx("Startalarm", 1000, false, "d", playerid);
  609. format(string, sizeof(string), "~g~21");
  610. GameTextForPlayer(playerid, string, 1000, 5);
  611. PlayerInfo[playerid][Lockpicking] = 20;
  612. }
  613. else if(PlayerInfo[playerid][Lockpicking] == 20)
  614. {
  615. new string[60];
  616. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  617. format(string, sizeof(string), "~g~20");
  618. GameTextForPlayer(playerid, string, 1000, 5);
  619. PlayerInfo[playerid][Lockpicking] = 19;
  620. }
  621. else if(PlayerInfo[playerid][Lockpicking] == 19)
  622. {
  623. new string[60];
  624. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  625. format(string, sizeof(string), "~g~19");
  626. GameTextForPlayer(playerid, string, 1000, 5);
  627. PlayerInfo[playerid][Lockpicking] = 18;
  628. }
  629. else if(PlayerInfo[playerid][Lockpicking] == 1
  630. {
  631. new string[60];
  632. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  633. format(string, sizeof(string), "~g~18");
  634. GameTextForPlayer(playerid, string, 1000, 5);
  635. PlayerInfo[playerid][Lockpicking] = 17;
  636. }
  637. else if(PlayerInfo[playerid][Lockpicking] == 17)
  638. {
  639. new string[60];
  640. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  641. format(string, sizeof(string), "~g~17");
  642. GameTextForPlayer(playerid, string, 1000, 5);
  643. PlayerInfo[playerid][Lockpicking] = 16;
  644. }
  645. else if(PlayerInfo[playerid][Lockpicking] == 16)
  646. {
  647. new string[60];
  648. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  649. format(string, sizeof(string), "~g~16");
  650. GameTextForPlayer(playerid, string, 1000, 5);
  651. PlayerInfo[playerid][Lockpicking] = 15;
  652. }
  653. else if(PlayerInfo[playerid][Lockpicking] == 15)
  654. {
  655. new string[60];
  656. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  657. format(string, sizeof(string), "~g~15");
  658. GameTextForPlayer(playerid, string, 1000, 5);
  659. PlayerInfo[playerid][Lockpicking] = 14;
  660. }
  661. else if(PlayerInfo[playerid][Lockpicking] == 14)
  662. {
  663. new string[60];
  664. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  665. format(string, sizeof(string), "~g~14");
  666. GameTextForPlayer(playerid, string, 1000, 5);
  667. PlayerInfo[playerid][Lockpicking] = 13;
  668. }
  669. else if(PlayerInfo[playerid][Lockpicking] == 13)
  670. {
  671. new string[60];
  672. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  673. format(string, sizeof(string), "~g~13");
  674. GameTextForPlayer(playerid, string, 1000, 5);
  675. PlayerInfo[playerid][Lockpicking] = 12;
  676. }
  677. else if(PlayerInfo[playerid][Lockpicking] == 12)
  678. {
  679. new string[60];
  680. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  681. format(string, sizeof(string), "~g~12");
  682. GameTextForPlayer(playerid, string, 1000, 5);
  683. PlayerInfo[playerid][Lockpicking] = 11;
  684. }
  685. else if(PlayerInfo[playerid][Lockpicking] == 11)
  686. {
  687. new string[60];
  688. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  689. format(string, sizeof(string), "~g~11");
  690. GameTextForPlayer(playerid, string, 1000, 5);
  691. PlayerInfo[playerid][Lockpicking] = 10;
  692. }
  693. else if(PlayerInfo[playerid][Lockpicking] == 10)
  694. {
  695. new string[60];
  696. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  697. format(string, sizeof(string), "~r~10");
  698. GameTextForPlayer(playerid, string, 1000, 5);
  699. PlayerInfo[playerid][Lockpicking] = 9;
  700. }
  701. else if(PlayerInfo[playerid][Lockpicking] == 9)
  702. {
  703. new string[60];
  704. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  705. format(string, sizeof(string), "~r~9");
  706. GameTextForPlayer(playerid, string, 1000, 5);
  707. PlayerInfo[playerid][Lockpicking] = 8;
  708. }
  709. else if(PlayerInfo[playerid][Lockpicking] ==
  710. {
  711. new string[60];
  712. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  713. format(string, sizeof(string), "~r~8");
  714. GameTextForPlayer(playerid, string, 1000, 5);
  715. PlayerInfo[playerid][Lockpicking] = 7;
  716. }
  717. else if(PlayerInfo[playerid][Lockpicking] == 7)
  718. {
  719. new string[60];
  720. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  721. format(string, sizeof(string), "~r~7");
  722. GameTextForPlayer(playerid, string, 1000, 5);
  723. PlayerInfo[playerid][Lockpicking] = 6;
  724. }
  725. else if(PlayerInfo[playerid][Lockpicking] == 6)
  726. {
  727. new string[60];
  728. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  729. format(string, sizeof(string), "~r~6");
  730. GameTextForPlayer(playerid, string, 1000, 5);
  731. PlayerInfo[playerid][Lockpicking] = 5;
  732. }
  733. else if(PlayerInfo[playerid][Lockpicking] == 5)
  734. {
  735. new string[60];
  736. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  737. format(string, sizeof(string), "~r~5");
  738. GameTextForPlayer(playerid, string, 1000, 5);
  739. PlayerInfo[playerid][Lockpicking] = 4;
  740. }
  741. else if(PlayerInfo[playerid][Lockpicking] == 4)
  742. {
  743. new string[60];
  744. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  745. format(string, sizeof(string), "~r~4");
  746. GameTextForPlayer(playerid, string, 1000, 5);
  747. PlayerInfo[playerid][Lockpicking] = 3;
  748. }
  749. else if(PlayerInfo[playerid][Lockpicking] == 3)
  750. {
  751. new string[60];
  752. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  753. format(string, sizeof(string), "~r~3");
  754. GameTextForPlayer(playerid, string, 1000, 5);
  755. PlayerInfo[playerid][Lockpicking] = 2;
  756. }
  757. else if(PlayerInfo[playerid][Lockpicking] == 2)
  758. {
  759. new string[60];
  760. SetTimerEx("Lockpick", 1000, false, "d", playerid);
  761. format(string, sizeof(string), "~r~2");
  762. GameTextForPlayer(playerid, string, 1000, 5);
  763. PlayerInfo[playerid][Lockpicking] = 1;
  764. }
  765. else if(PlayerInfo[playerid][Lockpicking] == 1)
  766. {
  767. new string[60];
  768. SetTimerEx("Lockpicked", 1, false, "d", playerid);
  769. SetTimerEx("Startalarm", 1000, false, "d", playerid);
  770. format(string, sizeof(string), "~r~1");
  771. GameTextForPlayer(playerid, string, 1000, 5);
  772. }
  773. }
  774.  
  775. public Startalarm(playerid)
  776. {
  777. new engine,lights,alarm,doors,bonnet,boot,objective;
  778. if(PlayerInfo[playerid][Lockpicking] > 0)
  779. {
  780. if(CarInfo[PlayerInfo[playerid][CLockpick]][tAlarmStarted] == 1)
  781. {
  782. GetVehicleParamsEx(PlayerInfo[playerid][CLockpick],engine,lights,alarm,doors,bonnet,boot,objective);
  783. SetVehicleParamsEx(PlayerInfo[playerid][CLockpick],engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot ,objective);
  784. }
  785. }
  786. return 1;
  787. }
  788. public Lockpickmove(playerid)
  789. {
  790. if(PlayerInfo[playerid][Lockpicking] > 0)
  791. {
  792. new Float:cX, Float:cY, Float:cZ;
  793. new car = PlayerInfo[playerid][CLockpick];
  794. GetVehiclePos(car, cX, cY, cZ);
  795. if(IsPlayerInRangeOfPoint(playerid, 2.0, cX, cY, cZ))
  796. {
  797. SetTimerEx("Lockpickmove", 1000, false, "d", playerid);
  798. return 1;
  799. }
  800. else
  801. {
  802. SetTimerEx("Lockpickmove2", 1, false, "d", playerid);
  803. return 1;
  804. }
  805. }
  806. return 1;
  807. }
  808.  
  809. public Lockpickmove2(playerid)
  810. {
  811. if(PlayerInfo[playerid][Lockpicking] > 0)
  812. {
  813. new Float:cX, Float:cY, Float:cZ;
  814. new car = PlayerInfo[playerid][CLockpick];
  815. GetVehiclePos(car, cX, cY, cZ);
  816. if(IsPlayerInRangeOfPoint(playerid, 2.0, cX, cY, cZ))
  817. {
  818. SetTimerEx("Lockpickmove", 1, false, "d", playerid);
  819. return 1;
  820. }
  821. else
  822. {
  823. new string[128];
  824. format(string,sizeof(string),"** You moved from your position, lockpick failed.");
  825. SendClientMessage(playerid, COLOR_WHITE, string);
  826. PlayerInfo[playerid][Lockpicking] = 0;
  827. PlayerInfo[playerid][CLockpick] = 0;
  828. CarInfo[car][tAlarmStarted] = 0;
  829. return 1;
  830. }
  831. }
  832. return 1;
  833. }
  834.  
  835. public Lockpicked(playerid)
  836. {
  837. new string[128];
  838. new sendername[MAX_PLAYER_NAME];
  839. GetPlayerNameEx(playerid, sendername, sizeof(sendername));
  840. if(PlayerInfo[playerid][Lockpicking] > 0)
  841. {
  842. new engine,lights,alarm,doors,bonnet,boot,objective;
  843. new car = PlayerInfo[playerid][CLockpick];
  844. GetVehicleParamsEx(car,engine,lights,alarm,doors,b onnet,boot,objective);
  845. SetVehicleParamsEx(car,engine,lights,alarm,VEHICLE _PARAMS_OFF,bonnet,boot,objective);
  846. SendClientMessage(playerid, COLOR_WHITE, "Vehicle {2F991A}unlocked!");
  847. PlayerInfo[playerid][Lockpicking] = 0;
  848. PlayerInfo[playerid][CLockpick] = 0;
  849. CarInfo[car][tAlarmStarted] = 0;
  850. CarInfo[car][tLock] = 0;
  851. if(PlayerInfo[playerid][pMask] == 1){ sendername = "Stranger"; }
  852. format(string, sizeof(string), "* %s has successfully unlocked the vehicle.", sendername);
  853. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
  854. }
  855. return 1;
  856. }
  857. if(strcmp(cmd, "/lockpick", true) == 0)
  858. {
  859. new counter = 0;
  860. new result;
  861. new engine,lights,alarm,doors,bonnet,boot,objective;
  862. GetPlayerNameEx(playerid, sendername, sizeof(sendername));
  863. new plyName[MAX_PLAYER_NAME];
  864. GetPlayerName(playerid, plyName, MAX_PLAYER_NAME);
  865. for(new i; i != MAX_VEHICLES; i++)
  866. {
  867. new dist = CheckPlayerDistanceToVehicle(2, playerid, i);
  868. if(dist)
  869. {
  870. result = i;
  871. counter++;
  872. }
  873. }
  874. switch(counter)
  875. {
  876. case 0:
  877. {
  878. SendClientMessage(playerid, COLOR_GREY, " No cars near you");
  879. return 1;
  880. }
  881.  
  882. case 1:
  883. {
  884. if(IsPlayerInAnyVehicle(playerid))
  885. {
  886. SendClientMessage(playerid, COLOR_GREY, " You can't lockpick the vehicle if you're inside it");
  887. return 1;
  888. }
  889. if(PlayerInfo[playerid][Lockpicking] > 0)
  890. {
  891. SendClientMessage(playerid, COLOR_GREY, " You are already lockpicking this vehicle");
  892. return 1;
  893. }
  894. if(PlayerInfo[playerid][pScrew] == 0)
  895. {
  896. SendClientMessage(playerid, COLOR_GREY, " Your need a screwdriver do lockpick a vehicle!");
  897. return 1;
  898. }
  899. if(CarInfo[result][tLock] != 1)
  900. {
  901. SendClientMessage(playerid, COLOR_RED, "This vehicle is already unlocked");
  902. return 1;
  903. }
  904. if(screwdriver[playerid] == 0)
  905. {
  906. SendClientMessage(playerid, COLOR_GREY, " You're not holding a screwdriver (( /screwdriver ))!");
  907. return 1;
  908. }
  909. new owner[MAX_PLAYER_NAME];
  910. strmid(owner, CarInfo[result][tOwner], 0, strlen(CarInfo[result][tOwner]), 255);
  911. giveplayerid = ReturnUser(owner);
  912. if(IsPlayerConnected(giveplayerid))
  913. {
  914. PlayerInfo[playerid][Lockpicking] = 60;
  915. PlayerInfo[playerid][CLockpick] = result;
  916. PlayerInfo[playerid][pScrew]--;
  917. if(CarInfo[result][tAlarm] == 1)
  918. {
  919. new Float:cX, Float:cY, Float:cZ;
  920. new car = PlayerInfo[playerid][CLockpick];
  921. GetVehiclePos(car, cX, cY, cZ);
  922. GetVehicleParamsEx(result,engine,lights,alarm,door s,bonnet,boot,objective);
  923. SetVehicleParamsEx(result,engine,lights,VEHICLE_PA RAMS_ON,doors,bonnet,boot,objective);
  924. CarInfo[result][tAlarmStarted] = 1;
  925. SetPlayerCheckpoint(giveplayerid, cX, cY, cZ, 3.0);
  926. SendClientMessage(giveplayerid, COLOR_WHITE, "["CB"SMS Inbox"CW"] "CB" Sender:"CW" We're watching...™");
  927. SendClientMessage(giveplayerid, COLOR_WHITE, ""CB"Message:"CW" You received this message because one of your vehicle alarm has been activated");
  928. }
  929. if(PlayerInfo[playerid][pMask] == 1){ sendername = "Stranger"; }
  930. format(string, sizeof(string), "** %s pulls out a screwdriver and begins lockpicking the vehicle...", sendername);
  931. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
  932. SendClientMessage(playerid, COLOR_LIGHTBLUE, "** It takes you 1 minute to lockpick the vehicle...");
  933. SetTimerEx("Lockpick", 1, false, "d", playerid);
  934. SetTimerEx("Lockpickmove", 1, false, "d", playerid);
  935. return 1;
  936. }
  937. else
  938. {
  939. SendClientMessage(playerid, COLOR_GREY, " The owner of this car is offline, you can't lockpick it ");
  940. return 1;
  941. }
  942. }
  943.  
  944. default:
  945. {
  946. SendClientMessage(playerid, COLOR_GREY, " Found more then one car in range");
  947. return 1;
  948. }
  949. }
  950. return 1;
  951. }
  952. if(strcmp(cmdtext,"/breakin",true)==0)
  953. {
  954. for(new h = 0; h < sizeof(HouseInfo); h++)
  955. {
  956. if(IsPlayerInRangeOfPoint(playerid, 2, HouseInfo[h][hLocation_x],HouseInfo[h][hLocation_y],HouseInfo[h][hLocation_z]))
  957. {
  958. if(HouseInfo[h][hLocked] == 0)
  959. {
  960. SendClientMessage(playerid,COLOR_GRAD1,"This house is not locked!");
  961. return 1;
  962. }
  963. if(PlayerInfo[playerid][Lockpicking] > 0)
  964. {
  965. SendClientMessage(playerid, COLOR_GREY, " You are already lockpicking this house");
  966. return 1;
  967. }
  968. if(PlayerInfo[playerid][pCrowbar] == 0)
  969. {
  970. SendClientMessage(playerid, COLOR_GREY, " Your need a crowbar do lockpick a door!");
  971. return 1;
  972. }
  973. if(crowbar[playerid] == 0)
  974. {
  975. SendClientMessage(playerid, COLOR_GREY, " You're not holding a crowbar (( /crowbar ))!");
  976. return 1;
  977. }
  978. new owner[MAX_PLAYER_NAME];
  979. strmid(owner, HouseInfo[h][hOwner], 0, strlen(HouseInfo[h][hOwner]), 255);
  980. giveplayerid = ReturnUser(owner);
  981. PlayerInfo[playerid][Lockpicking] = 20;
  982. PlayerInfo[playerid][HLockpick] = h;
  983. PlayerInfo[playerid][pScrew]--;
  984. if(PlayerInfo[playerid][pMask] == 1){ sendername = "Stranger"; }
  985. format(string, sizeof(string), "** %s pulls out a screwdriver and begins lockpicking the house...", sendername);
  986. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
  987. SendClientMessage(playerid, COLOR_LIGHTBLUE, "** It takes you 20 seconds to unlock this house...");
  988. if(HouseInfo[h][hAlarmON] == 1)
  989. {
  990. if(IsPlayerConnected(giveplayerid))
  991. {
  992. SetPlayerCheckpoint(giveplayerid, HouseInfo[h][hLocation_x],HouseInfo[h][hLocation_y],HouseInfo[h][hLocation_z], 3.0);
  993. SendClientMessage(giveplayerid, COLOR_WHITE, "["CB"SMS Inbox"CW"] "CB" Sender:"CW" We're watching...™");
  994. SendClientMessage(giveplayerid, COLOR_WHITE, ""CB"Message:"CW" You received this message because your house alarm has been activated");
  995. }
  996. }
  997. SetTimerEx("Breakin", 1, false, "d", playerid);
  998. SetTimerEx("Breakinmove", 1, false, "d", playerid);
  999. return 1;
  1000. }
  1001. }
  1002. }
  1003.  
  1004. if(strcmp(cmdtext,"/robhouse",true)==0)
  1005. {
  1006. for(new h = 0; h < sizeof(HouseInfo); h++)
  1007. {
  1008. if(PlayerInfo[playerid][pInHouse] == 999)
  1009. {
  1010. SendClientMessage(playerid, COLOR_GREY, " Your need to be in a house to do this!");
  1011. return 1;
  1012. }
  1013. new houseid = PlayerInfo[playerid][pInHouse];
  1014. if(HouseInfo[houseid][hVulnerable] != 0)
  1015. {
  1016. SendClientMessage(playerid,COLOR_GRAD1,"This house was recently robbed!");
  1017. return 1;
  1018. }
  1019. if(PlayerInfo[playerid][pCrowbar] == 0)
  1020. {
  1021. SendClientMessage(playerid, COLOR_GREY, " Your need a crowbar to rob a house!");
  1022. return 1;
  1023. }
  1024. new owner[MAX_PLAYER_NAME];
  1025. strmid(owner, HouseInfo[h][hOwner], 0, strlen(HouseInfo[h][hOwner]), 255);
  1026. giveplayerid = ReturnUser(owner);
  1027. PlayerInfo[playerid][RobHouseTime] = 5;
  1028. PlayerInfo[playerid][RobHouseID] = houseid;
  1029. PlayerInfo[playerid][RobHouse] = 1;
  1030. PlayerInfo[playerid][pCrowbar]--;
  1031. if(PlayerInfo[playerid][pMask] == 1){ sendername = "Stranger"; }
  1032. format(string, sizeof(string), "** %s pulls out a crowbar and begins searching in the house...", sendername);
  1033. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
  1034. SendClientMessage(playerid, COLOR_LIGHTBLUE, "** You have to stay inside the house for 5 minutes");
  1035. SetTimerEx("RobHouse1", 1, false, "d", playerid);
  1036. SetTimerEx("RobInHouse", 1, false, "d", playerid);
  1037. return 1;
  1038. }
  1039. }
Advertisement
Add Comment
Please, Sign In to add comment