Advertisement
Guest User

Gang Tester V3.0 - Final Version - Update

a guest
Jul 28th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 54.21 KB | None | 0 0
  1. Z#include <a_samp>
  2. #include <streamer>
  3. #define SPAWN 19980
  4. #define CAPTURE 19981
  5. #define LOOT 19982
  6. #define HOUSE 19983
  7. #define HEALTH 19984
  8. #define ARMOUR 19985
  9. #define MINIGUN 19986
  10. #define ROCKET 19987
  11. #define GATE 19988
  12. #define BASE 19989
  13. #define EDITGANG 19990
  14. #define GANGBASE 19991
  15. #define TELEPORTS 19992
  16. #define VEHICLES 19993
  17. #define TERRITORY 19994
  18. #define RED 0xFF0000FF
  19. //------------------------------------//
  20. new tp; // //
  21. new tp1; // //
  22. new tp2; // //
  23. new tp3; // //
  24. new tp4; // //
  25. new tp5; // TELEPORTS //
  26. new tp6; // //
  27. new tp7; // //
  28. new tp8; // //
  29. new tp9; // //
  30. new tp10; // //
  31. new Text3D:ltp; // //
  32. new Text3D:ltp1; // //
  33. new Text3D:ltp2; // //
  34. new Text3D:ltp3; // //
  35. new Text3D:ltp4; // //
  36. new Text3D:ltp5; // TELEPORT //
  37. new Text3D:ltp6; // TEXTS //
  38. new Text3D:ltp7; // //
  39. new Text3D:ltp8; // //
  40. new Text3D:ltp9; // //
  41. new Text3D:ltp10; // //
  42. new teleport0; // Create Teleport Protection #0 //
  43. new teleport1; // Create Teleport Protection #1 //
  44. new teleport2; // Create Teleport Protection #2 //
  45. new teleport3; // Create Teleport Protection #3 //
  46. new teleport4; // Create Teleport Protection #4 //
  47. new teleport5; // Create Teleport Protection #5 //
  48. new teleport6; // Create Teleport Protection #6 //
  49. new teleport7; // Create Teleport Protection #7 //
  50. new teleport8; // Create Teleport Protection #8 //
  51. new teleport9; // Create Teleport Protection #9 //
  52. new teleport10; // Create Teleport Protection #10 //
  53. //--------------------------------------------------------------//
  54. //--------------------------------------------------------------//
  55. new Float:posX; // //
  56. new Float:posY; // //
  57. new Float:posZ; // Gang //
  58. new Float:posA; // Spawn //
  59. new GangSpawn; // //
  60. //--------------------------------------------------------------//
  61. //--------------------------------------------------------------//
  62. new Float:posX0; // //
  63. new Float:posY0; // //
  64. new Float:posZ0; // Teleport //
  65. new Float:posA0; // #0 //
  66. new Teleport0; // //
  67. //--------------------------------------------------------------//
  68. //--------------------------------------------------------------//
  69. new Float:posX1; // //
  70. new Float:posY1; // //
  71. new Float:posZ1; // Teleport //
  72. new Float:posA1; // #1 //
  73. new Teleport1; // //
  74. //--------------------------------------------------------------//
  75. //--------------------------------------------------------------//
  76. new Float:posX2; // //
  77. new Float:posY2; // //
  78. new Float:posZ2; // Teleport //
  79. new Float:posA2; // #2 //
  80. new Teleport2; // //
  81. //--------------------------------------------------------------//
  82. //--------------------------------------------------------------//
  83. new Float:posX3; // //
  84. new Float:posY3; // //
  85. new Float:posZ3; // Teleport //
  86. new Float:posA3; // #3 //
  87. new Teleport3; // //
  88. //--------------------------------------------------------------//
  89. //--------------------------------------------------------------//
  90. new Float:posX4; // //
  91. new Float:posY4; // //
  92. new Float:posZ4; // Teleport //
  93. new Float:posA4; // #4 //
  94. new Teleport4; // //
  95. //--------------------------------------------------------------//
  96. //--------------------------------------------------------------//
  97. new Float:posX5; // //
  98. new Float:posY5; // //
  99. new Float:posZ5; // Teleport //
  100. new Float:posA5; // #5 //
  101. new Teleport5; // //
  102. //--------------------------------------------------------------//
  103. //--------------------------------------------------------------//
  104. new Float:posX6; // //
  105. new Float:posY6; // //
  106. new Float:posZ6; // Teleport //
  107. new Float:posA6; // #6 //
  108. new Teleport6; // //
  109. //--------------------------------------------------------------//
  110. //--------------------------------------------------------------//
  111. new Float:posX7; // //
  112. new Float:posY7; // //
  113. new Float:posZ7; // Teleport //
  114. new Float:posA7; // #7 //
  115. new Teleport7; // //
  116. //--------------------------------------------------------------//
  117. //--------------------------------------------------------------//
  118. new Float:posX8; // //
  119. new Float:posY8; // //
  120. new Float:posZ8; // Teleport //
  121. new Float:posA8; // #8 //
  122. new Teleport8; // //
  123. //--------------------------------------------------------------//
  124. //--------------------------------------------------------------//
  125. new Float:posX9; // //
  126. new Float:posY9; // //
  127. new Float:posZ9; // Teleport //
  128. new Float:posA9; // #9 //
  129. new Teleport9; // //
  130. //--------------------------------------------------------------//
  131. //--------------------------------------------------------------//
  132. new Float:posX10; // //
  133. new Float:posY10; // //
  134. new Float:posZ10; // Teleport //
  135. new Float:posA10; // #10 //
  136. new Teleport10; // //
  137. //--------------------------------------------------------------//
  138. //----------------------------------//
  139. new hp; // Health //
  140. new ar; // Pickups //
  141. new mg; // Weapon //
  142. new rk; // Pickups //
  143. new gate; // Gate Creator //
  144. new Text3D:ganggate;// Gate Text //
  145. new Text3D:thouse; // Gang House //
  146. new ghouse; // Pickup //
  147. new Text3D:textloot;// Loot //
  148. new loot; // Pickup //
  149. new capture; // Capture //
  150. new captureicon; // Icon //
  151. new Text3D:capturet;// Pickup //
  152. new capturecp; // Capture //
  153. new capturetimer; // Protection //
  154. new capturearea, bool:isincapturearea;
  155. //----------------------------------------------------------------------//
  156. //----------------------------------------------------------------------//
  157. new heal_timer[MAX_PLAYERS]; // Heal Pickups //
  158. new armour_timer[MAX_PLAYERS]; // Cooldown //
  159. new minigun_timer[MAX_PLAYERS]; // Weapons Pickups //
  160. new rocket_timer[MAX_PLAYERS]; // Cooldown //
  161. //----------------------------------------------------------------------//
  162. //----------------------------------------------------------------------//
  163. new Float:posX11; // //
  164. new Float:posY11; // //
  165. new Float:posZ11; // BASE //
  166. new Float:posA11; // //
  167. new Base; // //
  168. //--------------------------------------------------------------//
  169. //--------------------------------------------------------------//
  170. new Makingzone; // //
  171. new Float:ZMinX; // //
  172. new Float:ZMaxX; // //
  173. new Float:ZMinY; // Create //
  174. new Float:ZMaxY; // Territory //
  175. new GangZone; // //
  176. new Create; // //
  177. new Tprotection;
  178. //--------------------------------------------------------------//
  179. //--------------------------------------------------------------//
  180. public OnFilterScriptExit()
  181. {
  182. DestroyDynamicCP(tp); //--------------------------------//
  183. DestroyDynamicCP(tp1); // //
  184. DestroyDynamicCP(tp2); // //
  185. DestroyDynamicCP(tp3); // //
  186. DestroyDynamicCP(tp4); // //
  187. DestroyDynamicCP(tp5); // //
  188. DestroyDynamicCP(tp6); // //
  189. DestroyDynamicCP(tp7); // //
  190. DestroyDynamicCP(tp8); // //
  191. DestroyDynamicCP(tp9); // //
  192. DestroyDynamicCP(tp10); // //
  193. DestroyDynamic3DTextLabel(ltp); // //
  194. DestroyDynamic3DTextLabel(ltp1); // //
  195. DestroyDynamic3DTextLabel(ltp2); // //
  196. DestroyDynamic3DTextLabel(ltp3); // //
  197. DestroyDynamic3DTextLabel(ltp4); //--------------------------------//
  198. DestroyDynamic3DTextLabel(ltp5); // Destroy everythink //
  199. DestroyDynamic3DTextLabel(ltp6); // after reload //
  200. DestroyDynamic3DTextLabel(ltp7); //--------------------------------//
  201. DestroyDynamic3DTextLabel(ltp8); // //
  202. DestroyDynamic3DTextLabel(ltp9); // //
  203. DestroyDynamic3DTextLabel(ltp10); // //
  204. DestroyDynamic3DTextLabel(ganggate); // //
  205. DestroyDynamic3DTextLabel(textloot); // //
  206. DestroyDynamic3DTextLabel(thouse); // //
  207. DestroyDynamic3DTextLabel(capturet); // //
  208. DestroyDynamicPickup(hp); // //
  209. DestroyDynamicPickup(ar); // //
  210. DestroyDynamicPickup(loot); // //
  211. DestroyDynamicPickup(capture); // //
  212. DestroyDynamicPickup(ghouse); // //
  213. DestroyDynamicPickup(mg); // //
  214. DestroyDynamicPickup(rk); // //
  215. DestroyDynamicPickup(mg); // //
  216. DestroyDynamicObject(gate); // //
  217. DestroyDynamicPickup(rk); // //
  218. DestroyDynamicMapIcon(captureicon); // //
  219. GangZoneHideForAll(GangZone); //--------------------------------//
  220. return 1;
  221. }
  222. public OnPlayerSpawn(playerid)
  223. {
  224. if(GangSpawn == 0) SetPlayerPos(playerid,-2226.6367, 95.9487, 1036.0600),SetPlayerInterior(playerid, 1),SetPlayerFacingAngle(playerid, 0),SetCameraBehindPlayer(playerid),SetPlayerInterior(playerid, 0);
  225. if(GangSpawn == 1) SetPlayerPos(playerid, posX, posY, posZ+0.10),SetPlayerFacingAngle(playerid, posA),SetCameraBehindPlayer(playerid),ResetPlayerWeapons(playerid),GivePlayerWeapon(playerid,9,1),GivePlayerWeapon(playerid,24,6000),GivePlayerWeapon(playerid,26,6000),GivePlayerWeapon(playerid,32,6000),GivePlayerWeapon(playerid,31,6000),GivePlayerWeapon(playerid,34,6000);
  226. return 1;
  227. }
  228.  
  229. public OnPlayerCommandText(playerid, cmdtext[])
  230. {
  231. if (strcmp("/editgang", cmdtext, true, 10) == 0)
  232. {
  233. if(IsPlayerAdmin(playerid))
  234. {
  235. ShowPlayerDialog(playerid, EDITGANG ,DIALOG_STYLE_LIST,"{FF0000}EDIT GANG {FFFFFF}panel","{FF0000}Set Spawn\n{FF0000}Set Capture\n{FF0000}Set Gang House\n{FF0000}Set Base\n{FF0000}Set Loot\n{FF0000}Set Health\n{FF0000}Set Armour\n{FF0000}Set Minigun\n{FF0000}Set Rocket\n{FF0000}Remove Vehicles\n{FF0000}Set Vehicle\n{FF0000}Remove Teleports\n{FF0000}Set Teleport\n{FF0000}Set Territory\n{FF0000}Reload Gate","Select","Close");
  236. }
  237. else
  238. {
  239. }
  240. return 1;
  241. }
  242. if (strcmp("/base", cmdtext, true, 10) == 0)
  243. {
  244. ShowPlayerDialog(playerid, GANGBASE ,DIALOG_STYLE_LIST,"Base Teleports","{FFFF00}Gang Name","Teleport","Close");
  245. return 1;
  246. }
  247. if (strcmp("/gtloc 0", cmdtext, true, 10) == 0)
  248. {
  249. if(IsPlayerAdmin(playerid))
  250. {
  251. new string[128];
  252. if(Teleport0 > 0)return format(string, sizeof(string), "ERROR: You can use this command only once!"),SendClientMessage(playerid, 0xFF0000FF, string);
  253. GetPlayerPos(playerid, posX0, posY0, posZ0),GetPlayerFacingAngle(playerid, posA1);
  254. Teleport0 = 1;
  255. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Teleport saved!");
  256. }
  257. else
  258. {
  259. }
  260. return 1;
  261. }
  262. if (strcmp("/gtloc 1", cmdtext, true, 10) == 0)
  263. {
  264. if(IsPlayerAdmin(playerid))
  265. {
  266. new string[128];
  267. if(Teleport1 > 0)return format(string, sizeof(string), "ERROR: You can use this command only once!"),SendClientMessage(playerid, 0xFF0000FF, string);
  268. GetPlayerPos(playerid, posX1, posY1, posZ1),GetPlayerFacingAngle(playerid, posA1);
  269. Teleport1 = 1;
  270. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Teleport saved!");
  271. }
  272. else
  273. {
  274. }
  275. return 1;
  276. }
  277. if (strcmp("/gtloc 2", cmdtext, true, 10) == 0)
  278. {
  279. if(IsPlayerAdmin(playerid))
  280. {
  281. new string[128];
  282. if(Teleport2 > 0)return format(string, sizeof(string), "ERROR: You can use this command only once!"),SendClientMessage(playerid, 0xFF0000FF, string);
  283. GetPlayerPos(playerid, posX2, posY2, posZ2),GetPlayerFacingAngle(playerid, posA2);
  284. Teleport2 = 1;
  285. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Teleport saved!");
  286. }
  287. else
  288. {
  289. }
  290. return 1;
  291. }
  292. if (strcmp("/gtloc 3", cmdtext, true, 10) == 0)
  293. {
  294. if(IsPlayerAdmin(playerid))
  295. {
  296. new string[128];
  297. if(Teleport3 > 0)return format(string, sizeof(string), "ERROR: You can use this command only once!"),SendClientMessage(playerid, 0xFF0000FF, string);
  298. GetPlayerPos(playerid, posX3, posY3, posZ3),GetPlayerFacingAngle(playerid, posA3);
  299. Teleport3 = 1;
  300. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Teleport saved!");
  301. }
  302. else
  303. {
  304. }
  305. return 1;
  306. }
  307. if (strcmp("/gtloc 4", cmdtext, true, 10) == 0)
  308. {
  309. if(IsPlayerAdmin(playerid))
  310. {
  311. new string[128];
  312. if(Teleport4 > 0)return format(string, sizeof(string), "ERROR: You can use this command only once!"),SendClientMessage(playerid, 0xFF0000FF, string);
  313. GetPlayerPos(playerid, posX4, posY4, posZ4),GetPlayerFacingAngle(playerid, posA4);
  314. Teleport4 = 1;
  315. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Teleport saved!");
  316. }
  317. else
  318. {
  319. }
  320. return 1;
  321. }
  322. if (strcmp("/gtloc 5", cmdtext, true, 10) == 0)
  323. {
  324. if(IsPlayerAdmin(playerid))
  325. {
  326. new string[128];
  327. if(Teleport5 > 0)return format(string, sizeof(string), "ERROR: You can use this command only once!"),SendClientMessage(playerid, 0xFF0000FF, string);
  328. GetPlayerPos(playerid, posX5, posY5, posZ5),GetPlayerFacingAngle(playerid, posA5);
  329. Teleport5 = 1;
  330. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Teleport saved!");
  331. }
  332. else
  333. {
  334. }
  335. return 1;
  336. }
  337. if (strcmp("/gtloc 6", cmdtext, true, 10) == 0)
  338. {
  339. if(IsPlayerAdmin(playerid))
  340. {
  341. new string[128];
  342. if(Teleport6 > 0)return format(string, sizeof(string), "ERROR: You can use this command only once!"),SendClientMessage(playerid, 0xFF0000FF, string);
  343. GetPlayerPos(playerid, posX6, posY6, posZ6),GetPlayerFacingAngle(playerid, posA6);
  344. Teleport6 = 1;
  345. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Teleport saved!");
  346. }
  347. else
  348. {
  349. }
  350. return 1;
  351. }
  352. if (strcmp("/gtloc 7", cmdtext, true, 10) == 0)
  353. {
  354. if(IsPlayerAdmin(playerid))
  355. {
  356. new string[128];
  357. if(Teleport7 > 0)return format(string, sizeof(string), "ERROR: You can use this command only once!"),SendClientMessage(playerid, 0xFF0000FF, string);
  358. SetPlayerPos(playerid, posX7, posY7, posZ7),GetPlayerFacingAngle(playerid, posA7);
  359. Teleport7 = 1;
  360. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Teleport saved!");
  361. }
  362. else
  363. {
  364. }
  365. return 1;
  366. }
  367. if (strcmp("/gtloc 8", cmdtext, true, 10) == 0)
  368. {
  369. if(IsPlayerAdmin(playerid))
  370. {
  371. new string[128];
  372. if(Teleport8 > 0)return format(string, sizeof(string), "ERROR: You can use this command only once!"),SendClientMessage(playerid, 0xFF0000FF, string);
  373. GetPlayerPos(playerid, posX8, posY8, posZ8),GetPlayerFacingAngle(playerid, posA8);
  374. Teleport8 = 1;
  375. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Teleport saved!");
  376. }
  377. else
  378. {
  379. }
  380. return 1;
  381. }
  382. if (strcmp("/gtloc 9", cmdtext, true, 10) == 0)
  383. {
  384. if(IsPlayerAdmin(playerid))
  385. {
  386. new string[128];
  387. if(Teleport9 > 0)return format(string, sizeof(string), "ERROR: You can use this command only once!"),SendClientMessage(playerid, 0xFF0000FF, string);
  388. GetPlayerPos(playerid, posX9, posY9, posZ9),GetPlayerFacingAngle(playerid, posA9);
  389. Teleport9 = 1;
  390. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Teleport saved!");
  391. }
  392. else
  393. {
  394. }
  395. return 1;
  396. }
  397. if (strcmp("/gtloc 10", cmdtext, true, 10) == 0)
  398. {
  399. if(IsPlayerAdmin(playerid))
  400. {
  401. new string[128];
  402. if(Teleport10 > 0)return format(string, sizeof(string), "ERROR: You can use this command only once!"),SendClientMessage(playerid, 0xFF0000FF, string);
  403. GetPlayerPos(playerid, posX10, posY10, posZ10),GetPlayerFacingAngle(playerid, posA10);
  404. Teleport10 = 1;
  405. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Teleport saved!");
  406. }
  407. else
  408. {
  409. }
  410. return 1;
  411. }
  412. if(strcmp("/capture", cmdtext, true, 10) == 0)
  413. {
  414. if(isincapturearea) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You are not near the capture pickup!");
  415. {
  416. new name[24], string[64], string1[64];
  417. new Float:x, Float:y, Float:z;
  418. GetPlayerPos(playerid, x, y, z);
  419. GetPlayerName( playerid, name, 24 );
  420. GangZoneFlashForAll(GangZone,RED);
  421. captureicon = CreateDynamicMapIcon(x, y, z, 61, -1, -1, -1, -1, 25, MAPICON_LOCAL, -1, 0);
  422. capturecp = CreateDynamicCP(x, y, z-0.90, 8, -1, -1, -1, 25, -1, 0);
  423. format(string, sizeof(string), "~r~Capture started ~n~~y~by ~b~%s", name,GetPlayerColor(playerid));
  424. GameTextForAll(string, 5000, 3);
  425. format(string1,sizeof(string1), "Capturing by: {005AFF}%s", name);
  426. UpdateDynamic3DTextLabelText(capturet, 0xFF0000FF, string1);
  427. capturetimer = SetTimer("captured",10000,false);
  428. }
  429. return 1;
  430. }
  431. ////////////////////////////////////////////////////////////////////////////////
  432. // You have to manualy update gate direction once you add a new one everytime //
  433. ////////////////////////////////////////////////////////////////////////////////
  434. if(strcmp("/og", cmdtext, true, 10) == 0)
  435. {
  436. if(IsPlayerInRangeOfPoint(playerid, 15, 2427.0613, 1703.8450, 12.4313))
  437. {
  438. MoveDynamicObject(gate, 2427.0613, 1703.8450, 17.8860, 3, 0.0000, 0.0000, 0.0000);
  439. }
  440. else
  441. {
  442. SendClientMessage(playerid, 0xFF0000FF, "ERROR: You are not near any gate");
  443. }
  444. return 1;
  445. }
  446. if(strcmp("/cg", cmdtext, true, 10) == 0)
  447. {
  448. if(IsPlayerInRangeOfPoint(playerid, 15, 2427.0613, 1703.8450, 12.4313))
  449. {
  450. MoveDynamicObject(gate, 2427.0613, 1703.8450, 12.4313, 3, 0.0000, 0.0000, 0.0000);
  451. }
  452. else
  453. {
  454. SendClientMessage(playerid, 0xFF0000FF, "ERROR: You are not near any gate");
  455. }
  456. return 1;
  457. }
  458. return 0;
  459. }
  460. ////////////////////////////////////////////////////////////////////////////////
  461. // You have to manualy update gate direction once you add a new one everytime //
  462. ////////////////////////////////////////////////////////////////////////////////
  463. public OnPlayerPickUpDynamicPickup(playerid, pickupid)
  464. {
  465. if(pickupid == hp)
  466. {
  467. if(heal_timer[playerid] > 0)return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can heal only once every 30 seconds!");
  468. SetPlayerHealth(playerid,100),GameTextForPlayer(playerid, "~r~~h~Hp Filled", 2500, 3),heal_timer[playerid] = SetTimer("heal",30000,true);
  469. }
  470. if(pickupid == ar)
  471. {
  472. if(armour_timer[playerid] > 0)return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can heal only once every 30 seconds!");
  473. SetPlayerArmour(playerid,100),GameTextForPlayer(playerid, "~b~~h~Armour Filled", 2500, 3),armour_timer[playerid] = SetTimer("armour",30000,true);
  474. }
  475. if(pickupid == mg)
  476. {
  477. if(minigun_timer[playerid] > 0)return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can load this gun only once every 1 minute!");
  478. GivePlayerWeapon(playerid, 38, 50),GameTextForPlayer(playerid, "~g~Gun loaded", 2500, 3),minigun_timer[playerid] = SetTimer("minigun",60000,true);
  479. }
  480. if(pickupid == rk)
  481. {
  482. if(rocket_timer[playerid] > 0)return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can load this gun only once every 1 minute!");
  483. GivePlayerWeapon(playerid, 35, 10),GameTextForPlayer(playerid, "~g~Gun loaded", 2500, 3),rocket_timer[playerid] = SetTimer("rocket",60000,true);
  484. }
  485. if(pickupid == ghouse)
  486. {
  487. }
  488. if(pickupid == loot)
  489. {
  490. }
  491. if(pickupid == capture)
  492. {
  493. }
  494. return 1;
  495. }
  496. public OnPlayerEnterDynamicCP(playerid, checkpointid)
  497. {
  498. if(checkpointid == tp)
  499. {
  500. if(Teleport0 == 1)SetPlayerPos(playerid, posX0, posY0, posZ0),SetPlayerFacingAngle(playerid, posA0),SetCameraBehindPlayer(playerid),SetPlayerInterior(playerid,0);
  501. }
  502. if(checkpointid == tp1)
  503. {
  504. if(Teleport1 == 1) SetPlayerPos(playerid, posX1, posY1, posZ1),SetPlayerFacingAngle(playerid, posA1),SetCameraBehindPlayer(playerid),SetPlayerInterior(playerid,0);
  505. }
  506. if(checkpointid == tp2)
  507. {
  508. if(Teleport2 == 1)SetPlayerPos(playerid, posX2, posY2, posZ2),SetPlayerFacingAngle(playerid, posA2),SetCameraBehindPlayer(playerid),SetPlayerInterior(playerid,0);
  509. }
  510. if(checkpointid == tp3)
  511. {
  512. if(Teleport3 == 1)SetPlayerPos(playerid, posX3, posY3, posZ3),SetPlayerFacingAngle(playerid, posA3),SetCameraBehindPlayer(playerid),SetPlayerInterior(playerid,0);
  513. }
  514. if(checkpointid == tp4)
  515. {
  516. if(Teleport4 == 1)SetPlayerPos(playerid, posX4, posY4, posZ4),SetPlayerFacingAngle(playerid, posA4),SetCameraBehindPlayer(playerid),SetPlayerInterior(playerid,0);
  517. }
  518. if(checkpointid == tp5)
  519. {
  520. if(Teleport5 == 1)SetPlayerPos(playerid, posX5, posY5, posZ5),SetPlayerFacingAngle(playerid, posA5),SetCameraBehindPlayer(playerid),SetPlayerInterior(playerid,0);
  521. }
  522. if(checkpointid == tp6)
  523. {
  524. if(Teleport6 == 1)SetPlayerPos(playerid, posX6, posY6, posZ6),SetPlayerFacingAngle(playerid, posA6),SetCameraBehindPlayer(playerid),SetPlayerInterior(playerid,0);
  525. }
  526. if(checkpointid == tp7)
  527. {
  528. if(Teleport7 == 1)SetPlayerPos(playerid, posX7, posY7, posZ7),SetPlayerFacingAngle(playerid, posA7),SetCameraBehindPlayer(playerid),SetPlayerInterior(playerid,0);
  529. }
  530. if(checkpointid == tp8)
  531. {
  532. if(Teleport8 == 1)SetPlayerPos(playerid, posX8, posY8, posZ8),SetPlayerFacingAngle(playerid, posA8),SetCameraBehindPlayer(playerid),SetPlayerInterior(playerid,0);
  533. }
  534. if(checkpointid == tp9)
  535. {
  536. if(Teleport9 == 1)SetPlayerPos(playerid, posX9, posY9, posZ9),SetPlayerFacingAngle(playerid, posA9),SetCameraBehindPlayer(playerid),SetPlayerInterior(playerid,0);
  537. }
  538. if(checkpointid == tp10)
  539. {
  540. if(Teleport10 == 1)SetPlayerPos(playerid, posX10, posY10, posZ10),SetPlayerFacingAngle(playerid, posA10),SetCameraBehindPlayer(playerid),SetPlayerInterior(playerid,0);
  541. }
  542. if(checkpointid == capturecp)
  543. {
  544. }
  545. return 1;
  546. }
  547.  
  548. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  549. {
  550. if(dialogid == SPAWN)// Save Spawn //
  551. {
  552. if(response)
  553. {
  554. if(listitem == 0)//SET SPAWN
  555. {
  556. GetPlayerPos(playerid, posX, posY, posZ),GetPlayerFacingAngle(playerid, posA),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Spawn saved!"),GangSpawn = 1;
  557. }
  558. if(listitem == 1)//RESET SPAWN
  559. {
  560. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Spawn reset!"),GangSpawn = 0;
  561. }
  562. }
  563. return 1;
  564. }
  565. if(dialogid == CAPTURE)// Set Capture //
  566. {
  567. if(response)
  568. {
  569. if(listitem == 0)//SET CAPTURE
  570. {
  571. DestroyDynamicPickup(capture);
  572. DestroyDynamic3DTextLabel(capturet);
  573. DestroyDynamicArea(capturearea);
  574. new Float:x, Float:y, Float:z;
  575. GetPlayerPos(playerid, x, y, z);
  576. capture = CreateDynamicPickup(1314, 1, x, y, z, -1);
  577. capturet = CreateDynamic3DTextLabel("{FF0000}/capture", -1, x, y, z, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, -1, -1, -1);
  578. capturearea = CreateDynamicCircle(x, y, 0.50, -1, -1, -1);
  579. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Capture saved!");
  580. }
  581. if(listitem == 1)//DESTROY CAPTURE
  582. {
  583. DestroyDynamicPickup(capture);
  584. DestroyDynamic3DTextLabel(capturet);
  585. DestroyDynamicArea(capturearea);
  586. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Capture destroyed!");
  587. }
  588. }
  589. return 1;
  590. }
  591. if(dialogid == HOUSE)// Set House //
  592. {
  593. if(response)
  594. {
  595. if(listitem == 0)//SET HOUSE
  596. {
  597. DestroyDynamicPickup(ghouse);
  598. DestroyDynamic3DTextLabel(thouse);
  599. new Float:x, Float:y, Float:z;
  600. GetPlayerPos(playerid, x, y, z);
  601. ghouse = CreateDynamicPickup(1239, 1, x, y, z, -1);
  602. thouse = CreateDynamic3DTextLabel("{FFFF00}/enter\n{FFFFFF}Gang House", -1, x, y, z, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, 0);
  603. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Gang House saved!");
  604. }
  605. if(listitem == 1)//DESTROY HOUSE
  606. {
  607. DestroyDynamicPickup(ghouse);
  608. DestroyDynamic3DTextLabel(thouse);
  609. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Gang House destroyed!");
  610. }
  611. }
  612. return 1;
  613. }
  614. if(dialogid == BASE)// Set Base //
  615. {
  616. if(response)
  617. {
  618. if(listitem == 0)//SET BASE
  619. {
  620. GetPlayerPos(playerid, posX11, posY11, posZ11),GetPlayerFacingAngle(playerid, posA11),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Base saved!"),Base = 1;
  621. }
  622. if(listitem == 1)//RESET BASE
  623. {
  624. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Base reset!"),Base = 0;
  625. }
  626. }
  627. return 1;
  628. }
  629. if(dialogid == LOOT)// Set Loot //
  630. {
  631. if(response)
  632. {
  633. if(listitem == 0)//SET LOOT
  634. {
  635. DestroyDynamicPickup(loot);
  636. DestroyDynamic3DTextLabel(textloot);
  637. new Float:x, Float:y, Float:z;
  638. GetPlayerPos(playerid, x, y, z);
  639. loot = CreateDynamicPickup(1550, 1, x, y, z, -1);
  640. textloot = CreateDynamic3DTextLabel("{CC9900}Gang Loot \n{FFFFFF}Money: {FF0000}999999999{FFFFFF}, Coins: {FF0000}123456789{FFFFFF}, Gems: {FF0000}1337\n{FFFFFF}/loot", -1, x, y, z, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, 0);
  641. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Loot saved!");
  642. }
  643. if(listitem == 1)//DESTROY LOOT
  644. {
  645. DestroyDynamicPickup(loot);
  646. DestroyDynamic3DTextLabel(textloot);
  647. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Loot destroyed!");
  648. }
  649. }
  650. return 1;
  651. }
  652. if(dialogid == HEALTH)// Set Health //
  653. {
  654. if(response)
  655. {
  656. if(listitem == 0)//SET HEALTH
  657. {
  658. DestroyDynamicPickup(hp);
  659. new Float:x, Float:y, Float:z;
  660. GetPlayerPos(playerid, x, y, z);
  661. hp = CreateDynamicPickup(1240, 1, x, y, z, -1);
  662. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Health saved!");
  663. }
  664. if(listitem == 1)//DESTROY HEALTH
  665. {
  666. DestroyDynamicPickup(hp);
  667. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Health destroyed!");
  668. }
  669. }
  670. return 1;
  671. }
  672. if(dialogid == ARMOUR)// Set Armour //
  673. {
  674. if(response)
  675. {
  676. if(listitem == 0)//SET ARMOUR
  677. {
  678. DestroyDynamicPickup(ar);
  679. new Float:x, Float:y, Float:z;
  680. GetPlayerPos(playerid, x, y, z);
  681. ar = CreateDynamicPickup(1242, 1, x, y, z, -1);
  682. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Armour saved!");
  683. }
  684. if(listitem == 1)//DESTROY ARMOUR
  685. {
  686. DestroyDynamicPickup(ar);
  687. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Armour destroyed!");
  688. }
  689. }
  690. return 1;
  691. }
  692. if(dialogid == MINIGUN)// Set Minigun //
  693. {
  694. if(response)
  695. {
  696. if(listitem == 0)//SET MINIGUN
  697. {
  698. DestroyDynamicPickup(mg);
  699. new Float:x, Float:y, Float:z;
  700. GetPlayerPos(playerid, x, y, z);
  701. mg = CreateDynamicPickup(362, 1, x, y, z, -1);
  702. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Minigun saved!");
  703. }
  704. if(listitem == 1)//DESTROY MINIGUN
  705. {
  706. DestroyDynamicPickup(mg);
  707. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Minigun destroyed!");
  708. }
  709. }
  710. return 1;
  711. }
  712. if(dialogid == ROCKET)// Set Rocket //
  713. {
  714. if(response)
  715. {
  716. if(listitem == 0)//SET MINIGUN
  717. {
  718. DestroyDynamicPickup(rk);
  719. new Float:x, Float:y, Float:z;
  720. GetPlayerPos(playerid, x, y, z);
  721. rk = CreateDynamicPickup(359, 1, x, y, z, -1);
  722. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Rocket saved!");
  723. }
  724. if(listitem == 1)//DESTROY MINIGUN
  725. {
  726. DestroyDynamicPickup(rk);
  727. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Rocket destroyed!");
  728. }
  729. }
  730. return 1;
  731. }
  732. if(dialogid == GATE)// Reload Gate //
  733. {
  734. if(response)
  735. {
  736. if(listitem == 0)//RELOAD GATE
  737. {
  738. //SendClientMessage(playerid, 0xFF0000FF, "ERROR: There is no gate loaded!");
  739. DestroyDynamicObject(gate);
  740. DestroyDynamic3DTextLabel(ganggate);
  741. ganggate = CreateDynamic3DTextLabel("If you are in this gang use {FFFF00}/opengate(/og) {FFFFFF}to open gate \nand {FFFF00}/closegate(/cg) {FFFFFF}to close gate! \n{FF0000}/Blowgate", -1, 2427.06, 1703.84, 12.43, 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, 0);
  742. gate = CreateDynamicObject(980, 2427.06, 1703.84, 12.43, 0.00, 0.00, 0.00);
  743. SendClientMessage(playerid, 0x00CC3300, "SUCCES: Gate reloaded!");
  744. }
  745. if(listitem == 1)//DESTROY GATE
  746. {
  747. DestroyDynamicObject(gate);
  748. DestroyDynamic3DTextLabel(ganggate);
  749. SendClientMessage(playerid, 0x00CC3300, "SUCCES: Gate destroyed!");
  750. }
  751. }
  752. return 1;
  753. }
  754. if(dialogid == EDITGANG)
  755. {
  756. if(response)
  757. {
  758. if(listitem == 0)//GANG SPAWN
  759. {
  760. ShowPlayerDialog(playerid, SPAWN ,DIALOG_STYLE_LIST,"{FF0000}Set Spawn","{FF0000}Set Spawn\n{FF0000}Reset Spawn","Select","Close");
  761. }
  762. if(listitem == 1)//GANG CAPTURE
  763. {
  764. ShowPlayerDialog(playerid, CAPTURE ,DIALOG_STYLE_LIST,"{FF0000}Set Capture","{FF0000}Set Capture\n{FF0000}Destroy Capture","Select","Close");
  765. }
  766. if(listitem == 2)//GANG HOUSE
  767. {
  768. ShowPlayerDialog(playerid, HOUSE ,DIALOG_STYLE_LIST,"{FF0000}Set House","{FF0000}Set House\n{FF0000}Destroy House","Select","Close");
  769. }
  770. if(listitem == 3)//GANG BASE
  771. {
  772. ShowPlayerDialog(playerid, BASE ,DIALOG_STYLE_LIST,"{FF0000}Set Base","{FF0000}Set Base\n{FF0000}Reset Base","Select","Close");
  773. }
  774. if(listitem == 4)//GANG LOOT
  775. {
  776. ShowPlayerDialog(playerid, LOOT ,DIALOG_STYLE_LIST,"{FF0000}Set Loot","{FF0000}Set Loot\n{FF0000}Destroy Loot","Select","Close");
  777. }
  778. if(listitem == 5)//GANG HEALTH
  779. {
  780. ShowPlayerDialog(playerid, HEALTH ,DIALOG_STYLE_LIST,"{FF0000}Set Health","{FF0000}Set Health\n{FF0000}Destroy Health","Select","Close");
  781. }
  782. if(listitem == 6)//GANG ARMOUR
  783. {
  784. ShowPlayerDialog(playerid, ARMOUR ,DIALOG_STYLE_LIST,"{FF0000}Set Armour","{FF0000}Set Armour\n{FF0000}Destroy Armour","Select","Close");
  785. }
  786. if(listitem == 7)//GANG MINIGUN
  787. {
  788. ShowPlayerDialog(playerid, MINIGUN ,DIALOG_STYLE_LIST,"{FF0000}Set Minigun","{FF0000}Set Minigun\n{FF0000}Destroy Minigun","Select","Close");
  789. }
  790. if(listitem == 8)//GANG ROCKET
  791. {
  792. ShowPlayerDialog(playerid, ROCKET ,DIALOG_STYLE_LIST,"{FF0000}Set Rocket","{FF0000}Set Rocket\n{FF0000}Destroy Rocket","Select","Close");
  793. }
  794. if(listitem == 9)//REMOVE VEHICLES
  795. {
  796. DestroyNearbyVehicles(playerid, 250);
  797. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Vehicles removed!");
  798. }
  799. if(listitem == 10)//SET VEHICLES
  800. {
  801. if(IsPlayerInAnyVehicle(playerid))
  802. {
  803. ShowPlayerDialog(playerid, VEHICLES, DIALOG_STYLE_INPUT ,"{FF0000}Set Vehicle","Insert vehicle color bellow\n{FFFFFF}Example. carcolor1{FF0000}[colorid], {FFFFFF}carcolor2{FF0000}[colorid]","Create","Close");
  804. }
  805. else
  806. {
  807. SendClientMessage(playerid, 0xFF0000FF, "ERROR: You are not in a vehicle");
  808. }
  809. }
  810. if(listitem == 11)//REMOVE TELEPORTS
  811. {
  812. DestroyDynamicCP(tp);
  813. DestroyDynamicCP(tp1);
  814. DestroyDynamicCP(tp2);
  815. DestroyDynamicCP(tp3);
  816. DestroyDynamicCP(tp4);
  817. DestroyDynamicCP(tp5);
  818. DestroyDynamicCP(tp6);
  819. DestroyDynamicCP(tp7);
  820. DestroyDynamicCP(tp8);
  821. DestroyDynamicCP(tp9);
  822. DestroyDynamicCP(tp10);
  823. DestroyDynamic3DTextLabel(ltp);
  824. DestroyDynamic3DTextLabel(ltp1);
  825. DestroyDynamic3DTextLabel(ltp2);
  826. DestroyDynamic3DTextLabel(ltp3);
  827. DestroyDynamic3DTextLabel(ltp4);
  828. DestroyDynamic3DTextLabel(ltp5);
  829. DestroyDynamic3DTextLabel(ltp6);
  830. DestroyDynamic3DTextLabel(ltp7);
  831. DestroyDynamic3DTextLabel(ltp8);
  832. DestroyDynamic3DTextLabel(ltp9);
  833. DestroyDynamic3DTextLabel(ltp10);
  834. teleport0 = 0;
  835. teleport1 = 0;
  836. teleport2 = 0;
  837. teleport3 = 0;
  838. teleport4 = 0;
  839. teleport5 = 0;
  840. teleport6 = 0;
  841. teleport7 = 0;
  842. teleport8 = 0;
  843. teleport9 = 0;
  844. teleport10 = 0;
  845. Teleport0 = 0;
  846. Teleport1 = 0;
  847. Teleport2 = 0;
  848. Teleport3 = 0;
  849. Teleport4 = 0;
  850. Teleport5 = 0;
  851. Teleport6 = 0;
  852. Teleport7 = 0;
  853. Teleport8 = 0;
  854. Teleport9 = 0;
  855. Teleport10 = 0;
  856. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Teleports removed!");
  857. }
  858. if(listitem == 12)//SET TELEPORTS
  859. {
  860. ShowPlayerDialog(playerid, TELEPORTS ,DIALOG_STYLE_LIST ,"{FF0000}Set Teleport","{FF0000}#0\n{FF0000}#1\n{FF0000}#2\n{FF0000}#3\n{FF0000}#4\n{FF0000}#5\n{FF0000}#6\n{FF0000}#7\n{FF0000}#8\n{FF0000}#9\n{FF0000}#10","Create","Close");
  861. }
  862. if(listitem == 13)//SET TERRITORY
  863. {
  864. ShowPlayerDialog(playerid, TERRITORY, 2,"{FF0000}Set Territory List","{FF0000}Create Territory\n{FF0000}Save Territory\n{FF0000}Destroy Territory","Select","Cancel");
  865. return 1;
  866. }
  867. if(listitem == 14)//RELOAD GATE
  868. {
  869. ShowPlayerDialog(playerid, GATE ,DIALOG_STYLE_LIST,"{FF0000}Set Rocket","{FF0000}Reload Gate\n{FF0000}Destroy Gate","Select","Close");
  870. }
  871. }
  872. return 1;
  873. }
  874. if(dialogid == GANGBASE)// Save Base Teleport //
  875. {
  876. if(response)
  877. {
  878. if(Base == 1)
  879. {
  880. SetPlayerPos(playerid, posX11, posY11, posZ11),SetPlayerFacingAngle(playerid, posA11),SetPlayerInterior(playerid, 0),SetCameraBehindPlayer(playerid),GameTextForPlayer(playerid,"~g~~h~Teleported",2000,3);
  881. }
  882. else
  883. {
  884. SendClientMessage(playerid, 0xFF0000FF, "ERROR: Gang Base is not saved!");
  885. }
  886. }
  887. return 1;
  888. }
  889. if(dialogid == 1010)// Create Teleport #0 //
  890. {
  891. if(response)
  892. {
  893. if(teleport0 > 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: This teleport is already created!");
  894. new Float:x,Float:y,Float:z;
  895. GetPlayerPos(playerid,x,y,z);
  896. tp = CreateDynamicCP(x, y, z-0.90, 1, -1, -1, -1, 25, -1, 0);
  897. ltp = CreateDynamic3DTextLabel("", -1, x, y, z, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, -1, -1, -1);
  898. UpdateDynamic3DTextLabelText(ltp, -1, inputtext);
  899. SendClientMessage(playerid,0x00CC3300, "SUCCESS: Teleport createad! - Use /gtloc 0 to save teleport direction!");
  900. teleport0 = 1;
  901. }
  902. return 1;
  903. }
  904. if(dialogid == 1011)// Create Teleport #1 //
  905. {
  906. if(response)
  907. {
  908. if(teleport1 > 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: This teleport is already created!");
  909. new Float:x,Float:y,Float:z;
  910. GetPlayerPos(playerid,x,y,z);
  911. tp1 = CreateDynamicCP(x, y, z-0.90, 1, -1, -1, -1, 25, -1, 0);
  912. ltp1 = CreateDynamic3DTextLabel("", -1, x, y, z, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, -1, -1, -1);
  913. UpdateDynamic3DTextLabelText(ltp1, -1, inputtext);
  914. SendClientMessage(playerid,0x00CC3300, "SUCCESS: Teleport createad! - Use /gtloc 1 to save teleport direction!");
  915. teleport1 = 1;
  916. }
  917. return 1;
  918. }
  919. if(dialogid == 1012)// Create Teleport #2 //
  920. {
  921. if(response)
  922. {
  923. if(teleport2 > 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: This teleport is already created!");
  924. new Float:x,Float:y,Float:z;
  925. GetPlayerPos(playerid,x,y,z);
  926. tp2 = CreateDynamicCP(x, y, z-0.90, 1, -1, -1, -1, 5, -1, 0);
  927. ltp2 = CreateDynamic3DTextLabel("", -1, x, y, z, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, -1, -1, -1);
  928. UpdateDynamic3DTextLabelText(ltp2, -1, inputtext);
  929. SendClientMessage(playerid,0x00CC3300, "SUCCESS: Teleport createad! - Use /gtloc 2 to save teleport direction!");
  930. teleport2 = 1;
  931. }
  932. return 1;
  933. }
  934. if(dialogid == 1013)// Create Teleport #3 //
  935. {
  936. if(response)
  937. {
  938. if(teleport3 > 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: This teleport is already created!");
  939. new Float:x,Float:y,Float:z;
  940. GetPlayerPos(playerid,x,y,z);
  941. tp3 = CreateDynamicCP(x, y, z-0.90, 1, -1, -1, -1, 5, -1, 0);
  942. ltp3 = CreateDynamic3DTextLabel("", -1, x, y, z, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, -1, -1, -1);
  943. UpdateDynamic3DTextLabelText(ltp3, -1, inputtext);
  944. SendClientMessage(playerid,0x00CC3300, "SUCCESS: Teleport createad! - Use /gtloc 3 to save teleport direction!");
  945. teleport3 = 1;
  946. }
  947. return 1;
  948. }
  949. if(dialogid == 1014)// Create Teleport #4 //
  950. {
  951. if(response)
  952. {
  953. if(teleport4 > 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: This teleport is already created!");
  954. new Float:x,Float:y,Float:z;
  955. GetPlayerPos(playerid,x,y,z);
  956. tp4 = CreateDynamicCP(x, y, z-0.90, 1, -1, -1, -1, 5, -1, 0);
  957. ltp4 = CreateDynamic3DTextLabel("", -1, x, y, z, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, -1, -1, -1);
  958. UpdateDynamic3DTextLabelText(ltp4, -1, inputtext);
  959. SendClientMessage(playerid,0x00CC3300, "SUCCESS: Teleport createad! - Use /gtloc 4 to save teleport direction!");
  960. teleport4 = 1;
  961. }
  962. return 1;
  963. }
  964. if(dialogid == 1015)// Create Teleport #5 //
  965. {
  966. if(response)
  967. {
  968. if(teleport5 > 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: This teleport is already created!");
  969. new Float:x,Float:y,Float:z;
  970. GetPlayerPos(playerid,x,y,z);
  971. tp5 = CreateDynamicCP(x, y, z-0.90, 1, -1, -1, -1, 5, -1, 0);
  972. ltp5 = CreateDynamic3DTextLabel("", -1, x, y, z, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, -1, -1, -1);
  973. UpdateDynamic3DTextLabelText(ltp5, -1, inputtext);
  974. SendClientMessage(playerid,0x00CC3300, "SUCCESS: Teleport createad! - Use /gtloc 5 to save teleport direction!");
  975. teleport5 = 1;
  976. }
  977. return 1;
  978. }
  979. if(dialogid == 1016)// Create Teleport #6 //
  980. {
  981. if(response)
  982. {
  983. if(teleport6 > 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: This teleport is already created!");
  984. new Float:x,Float:y,Float:z;
  985. GetPlayerPos(playerid,x,y,z);
  986. tp6 = CreateDynamicCP(x, y, z-0.90, 1, -1, -1, -1, 5, -1, 0);
  987. ltp6 = CreateDynamic3DTextLabel("", -1, x, y, z, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, -1, -1, -1);
  988. UpdateDynamic3DTextLabelText(ltp6, -1, inputtext);
  989. SendClientMessage(playerid,0x00CC3300, "SUCCESS: Teleport createad! - Use /gtloc 6 to save teleport direction!");
  990. teleport6 = 1;
  991. }
  992. return 1;
  993. }
  994. if(dialogid == 1017)// Create Teleport #7 //
  995. {
  996. if(response)
  997. {
  998. if(teleport7 > 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: This teleport is already created!");
  999. new Float:x,Float:y,Float:z;
  1000. GetPlayerPos(playerid,x,y,z);
  1001. tp7 = CreateDynamicCP(x, y, z-0.90, 1, -1, -1, -1, 5, -1, 0);
  1002. ltp7 = CreateDynamic3DTextLabel("", -1, x, y, z, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, -1, -1, -1);
  1003. UpdateDynamic3DTextLabelText(ltp7, -1, inputtext);
  1004. SendClientMessage(playerid,0x00CC3300, "SUCCESS: Teleport createad! - Use /gtloc 7 to save teleport direction!");
  1005. teleport7 = 1;
  1006. }
  1007. return 1;
  1008. }
  1009. if(dialogid == 1018)// Create Teleport #8 //
  1010. {
  1011. if(response)
  1012. {
  1013. if(teleport8 > 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: This teleport is already created!");
  1014. new Float:x,Float:y,Float:z;
  1015. GetPlayerPos(playerid,x,y,z);
  1016. tp8 = CreateDynamicCP(x, y, z-0.90, 1, -1, -1, -1, 5, -1, 0);
  1017. ltp8 = CreateDynamic3DTextLabel("", -1, x, y, z, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, -1, -1, -1);
  1018. UpdateDynamic3DTextLabelText(ltp8, -1, inputtext);
  1019. SendClientMessage(playerid,0x00CC3300, "SUCCESS: Teleport createad! - Use /gtloc 8 to save teleport direction!");
  1020. teleport8 = 1;
  1021. }
  1022. return 1;
  1023. }
  1024. if(dialogid == 1019)// Create Teleport #9 //
  1025. {
  1026. if(response)
  1027. {
  1028. if(teleport9 > 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: This teleport is already created!");
  1029. new Float:x,Float:y,Float:z;
  1030. GetPlayerPos(playerid,x,y,z);
  1031. tp9 = CreateDynamicCP(x, y, z-0.90, 1, -1, -1, -1, 5, -1, 0);
  1032. ltp9 = CreateDynamic3DTextLabel("", -1, x, y, z, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, -1, -1, -1);
  1033. UpdateDynamic3DTextLabelText(ltp9, -1, inputtext);
  1034. SendClientMessage(playerid,0x00CC3300, "SUCCESS: Teleport createad! - Use /gtloc 9 to save teleport direction!");
  1035. teleport9 = 1;
  1036. }
  1037. return 1;
  1038. }
  1039. if(dialogid == 1020)// Create Teleport #10 //
  1040. {
  1041. if(response)
  1042. {
  1043. if(teleport10 > 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: This teleport is already created!");
  1044. new Float:x,Float:y,Float:z;
  1045. GetPlayerPos(playerid,x,y,z);
  1046. tp10 = CreateDynamicCP(x, y, z-0.90, 1, -1, -1, -1, 5, -1, 0);
  1047. ltp10 = CreateDynamic3DTextLabel("", -1, x, y, z, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, -1, -1, -1);
  1048. UpdateDynamic3DTextLabelText(ltp10, -1, inputtext);
  1049. SendClientMessage(playerid,0x00CC3300, "SUCCESS: Teleport createad! - Use /gtloc 10 to save teleport direction!");
  1050. teleport10 = 1;
  1051. }
  1052. return 1;
  1053. }
  1054. if(dialogid == TELEPORTS)// Teleports List //
  1055. {
  1056. if(response)
  1057. {
  1058. if(listitem == 0)// Teleport 0 - Dialog Menu //
  1059. {
  1060. ShowPlayerDialog(playerid, 1010 ,DIALOG_STYLE_INPUT,"{FF0000}Teleport Name","Insert an teleport name bellow","Create","Close");
  1061. }
  1062. if(listitem == 1)// Teleport 1 - Dialog Menu //
  1063. {
  1064. ShowPlayerDialog(playerid, 1011 ,DIALOG_STYLE_INPUT,"{FF0000}Teleport Name","Insert an teleport name bellow","Create","Close");
  1065. }
  1066. if(listitem == 2)// Teleport 2 - Dialog Menu //
  1067. {
  1068. ShowPlayerDialog(playerid, 1012 ,DIALOG_STYLE_INPUT,"{FF0000}Teleport Name","Insert an teleport name bellow","Create","Close");
  1069. }
  1070. if(listitem == 3)// Teleport 3 - Dialog Menu //
  1071. {
  1072. ShowPlayerDialog(playerid, 1013 ,DIALOG_STYLE_INPUT,"{FF0000}Teleport Name","Insert an teleport name bellow","Create","Close");
  1073. }
  1074. if(listitem == 4)// Teleport 4 - Dialog Menu //
  1075. {
  1076. ShowPlayerDialog(playerid, 1014 ,DIALOG_STYLE_INPUT,"{FF0000}Teleport Name","Insert an teleport name bellow","Create","Close");
  1077. }
  1078. if(listitem == 5)// Teleport 5 - Dialog Menu //
  1079. {
  1080. ShowPlayerDialog(playerid, 1015 ,DIALOG_STYLE_INPUT,"{FF0000}Teleport Name","Insert an teleport name bellow","Create","Close");
  1081. }
  1082. if(listitem == 6)// Teleport 6 - Dialog Menu //
  1083. {
  1084. ShowPlayerDialog(playerid, 1016 ,DIALOG_STYLE_INPUT,"{FF0000}Teleport Name","Insert an teleport name bellow","Create","Close");
  1085. }
  1086. if(listitem == 7)// Teleport 7 - Dialog Menu //
  1087. {
  1088. ShowPlayerDialog(playerid, 1017 ,DIALOG_STYLE_INPUT,"{FF0000}Teleport Name","Insert an teleport name bellow","Create","Close");
  1089. }
  1090. if(listitem == 8)// Teleport 8 - Dialog Menu //
  1091. {
  1092. ShowPlayerDialog(playerid, 1018 ,DIALOG_STYLE_INPUT,"{FF0000}Teleport Name","Insert an teleport name bellow","Create","Close");
  1093. }
  1094. if(listitem == 9)// Teleport 9 - Dialog Menu //
  1095. {
  1096. ShowPlayerDialog(playerid, 1019 ,DIALOG_STYLE_INPUT,"{FF0000}Teleport Name","Insert an teleport name bellow","Create","Close");
  1097. }
  1098. if(listitem == 10)// Teleport 10 - Dialog Menu //
  1099. {
  1100. ShowPlayerDialog(playerid, 1020 ,DIALOG_STYLE_INPUT,"{FF0000}Teleport Name","Insert an teleport name bellow","Create","Close");
  1101. }
  1102. }
  1103. return 1;
  1104. }
  1105. if(dialogid == VEHICLES)
  1106. {
  1107. if(response)
  1108. {
  1109. new CarSpawned[MAX_PLAYERS],currentveh;
  1110. new Float: Pos[4];
  1111. new vid = GetVehicleModel(GetPlayerVehicleID(playerid));
  1112. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  1113. GetPlayerFacingAngle(playerid, Pos[3]);
  1114. GetVehicleZAngle(vid,Pos[3]);
  1115. currentveh = GetPlayerVehicleID(playerid);
  1116. DestroyVehicle(currentveh);
  1117. CarSpawned[playerid] = AddStaticVehicleEx(vid, Pos[0], Pos[1], Pos[2], Pos[3], strval(inputtext),strval(inputtext), 0);
  1118. LinkVehicleToInterior(CarSpawned[playerid], 0);
  1119. SendClientMessage(playerid,0x00CC3300, "SUCCESS: Vehicle created!");
  1120. }
  1121. return 1;
  1122. }
  1123. if(dialogid == TERRITORY)
  1124. {
  1125. if(response)
  1126. {
  1127. if(listitem == 0)
  1128. {
  1129. if(Tprotection > 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You already create an territory!");
  1130. if(Makingzone == 1) return SendClientMessage(playerid,0xFF0000FF,"ERROR: You already created an zone! Remove it and try again!");
  1131. ShowPlayerDialog(playerid,1,2,"{FF0000}Territory Colors","Blue\nRed\nGreen\nPurple\nYellow\nGrey\nLightblue\nWhite\nBlack","Select","Cancel");
  1132. Makingzone = 1;
  1133. Tprotection = 1;
  1134. }
  1135. if(listitem == 1)
  1136. {
  1137. if(Makingzone == 0) return SendClientMessage(playerid,0xFF0000FF,"ERROR: Create one first and try again!");
  1138. new string[128];
  1139. KillTimer(Create);
  1140. format(string,sizeof(string),"GangZoneCreate(%f,%f,%f,%f);\r\n",ZMinX,ZMinY,ZMaxX,ZMaxY);
  1141. SendClientMessage(playerid,0x00CC3300,"SUCCESS: Territory saved!");
  1142. Makingzone = 0;
  1143. }
  1144. if(listitem == 2)
  1145. {
  1146. KillTimer(Create);
  1147. Makingzone = 0;
  1148. Tprotection = 0;
  1149. GangZoneDestroy(GangZone);
  1150. SendClientMessage(playerid,0x00CC3300,"SUCCESS: Territory destroyed!");
  1151. }
  1152. }
  1153. }
  1154. if(dialogid == 01)
  1155. {
  1156. if(response)
  1157. {
  1158. if(listitem == 0)
  1159. {
  1160. new Float:Z;
  1161. new color;
  1162. GetPlayerPos(playerid,ZMinX,ZMinY,Z);
  1163. color = 0x0000FFAA;
  1164. GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY);
  1165. GangZoneShowForAll(GangZone,color);
  1166. Create = SetTimerEx("Createzone",100,1,"ud",playerid,color);
  1167. SendClientMessage(playerid,0x00CC3300,"SUCCESS: Territory created! Now check the minimap and use /editgang to save the size of the territory!");
  1168. }
  1169. if(listitem == 1)
  1170. {
  1171. new Float:Z;
  1172. new color;
  1173. GetPlayerPos(playerid,ZMinX,ZMinY,Z);
  1174. color = 0xFF0000AA;
  1175. GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY);
  1176. GangZoneShowForAll(GangZone,color);
  1177. Create = SetTimerEx("Createzone",100,1,"ud",playerid,color);
  1178. SendClientMessage(playerid,0x00CC3300,"SUCCESS: Territory created! Now check the minimap and use /editgang to save the size of the territory!");
  1179. }
  1180. if(listitem == 2)
  1181. {
  1182. new Float:Z;
  1183. new color;
  1184. GetPlayerPos(playerid,ZMinX,ZMinY,Z);
  1185. color = 0x00FF00AA;
  1186. GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY);
  1187. GangZoneShowForAll(GangZone,color);
  1188. Create = SetTimerEx("Createzone",100,1,"ud",playerid,color);
  1189. SendClientMessage(playerid,0x00CC3300,"SUCCESS: Territory created! Now check the minimap and use /editgang to save the size of the territory!");
  1190. }
  1191. if(listitem == 3)
  1192. {
  1193. new Float:Z;
  1194. new color;
  1195. GetPlayerPos(playerid,ZMinX,ZMinY,Z);
  1196. color = 0xFF00FFAA;
  1197. GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY);
  1198. GangZoneShowForAll(GangZone,color);
  1199. Create = SetTimerEx("Createzone",100,1,"ud",playerid,color);
  1200. SendClientMessage(playerid,0x00CC3300,"SUCCESS: Territory created! Now check the minimap and use /editgang to save the size of the territory!");
  1201. }
  1202. if(listitem == 4)
  1203. {
  1204. new Float:Z;
  1205. new color;
  1206. GetPlayerPos(playerid,ZMinX,ZMinY,Z);
  1207. color = 0xFFFF00AA;
  1208. GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY);
  1209. GangZoneShowForAll(GangZone,color);
  1210. Create = SetTimerEx("Createzone",100,1,"ud",playerid,color);
  1211. SendClientMessage(playerid,0x00CC3300,"SUCCESS: Territory created! Now check the minimap and use /editgang to save the size of the territory!");
  1212. }
  1213. if(listitem == 5)
  1214. {
  1215. new Float:Z;
  1216. new color;
  1217. GetPlayerPos(playerid,ZMinX,ZMinY,Z);
  1218. color = 0x888888AA;
  1219. GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY);
  1220. GangZoneShowForAll(GangZone,color);
  1221. Create = SetTimerEx("Createzone",100,1,"ud",playerid,color);
  1222. SendClientMessage(playerid,0x00CC3300,"SUCCESS: Territory created! Now check the minimap and use /editgang to save the size of the territory!");
  1223. }
  1224. if(listitem == 6)
  1225. {
  1226. new Float:Z;
  1227. new color;
  1228. GetPlayerPos(playerid,ZMinX,ZMinY,Z);
  1229. color = 0x00FFFFAA;
  1230. GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY);
  1231. GangZoneShowForAll(GangZone,color);
  1232. Create = SetTimerEx("Createzone",100,1,"ud",playerid,color);
  1233. SendClientMessage(playerid,0x00CC3300,"SUCCESS: Territory created! Now check the minimap and use /editgang to save the size of the territory!");
  1234. }
  1235. if(listitem == 7)
  1236. {
  1237. new Float:Z;
  1238. new color;
  1239. GetPlayerPos(playerid,ZMinX,ZMinY,Z);
  1240. color = 0xFFFFFFAA;
  1241. GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY);
  1242. GangZoneShowForAll(GangZone,color);
  1243. Create = SetTimerEx("Createzone",100,1,"ud",playerid,color);
  1244. SendClientMessage(playerid,0x00CC3300,"SUCCESS: Territory created! Now check the minimap and use /editgang to save the size of the territory!");
  1245. }
  1246. if(listitem == 8)
  1247. {
  1248. new Float:Z;
  1249. new color;
  1250. GetPlayerPos(playerid,ZMinX,ZMinY,Z);
  1251. color = 0x000000AA;
  1252. GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY);
  1253. GangZoneShowForAll(GangZone,color);
  1254. Create = SetTimerEx("Createzone",100,1,"ud",playerid,color);
  1255. SendClientMessage(playerid,0x00CC3300,"SUCCESS: Territory created! Now check the minimap and use /editgang to save the size of the territory!");
  1256. }
  1257. }
  1258. else if(!response)
  1259. {
  1260. Makingzone = 0;
  1261. }
  1262. }
  1263. return 0;
  1264. }
  1265. forward Createzone(playerid,color);
  1266. public Createzone(playerid,color)
  1267. {
  1268. GangZoneHideForAll(GangZone);
  1269. GangZoneDestroy(GangZone);
  1270. new Float:Z;
  1271. GetPlayerPos(playerid,ZMaxX,ZMaxY,Z);
  1272. GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY);
  1273. GangZoneShowForAll(GangZone,color);
  1274. return 1;
  1275. }
  1276. stock IsPlayerInGangZone(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
  1277. {
  1278. new Float:xx, Float:yy, Float:zz;
  1279. GetPlayerPos(playerid, xx, yy, zz);
  1280. if (xx > minx && xx < maxx && yy > miny && yy < maxy) return 1;
  1281. return 0;
  1282. }
  1283. public OnPlayerLeaveDynamicCP(playerid, checkpointid)
  1284. {
  1285. if(checkpointid == capturecp)
  1286. {
  1287. DestroyDynamicCP(capturecp);
  1288. GangZoneStopFlashForAll(GangZone);
  1289. GameTextForPlayer(playerid, "~r~capture failed", 2500, 3);
  1290. UpdateDynamic3DTextLabelText(capturet, 0xFF0000FF, "/capture");
  1291. KillTimer(capturetimer);
  1292. DestroyDynamicMapIcon(captureicon);
  1293. }
  1294. return 1;
  1295. }
  1296. public OnPlayerEnterDynamicArea(playerid, areaid)
  1297. {
  1298. if(areaid == capturearea)
  1299. {
  1300. isincapturearea = false;
  1301. }
  1302. }
  1303. public OnPlayerLeaveDynamicArea(playerid, areaid)
  1304. {
  1305. if(areaid == capturearea)
  1306. {
  1307. isincapturearea = true;
  1308. }
  1309. }
  1310. forward heal(playerid);
  1311. public heal(playerid)
  1312. {
  1313. heal_timer[playerid] = 0;
  1314. KillTimer(heal_timer[playerid]);
  1315. return 1;
  1316. }
  1317. forward armour(playerid);
  1318. public armour(playerid)
  1319. {
  1320. armour_timer[playerid] = 0;
  1321. KillTimer(armour_timer[playerid]);
  1322. return 1;
  1323. }
  1324. forward minigun(playerid);
  1325. public minigun(playerid)
  1326. {
  1327. minigun_timer[playerid] = 0;
  1328. KillTimer(minigun_timer[playerid]);
  1329. return 1;
  1330. }
  1331. forward rocket(playerid);
  1332. public rocket(playerid)
  1333. {
  1334. rocket_timer[playerid] = 0;
  1335. KillTimer(rocket_timer[playerid]);
  1336. return 1;
  1337. }
  1338. forward captured(playerid);
  1339. public captured(playerid)
  1340. {
  1341. GangZoneShowForAll(GangZone,GetPlayerColor(playerid));
  1342. GameTextForPlayer(playerid, "~r~successfully captured!", 2500, 3);
  1343. KillTimer(capturetimer);
  1344. DestroyDynamicCP(capturecp);
  1345. UpdateDynamic3DTextLabelText(capturet, 0xFF0000FF, "/capture");
  1346. DestroyDynamicMapIcon(captureicon);
  1347. return 1;
  1348. }
  1349. stock DestroyNearbyVehicles(playerid, Float:radi)
  1350. {
  1351. new Float:x, Float:y, Float:z;
  1352. GetPlayerPos(playerid, x, y, z);
  1353. for(new i=1; i<MAX_VEHICLES; i++)
  1354. {
  1355. if(GetVehicleModel(i))
  1356. {
  1357. new Float:posx, Float:posy, Float:posz;
  1358. new Float:tempposx, Float:tempposy, Float:tempposz;
  1359. GetVehiclePos(i, posx, posy, posz);
  1360. tempposx = (posx - x);
  1361. tempposy = (posy - y);
  1362. tempposz = (posz - z);
  1363. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  1364. {
  1365. DestroyVehicle(i);
  1366. }
  1367. }
  1368. }
  1369. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement