Advertisement
Guest User

wawa

a guest
Feb 23rd, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.03 KB | None | 0 0
  1. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  2. {
  3. if(GetPVarInt(playerid, "Injured") == 1) return 1;
  4. if(newkeys & KEY_SECONDARY_ATTACK)
  5. {
  6. new string[128];
  7. if(!GetPVarType(playerid, "Tackling")) {
  8. if(GetPVarInt(playerid, "TackleMode") == 1 && GetPlayerTargetPlayer(playerid) != INVALID_PLAYER_ID && PlayerCuffed[GetPlayerTargetPlayer(playerid)] == 0 && ProxDetectorS(4.0, playerid, GetPlayerTargetPlayer(playerid)) && !IsPlayerNPC(GetPlayerTargetPlayer(playerid)))
  9. {
  10. if(GetPVarInt(playerid, "CopTackleCooldown") != 0)
  11. {
  12. format(string, sizeof(string), "You are exhausted! It will be %d seconds before you can tackle again.", GetPVarInt(playerid, "CopTackleCooldown"));
  13. return SendClientMessageEx(playerid, COLOR_GRAD2, string);
  14. }
  15. if(PlayerInfo[GetPlayerTargetPlayer(playerid)][pAdmin] >= 2 && PlayerInfo[GetPlayerTargetPlayer(playerid)][pTogReports] != 1)
  16. {
  17. SendClientMessageEx(playerid, COLOR_GRAD2, "Admins can not be tackled!");
  18. return 1;
  19. }
  20. #if defined zombiemode
  21. if(GetPVarInt(GetPlayerTargetPlayer(playerid), "pIsZombie"))
  22. {
  23. SendClientMessageEx(playerid, COLOR_GRAD2, "Zombies can not be tackled!");
  24. return 1;
  25. }
  26. #endif
  27. if(PlayerInfo[playerid][pFitness] >= PlayerInfo[GetPlayerTargetPlayer(playerid)][pFitness]) // Player is more fit or as fit as the player they are tackling
  28. {
  29. TacklePlayer(playerid, GetPlayerTargetPlayer(playerid));
  30. }
  31. else if(PlayerInfo[playerid][pFitness] < PlayerInfo[GetPlayerTargetPlayer(playerid)][pFitness])
  32. {
  33. new tacklechance = random(10);
  34. switch(tacklechance)
  35. {
  36. case 0..6: //success
  37. {
  38. TacklePlayer(playerid, GetPlayerTargetPlayer(playerid));
  39. }
  40. default: // fail
  41. {
  42. format(string, sizeof(string), "** %s leaps at %s attempting to tackle them but is not able.", GetPlayerNameEx(playerid), GetPlayerNameEx(GetPlayerTargetPlayer(playerid)));
  43. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  44. TogglePlayerControllable(playerid, 0);
  45. SetTimerEx("CopGetUp", 2500, 0, "i", playerid);
  46. ApplyAnimation(playerid, "SWEET", "Sweet_injuredloop", 4.0, 1, 1, 1, 1, 0, 1);
  47. }
  48. }
  49. }
  50. }
  51. }
  52. }
  53. if((newkeys & KEY_YES) && !(oldkeys & KEY_YES))
  54. {
  55. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  56. {
  57. new engine,lights,alarm,doors,bonnet,boot,objective,vehicleid;
  58. vehicleid = GetPlayerVehicleID(playerid);
  59. if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510 || DynVeh[vehicleid] != -1 && DynVehicleInfo[DynVeh[vehicleid]][gv_iType] == 1 && GetVehicleModel(vehicleid) == 592) return SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used in this vehicle.");
  60. GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
  61. if(engine == VEHICLE_PARAMS_ON)
  62. {
  63. SetVehicleEngine(vehicleid, playerid);
  64. new string[128];
  65. format(string, sizeof(string), "{FF8000}** {C2A2DA}%s turns the key in the ignition and the engine stops.", GetPlayerNameEx(playerid));
  66. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  67. }
  68. else if((engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET))
  69. {
  70. if (GetPVarInt(playerid, "Refueling")) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this while refueling.");
  71. new string[128];
  72. format(string, sizeof(string), "{FF8000}** {C2A2DA}%s turns the key in the ignition and the engine starts.", GetPlayerNameEx(playerid));
  73. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  74. SendClientMessageEx(playerid, COLOR_WHITE, "Vehicle engine starting, please wait...");
  75. SetTimerEx("SetVehicleEngine", 1000, 0, "dd", vehicleid, playerid);
  76. }
  77. }
  78. }
  79. if(newkeys & KEY_NO)
  80. {
  81. if(InsideTradeToys[playerid] == 1)
  82. {
  83. if(IsPlayerConnected(GetPVarInt(playerid, "ttSeller")))
  84. {
  85. new string[128];
  86. format(string, sizeof(string), "%s has declined the toy offer.", GetPlayerNameEx(playerid));
  87. SendClientMessageEx(GetPVarInt(playerid, "ttSeller"), COLOR_LIGHTBLUE, string);
  88. SendClientMessageEx(playerid, COLOR_LIGHTRED, "You have declined the toy offer.");
  89.  
  90. SetPVarInt(GetPVarInt(playerid, "ttSeller"), "ttBuyer", INVALID_PLAYER_ID);
  91. SetPVarInt(GetPVarInt(playerid, "ttSeller"), "ttCost", 0);
  92. SetPVarInt(playerid, "ttSeller", INVALID_PLAYER_ID);
  93.  
  94. HideTradeToysGUI(playerid);
  95. return 1;
  96. }
  97. else {
  98. SendClientMessageEx(playerid, COLOR_LIGHTRED, "The seller has disconnected from the server, therefore you cannot proceed the trade.");
  99. SetPVarInt(playerid, "ttSeller", INVALID_PLAYER_ID);
  100.  
  101. HideTradeToysGUI(playerid);
  102. }
  103. }
  104. }
  105. if(newkeys & KEY_YES)
  106. {
  107. if(InsideTradeToys[playerid] == 1)
  108. {
  109. if(IsPlayerConnected(GetPVarInt(playerid, "ttSeller")))
  110. {
  111. ShowPlayerDialog(playerid, CONFIRMSELLTOY, DIALOG_STYLE_MSGBOX, "Please confirm your choice", "Are you sure you want to purchase this toy for the amount specified?", "Yes", "No");
  112. }
  113. else {
  114. SendClientMessageEx(playerid, COLOR_LIGHTRED, "The seller has disconnected from the server, therefore you cannot proceed the trade.");
  115. SetPVarInt(playerid, "ttSeller", INVALID_PLAYER_ID);
  116.  
  117. HideTradeToysGUI(playerid);
  118. }
  119. }
  120. if(InsideTut{playerid} > 0)
  121. {
  122. TutorialStep(playerid);
  123. TogglePlayerControllable(playerid, false);
  124. return 1;
  125. }
  126. if(GetPVarType(playerid, "Tackling")) {
  127. CopGetUp(playerid);
  128. ClearTackle(GetPVarInt(playerid, "Tackling"));
  129. return 1;
  130. }
  131. if(GetPlayerTargetPlayer(playerid) != INVALID_PLAYER_ID && ProxDetectorS(5.0, playerid, GetPlayerTargetPlayer(playerid)) && !IsPlayerNPC(GetPlayerTargetPlayer(playerid)))
  132. {
  133. if(GetPVarInt(playerid, "TackleMode") == 1) {
  134. return 1;
  135. }
  136. new string[64];
  137. new name[MAX_PLAYER_NAME+8];
  138. format(name, sizeof(name), "{FF0000}%s", GetPlayerNameEx(GetPlayerTargetPlayer(playerid)));
  139. SetPVarString(playerid, "pInteractName", name);
  140. SetPVarInt(playerid, "pInteractID", GetPlayerTargetPlayer(playerid));
  141. format(string, sizeof(string), "Pay\nGive\n");
  142. /*if (PlayerInfo[playerid][pJob] == 9 || PlayerInfo[playerid][pJob2] == 9)
  143. {
  144. format(string, sizeof(string), "%sSell Gun\n", string);
  145. }
  146. if(PlayerInfo[playerid][pJob] == 9 || PlayerInfo[playerid][pJob2] == 9 || PlayerInfo[playerid][pJob] == 18 || PlayerInfo[playerid][pJob2] == 18)
  147. {
  148. format(string, sizeof(string), "%sSell Mats\n", string);
  149. }
  150. if(PlayerInfo[playerid][pJob] == 4 || PlayerInfo[playerid][pJob2] == 4)
  151. {
  152. format(string, sizeof(string), "%sSell Pot\nSell Crack\n", string);
  153. }
  154. if(PlayerInfo[playerid][pJob] == 8 || PlayerInfo[playerid][pJob2] == 8)
  155. {
  156. format(string, sizeof(string), "%sGuard\n", string);
  157. }
  158. if(PlayerInfo[playerid][pJob] == 19 || PlayerInfo[playerid][pJob2] == 19)
  159. {
  160. format(string, sizeof(string), "%sSell Drink\n", string);
  161. }*/
  162. ShowPlayerDialog(playerid, INTERACTMAIN, DIALOG_STYLE_LIST, name, string, "Select", "Cancel");
  163. }
  164. }
  165. // If the client clicked the fire key and is currently injured
  166. else if((newkeys && KEY_FIRE) && GetPVarInt(playerid, "Injured") == 1)
  167. {
  168. ClearAnimations(playerid);
  169. return 1;
  170. }
  171. else if((newkeys & KEY_FIRE) && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && GetPlayerWeapon(playerid) == SPEEDGUN && GetPVarType(playerid, "SpeedRadar"))
  172. {
  173. if(GetPVarInt(playerid, "RadarTimeout") == 0)
  174. {
  175. new Float:x,Float:y,Float:z;
  176. foreach(new i: Player)
  177. {
  178. if(IsPlayerStreamedIn(i, playerid))
  179. {
  180. GetPlayerPos(i,x,y,z);
  181. if(IsPlayerAimingAt(playerid,x,y,z,10))
  182. {
  183. new string[68];
  184. format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~b~License Plate: ~w~%d~n~~b~Speed: ~w~%.0f MPH", GetPlayerVehicleID(i), fVehSpeed[i]);
  185. GameTextForPlayer(playerid, string,3500, 3);
  186. format(string, sizeof(string), "License Plate: %d. Speed: %.0f MPH", GetPlayerVehicleID(i), fVehSpeed[i]);
  187. SendClientMessageEx(playerid, COLOR_GRAD4, string);
  188. SetPVarInt(playerid, "RadarTimeout", 1);
  189. SetTimerEx("RadarCooldown", 3000, 0, "i", playerid);
  190. return 1;
  191. }
  192. }
  193. }
  194. }
  195. }
  196. else if((newkeys & 16) && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && PlayerCuffed[playerid] == 0 && PlayerInfo[playerid][pBeingSentenced] == 0 && GetPVarType(playerid,"UsingAnim") && !GetPVarType(playerid, "IsFrozen"))
  197. {
  198. ClearAnimations(playerid);
  199. DeletePVar(playerid,"UsingAnim");
  200. }
  201. else if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_BEER && (newkeys & KEY_FIRE))
  202. {
  203. if(GetPVarInt(playerid, "DrinkCooledDown") == 1)
  204. {
  205. new Float: cHealth;
  206. GetPlayerHealth(playerid, cHealth);
  207. if(cHealth < 100)
  208. {
  209. SetPlayerHealth(playerid, cHealth+5);
  210. }
  211. else
  212. {
  213. SendClientMessageEx(playerid, COLOR_GREY, "* You finish up the drink and throw it away.");
  214. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
  215. }
  216. DeletePVar(playerid, "DrinkCooledDown");
  217. SetTimerEx("DrinkCooldown", 2500, 0, "i", playerid);
  218. return 1;
  219. }
  220. }
  221. else if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_WINE && (newkeys & KEY_FIRE))
  222. {
  223. if(GetPVarInt(playerid, "DrinkCooledDown") == 1)
  224. {
  225. new Float: cHealth;
  226. GetPlayerHealth(playerid, cHealth);
  227. if(cHealth < 100)
  228. {
  229. SetPlayerHealth(playerid, cHealth+8);
  230. }
  231. else
  232. {
  233. SendClientMessageEx(playerid, COLOR_GREY, "* You finish up the drink and throw it away.");
  234. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
  235. }
  236. DeletePVar(playerid, "DrinkCooledDown");
  237. SetTimerEx("DrinkCooldown", 2500, 0, "i", playerid);
  238. return 1;
  239. }
  240. }
  241.  
  242. else if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_SPRUNK && (newkeys & KEY_FIRE))
  243. {
  244. if(GetPVarInt(playerid, "DrinkCooledDown") == 1 && GetPVarInt(playerid, "UsingSprunk") == 1)
  245. {
  246. new Float: cHealth;
  247. GetPlayerHealth(playerid, cHealth);
  248. if(cHealth < 100)
  249. {
  250. SetPlayerHealth(playerid, cHealth+2);
  251. }
  252. else
  253. {
  254. DeletePVar(playerid, "UsingSprunk");
  255. SendClientMessageEx(playerid, COLOR_GREY, "* You finish up the drink and throw it away.");
  256. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
  257. }
  258. DeletePVar(playerid, "DrinkCooledDown");
  259. SetTimerEx("DrinkCooldown", 2500, 0, "i", playerid);
  260. return 1;
  261. }
  262. }
  263. else if(IsKeyJustDown(KEY_SECONDARY_ATTACK, newkeys, oldkeys))
  264. {
  265. if(GetPVarInt(playerid, "NGPassenger") == 1)
  266. {
  267. TogglePlayerSpectating(playerid, 0);
  268. }
  269. if(GetPVarInt(playerid, "UsingSprunk"))
  270. {
  271. DeletePVar(playerid, "UsingSprunk");
  272. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
  273. return 1;
  274. }
  275. }
  276. else if(!IsPlayerInAnyVehicle(playerid) && newkeys & KEY_CTRL_BACK)
  277. {
  278.  
  279. new Float:pos[3];
  280. GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
  281. if(pos[1] < -1301.4 && pos[1] > -1303.2417 && pos[0] < 1786.2131 && pos[0] > 1784.1555)
  282. { // He is using the elevator button
  283. PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
  284. ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 10.0, 0, 0, 0, 0, 0);
  285. ShowElevatorDialog(playerid, 1);
  286. }
  287. else // Is he in a floor button?
  288. {
  289. if(pos[1] > -1301.4 && pos[1] < -1299.1447 && pos[0] < 1785.6147 && pos[0] > 1781.9902)
  290. {
  291. // He is most likely using it, check floor:
  292. new i=20;
  293. while(pos[2] < GetDoorsZCoordForFloor(i) + 3.5 && i > 0)
  294. i --;
  295.  
  296. if(i == 0 && pos[2] < GetDoorsZCoordForFloor(0) + 2.0)
  297. i = -1;
  298.  
  299. if(i <= 19)
  300. {
  301. PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
  302. ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 10.0, 0, 0, 0, 0, 0);
  303. CallElevator(playerid, i + 1);
  304. GameTextForPlayer(playerid, "~r~Elevator called", 3500, 4);
  305. }
  306. }
  307. }
  308. }
  309. else if(IsKeyJustDown(128, newkeys, oldkeys))
  310. {
  311. if(ConfigEventCPs[playerid][1] == 1 && ConfigEventCPs[playerid][0] == 1) {
  312. SendClientMessageEx(playerid, COLOR_WHITE, "You have cancelled stage 1, you can't edit the checkpoint's position.");
  313. ConfigEventCPs[playerid][1] = 0;
  314. ConfigEventCPs[playerid][0] = 0;
  315. ConfigEventCPs[playerid][2] = 0;
  316. }
  317. else if(ConfigEventCPs[playerid][1] == 2 && ConfigEventCPs[playerid][0] == 1) {
  318. TogglePlayerControllable(playerid, true);
  319. SendClientMessageEx(playerid, COLOR_WHITE, "You have cancelled stage 2, please choose another position. If you want to cancel stage 1(Edit CP Position) press the AIM button again.");
  320. ConfigEventCPs[playerid][1] = 1;
  321. }
  322. if(GetPVarInt(playerid, "CreateGT") == 1)
  323. {
  324. DeletePVar(playerid, "CreateGT");
  325. SendClientMessageEx(playerid, COLOR_GREY, "You have stopped creating a new gang tag.");
  326. }
  327. if(GetPVarInt(playerid, "gt_Edit") == 1)
  328. {
  329. DeletePVar(playerid, "gt_ID");
  330. DeletePVar(playerid, "gt_Edit");
  331. SendClientMessageEx(playerid, COLOR_GREY, "You have stopped editing the position.");
  332. }
  333. }
  334. else if (IsKeyJustDown(KEY_FIRE, newkeys, oldkeys))
  335. {
  336. if(ConfigEventCPs[playerid][1] == 1 && ConfigEventCPs[playerid][0] == 1) {
  337. TogglePlayerControllable(playerid, false);
  338. new string[92], Float: x, Float: y, Float: z;
  339. GetPlayerPos(playerid, x, y, z);
  340. format(string, sizeof(string), "Position: X = %f.3 Y = %f.3 Z = %f.3", x, y, z);
  341. SendClientMessageEx(playerid, COLOR_WHITE, "Are you sure this is the correct position? Please press the fire button again to confirm this, you can cancel by simply pressing the AIM button.");
  342. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  343. ConfigEventCPs[playerid][1] = 2;
  344. }
  345. else if(ConfigEventCPs[playerid][1] == 2 && ConfigEventCPs[playerid][0] == 1) {
  346. TogglePlayerControllable(playerid, true);
  347. new string[298];
  348. GetPlayerPos(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]]);
  349. format(string, sizeof(string), "You have successfuly created a race checkpoint. Position: X = %f.3 Y = %f.3 Z = %f.3 - ID:%d", EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], ConfigEventCPId[playerid]);
  350. SendClientMessageEx(playerid, COLOR_WHITE, string);
  351. if(ConfigEventCPs[playerid][2] == 1)
  352. {
  353. EventRCPU[ConfigEventCPId[playerid]] = 1;
  354. EventRCPS[ConfigEventCPId[playerid]] = 10.0;
  355. if(ConfigEventCPId[playerid] == 0) {
  356. EventRCPT[ConfigEventCPId[playerid]] = 1;
  357. SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
  358. }
  359. else {
  360. EventRCPT[ConfigEventCPId[playerid]] = 2;
  361. SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
  362. }
  363. ConfigEventCPs[playerid][1] = 3;
  364. format(string,sizeof(string),"Race Checkpoint %d Size", ConfigEventCPId[playerid]);
  365. ShowPlayerDialog(playerid,RCPSIZE,DIALOG_STYLE_INPUT,string,"You are now in stage 3, which means you will need to choose the size of the checkpoint\nYou now have a preview of the checkpoint(Step outside the checkpoint so you can see it)\nNote: Checkpoint is now made with the default settings,\nyou may choose not to continue checkpoint won't be affected.","Ok","Cancel");
  366. }
  367. else
  368. {
  369. if(EventRCPT[ConfigEventCPId[playerid]] == 1) {
  370. SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
  371. }
  372. else if(EventRCPT[ConfigEventCPId[playerid]] == 4) {
  373. SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
  374. }
  375. else {
  376. SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
  377. }
  378. }
  379. }
  380. if( PlayerInfo[playerid][pC4Used] == 1 )
  381. {
  382. if(GoChase[playerid] != INVALID_PLAYER_ID)
  383. {
  384. if(IsPlayerInRangeOfPoint(GoChase[playerid], 12.0, GetPVarFloat(playerid, "DYN_C4_FLOAT_X"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Y"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Z")))
  385. {
  386. if(PlayerInfo[GoChase[playerid]][pHeadValue] >= 1)
  387. {
  388. if (IsAHitman(playerid))
  389. {
  390. new string[128];
  391. new takemoney = (PlayerInfo[GoChase[playerid]][pHeadValue] / 4) * 2;
  392. GivePlayerCash(playerid, takemoney);
  393. GivePlayerCash(GoChase[playerid], -takemoney);
  394. format(string,sizeof(string),"Hitman %s has fulfilled the contract on %s and collected $%d",GetPlayerNameEx(playerid),GetPlayerNameEx(GoChase[playerid]),takemoney);
  395. SendGroupMessage(2, COLOR_YELLOW, string);
  396. format(string,sizeof(string),"You have been critically injured by a Hitman and lost $%d!",takemoney);
  397. ResetPlayerWeaponsEx(GoChase[playerid]);
  398. // SpawnPlayer(GoChase[playerid]);
  399. SendClientMessageEx(GoChase[playerid], COLOR_YELLOW, string);
  400. PlayerInfo[GoChase[playerid]][pHeadValue] = 0;
  401. PlayerInfo[playerid][pCHits] += 1;
  402. SetPlayerHealth(GoChase[playerid], 0.0);
  403. // KillEMSQueue(GoChase[playerid]);
  404. GotHit[GoChase[playerid]] = 0;
  405. GetChased[GoChase[playerid]] = INVALID_PLAYER_ID;
  406. GoChase[playerid] = INVALID_PLAYER_ID;
  407. }
  408. }
  409. }
  410. }
  411. PlayerInfo[playerid][pC4Used] = 0;
  412. CreateExplosion(GetPVarFloat(playerid, "DYN_C4_FLOAT_X"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Y"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Z"), 7, 8);
  413. PickUpC4(playerid);
  414. SendClientMessageEx(playerid, COLOR_YELLOW, " Bomb has been detonated!");
  415. PlayerInfo[playerid][pC4Used] = 0;
  416. return 1;
  417. }
  418. if(GetPVarInt(playerid, "MovingStretcher") != -1)
  419. {
  420. KillTimer(GetPVarInt(playerid, "TickEMSMove"));
  421. MoveEMS(playerid);
  422. return 1;
  423. }
  424. if(GetPVarInt(playerid, "editingfamhq") != INVALID_FAMILY_ID)
  425. {
  426. if(GetPVarInt(playerid, "editingfamhqaction") == 1)
  427. {
  428. DeletePVar(playerid, "editingfamhqaction");
  429. TogglePlayerControllable(playerid, false);
  430. ShowPlayerDialog(playerid,HQENTRANCE,DIALOG_STYLE_MSGBOX,"Warning:","Is this the entrance you want?","Ok","Cancel");
  431. }
  432. else if(GetPVarInt(playerid, "editingfamhqaction") == 2)
  433. {
  434. DeletePVar(playerid, "editingfamhqaction");
  435. TogglePlayerControllable(playerid, false);
  436. ShowPlayerDialog(playerid,HQEXIT,DIALOG_STYLE_MSGBOX,"Warning:","Is this the exit you want?","Ok","Cancel");
  437. }
  438. else if(GetPVarInt(playerid, "editingfamhqaction") == 5)
  439. {
  440. TogglePlayerControllable(playerid, false);
  441. ShowPlayerDialog(playerid,HQENTRANCE,DIALOG_STYLE_MSGBOX,"Warning:","Is this the entrance you want?","Ok","Cancel");
  442. }
  443. else if(GetPVarInt(playerid, "editingfamhqaction") == 6)
  444. {
  445. TogglePlayerControllable(playerid, false);
  446. ShowPlayerDialog(playerid,HQEXIT,DIALOG_STYLE_MSGBOX,"Warning:","Is this the exit you want?","Ok","Cancel");
  447. }
  448.  
  449. }
  450. if(GetPVarInt(playerid, "DraggingPlayer") != INVALID_PLAYER_ID)
  451. {
  452. new Float:dX, Float:dY, Float:dZ, string[128];
  453. GetPlayerPos(playerid, dX, dY, dZ);
  454. floatsub(dX, 0.4);
  455. floatsub(dY, 0.4);
  456.  
  457. SetPVarFloat(GetPVarInt(playerid, "DraggingPlayer"), "DragX", dX);
  458. SetPVarFloat(GetPVarInt(playerid, "DraggingPlayer"), "DragY", dY);
  459. SetPVarFloat(GetPVarInt(playerid, "DraggingPlayer"), "DragZ", dZ);
  460. SetPVarInt(GetPVarInt(playerid, "DraggingPlayer"), "DragWorld", GetPlayerVirtualWorld(playerid));
  461. SetPVarInt(GetPVarInt(playerid, "DraggingPlayer"), "DragInt", GetPlayerInterior(playerid));
  462. Streamer_UpdateEx(GetPVarInt(playerid, "DraggingPlayer"), dX, dY, dZ);
  463. SetPlayerPos(GetPVarInt(playerid, "DraggingPlayer"), dX, dY, dZ);
  464. SetPlayerInterior(GetPVarInt(playerid, "DraggingPlayer"), GetPlayerInterior(playerid));
  465. SetPlayerVirtualWorld(GetPVarInt(playerid, "DraggingPlayer"), GetPlayerVirtualWorld(playerid));
  466. ClearAnimations(GetPVarInt(playerid, "DraggingPlayer"));
  467. ApplyAnimation(GetPVarInt(playerid, "DraggingPlayer"), "ped","cower",1,1,0,0,0,0,1);
  468. DeletePVar(GetPVarInt(playerid, "DraggingPlayer"), "BeingDragged");
  469. SetPVarInt(playerid, "DraggingPlayer", INVALID_PLAYER_ID);
  470. format(string, sizeof(string), "* You have stopped dragging %s.", GetPlayerNameEx(GetPVarInt(playerid, "DraggingPlayer")));
  471. SendClientMessage(playerid, COLOR_GRAD2, string);
  472. }
  473. if(GetPVarInt(playerid, "CreateGT") == 1)
  474. {
  475. if(PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pGangModerator] < 1) return SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to perform this action.");
  476. new gangtag = GetFreeGangTag();
  477. if(gangtag == -1)
  478. {
  479. DeletePVar(playerid, "CreateGT");
  480. SendClientMessageEx(playerid, COLOR_GREY, "There is no free gang tag to use!");
  481. return 1;
  482. }
  483. new Float:pPosX, Float:pPosY, Float:pPosZ, string[128];
  484. GetPlayerPos(playerid, pPosX, pPosY, pPosZ);
  485. GangTags[gangtag][gt_PosX] = pPosX;
  486. GangTags[gangtag][gt_PosY] = pPosY;
  487. GangTags[gangtag][gt_PosZ] = pPosZ;
  488. GangTags[gangtag][gt_Used] = 1;
  489. GangTags[gangtag][gt_VW] = GetPlayerVirtualWorld(playerid);
  490. GangTags[gangtag][gt_Int] = GetPlayerInterior(playerid);
  491. DeletePVar(playerid, "CreateGT");
  492. CreateGangTag(gangtag);
  493. format(string, sizeof(string), "Gangtag %d has been created, use /gtedit to edit and optimize the position!", gangtag);
  494. SendClientMessageEx(playerid, COLOR_WHITE, string);
  495. format(string, sizeof(string), "%s has created gangtag %d.", GetPlayerNameEx(playerid), gangtag);
  496. Log("Logs/GangTags.log", string);
  497. SaveGangTag(gangtag);
  498. }
  499. if(GetPVarInt(playerid, "gt_Edit") == 1)
  500. {
  501. if(PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pGangModerator] < 1) return SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to perform this action.");
  502. new gangtag = GetPVarInt(playerid, "gt_ID");
  503. new Float:pPosX, Float:pPosY, Float:pPosZ, string[128];
  504. GetPlayerPos(playerid, pPosX, pPosY, pPosZ);
  505. GangTags[gangtag][gt_PosX] = pPosX;
  506. GangTags[gangtag][gt_PosY] = pPosY;
  507. GangTags[gangtag][gt_PosZ] = pPosZ;
  508. GangTags[gangtag][gt_VW] = GetPlayerVirtualWorld(playerid);
  509. GangTags[gangtag][gt_Int] = GetPlayerInterior(playerid);
  510. DeletePVar(playerid, "gt_ID");
  511. DeletePVar(playerid, "gt_Edit");
  512. CreateGangTag(gangtag);
  513. format(string, sizeof(string), "You have changed the position of gangtag %d!", gangtag);
  514. SendClientMessageEx(playerid, COLOR_WHITE, string);
  515. format(string, sizeof(string), "%s has changed the position of gangtag %d.", GetPlayerNameEx(playerid), gangtag);
  516. Log("Logs/GangTags.log", string);
  517. SaveGangTag(gangtag);
  518. }
  519. if(GetPVarType(playerid, "gt_Spraying"))
  520. {
  521. new tagid = GetPVarInt(playerid, "gt_Spray");
  522. GangTags[tagid][gt_TimeLeft] = 0;
  523. KillTimer(GangTags[tagid][gt_Timer]);
  524. DeletePVar(playerid, "gt_Spraying");
  525. DeletePVar(playerid, "gt_Spray");
  526. SendClientMessageEx(playerid, COLOR_WHITE, "You have stopped spraying the wall.");
  527. ClearAnimations(playerid);
  528. }
  529. }
  530. else if((newkeys & KEY_SPRINT) && GetPlayerState(playerid) == 2)// Pressing the gas, detonates the bomb.
  531. {
  532. new string[128], vehicleid = GetPlayerVehicleID(playerid);
  533. if(GetChased[playerid] != INVALID_PLAYER_ID && VehicleBomb{vehicleid} == 1)
  534. {
  535. if(PlayerInfo[playerid][pHeadValue] >= 1)
  536. {
  537. if (IsAHitman(GetChased[playerid]))
  538. {
  539. new Float:boomx, Float:boomy, Float:boomz;
  540. GetPlayerPos(playerid,boomx, boomy, boomz);
  541. CreateExplosion(boomx, boomy , boomz, 7, 1);
  542. VehicleBomb{vehicleid} = 0;
  543. PlacedVehicleBomb[GetChased[playerid]] = INVALID_VEHICLE_ID;
  544. new takemoney = (PlayerInfo[playerid][pHeadValue] / 4) * 2;
  545. GivePlayerCash(GetChased[playerid], takemoney);
  546. GivePlayerCash(playerid, -takemoney);
  547. format(string,sizeof(string),"Hitman %s has fulfilled the contract on %s and collected $%d.",GetPlayerNameEx(GetChased[playerid]),GetPlayerNameEx(playerid),takemoney);
  548. SendGroupMessage(2, COLOR_YELLOW, string);
  549. format(string,sizeof(string),"You have been critically injured by a hitman and lost $%d!",takemoney);
  550. ResetPlayerWeaponsEx(playerid);
  551. SendClientMessageEx(playerid, COLOR_YELLOW, string);
  552. PlayerInfo[playerid][pHeadValue] = 0;
  553. PlayerInfo[GetChased[playerid]][pCHits] += 1;
  554. SetPlayerHealth(playerid, 0.0);
  555. GoChase[GetChased[playerid]] = INVALID_PLAYER_ID;
  556. PlayerInfo[GetChased[playerid]][pC4Used] = 0;
  557. PlayerInfo[GetChased[playerid]][pC4] = 0;
  558. GotHit[playerid] = 0;
  559. GetChased[playerid] = INVALID_PLAYER_ID;
  560. return 1;
  561. }
  562. }
  563. }
  564. }
  565. return 1;
  566. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement