Guest User

Gang Tester V3.2

a guest
May 22nd, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 55.48 KB | None | 0 0
  1. #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 GCMDS 19995
  19. #define SETTINGS 19996
  20. #define RED 0xFF0000FF
  21. //----------------------------------------------------------------------------//
  22. #define DIALOG_MENU 1678
  23. #define DIALOG_MOVE_SPEED 1679
  24. #define DIALOG_ROT_SPEED 1680
  25. #define DIALOG_EXPORTNAME 1681
  26. #define DIALOG_CLOSE_NEW 1682
  27. #define MOVE_SPEED 100.0
  28. #define ACCEL_RATE 0.02
  29. #define CAMERA_MODE_NONE 0
  30. #define CAMERA_MODE_FLY 1
  31. #define MOVE_FORWARD 2
  32. #define MOVE_BACK 3
  33. #define MOVE_LEFT 4
  34. #define MOVE_RIGHT 5
  35. #define MOVE_FORWARD_LEFT 6
  36. #define MOVE_FORWARD_RIGHT 7
  37. #define MOVE_BACK_LEFT 8
  38. #define MOVE_BACK_RIGHT 9
  39. #define strcpy(%0,%1) strcat((%0[0] = '\0', %0), %1)
  40. //----------------------------------------------------------------------------//
  41. const Float:fScale = 5.0;
  42. new bool:IsCreating[MAX_PLAYERS] = false;
  43. new bool:IsReSettingStart[MAX_PLAYERS] = false;
  44. new bool:IsReSettingEnd[MAX_PLAYERS] = false;
  45. new bool:SettingFirstLoc[MAX_PLAYERS] = false;
  46. new bool:SettingLastLoc[MAX_PLAYERS] = false;
  47. new bool:IsCamMoving[MAX_PLAYERS] = false;
  48. enum noclipenum{cameramode,flyobject,mode,lrold,udold,lastmove,Float:accelmul}
  49. enum Coordinates{Float:StartX,Float:StartY,Float:StartZ,Float:EndX,Float:EndY,Float:EndZ,Float:StartLookX,Float:StartLookY,Float:StartLookZ,Float:EndLookX,Float:EndLookY,Float:EndLookZ,MoveSpeed,RotSpeed}
  50. new coordInfo[MAX_PLAYERS][Coordinates],noclipdata[MAX_PLAYERS][noclipenum];
  51. //----------------------------------------------------------------------------//
  52. new Float:X; // //
  53. new Float:Y; // //
  54. new Float:Z; // //
  55. new Float:A; // //
  56. new tp; // //
  57. new tp1; // //
  58. new tp2; // //
  59. new tp3; // //
  60. new tp4; // //
  61. new Text3D:ltp; // //
  62. new Text3D:ltp1; // //
  63. new Text3D:ltp2; // //
  64. new Text3D:ltp3; // //
  65. new Text3D:ltp4; // //
  66. new teleport0; // Create Teleport Protection #0 //
  67. new teleport1; // Create Teleport Protection #1 //
  68. new teleport2; // Create Teleport Protection #2 //
  69. new teleport3; // Create Teleport Protection #3 //
  70. new teleport4; // Create Teleport Protection #4 //
  71. //--------------------------------------------------------------//
  72. //--------------------------------------------------------------//
  73. new Float:posX; // //
  74. new Float:posY; // //
  75. new Float:posZ; // Gang //
  76. new Float:posA; // Spawn //
  77. new GangSpawn; // //
  78. //--------------------------------------------------------------//
  79. //--------------------------------------------------------------//
  80. new Float:posX0; // //
  81. new Float:posY0; // //
  82. new Float:posZ0; // Teleport //
  83. new Float:posA0; // #0 //
  84. new Teleport0; // //
  85. //--------------------------------------------------------------//
  86. //--------------------------------------------------------------//
  87. new Float:posX1; // //
  88. new Float:posY1; // //
  89. new Float:posZ1; // Teleport //
  90. new Float:posA1; // #1 //
  91. new Teleport1; // //
  92. //--------------------------------------------------------------//
  93. //--------------------------------------------------------------//
  94. new Float:posX2; // //
  95. new Float:posY2; // //
  96. new Float:posZ2; // Teleport //
  97. new Float:posA2; // #2 //
  98. new Teleport2; // //
  99. //--------------------------------------------------------------//
  100. //--------------------------------------------------------------//
  101. new Float:posX3; // //
  102. new Float:posY3; // //
  103. new Float:posZ3; // Teleport //
  104. new Float:posA3; // #3 //
  105. new Teleport3; // //
  106. //--------------------------------------------------------------//
  107. //--------------------------------------------------------------//
  108. new Float:posX4; // //
  109. new Float:posY4; // //
  110. new Float:posZ4; // Teleport //
  111. new Float:posA4; // #4 //
  112. new Teleport4; // //
  113. //--------------------------------------------------------------//
  114. //--------------------------------------------------------------//
  115. new Float:posX11; // //
  116. new Float:posY11; // //
  117. new Float:posZ11; // BASE //
  118. new Float:posA11; // //
  119. new Base; // //
  120. //--------------------------------------------------------------//
  121. //--------------------------------------------------------------//
  122. new Float:posX12; // //
  123. new Float:posY12; // //
  124. new Float:posZ12; // Enter //
  125. new Float:posA12; // Ghouse //
  126. new Enter; // //
  127. new Plant; // //
  128. //--------------------------------------------------------------//
  129. //--------------------------------------------------------------//
  130. new Float:posX13; // //
  131. new Float:posY13; // //
  132. new Float:posZ13; // Exit //
  133. new Float:posA13; // Ghouse //
  134. new Exit; // //
  135. //--------------------------------------------------------------//
  136. //--------------------------------------------------------------//
  137. new Float:posX14[MAX_PLAYERS]; // //
  138. new Float:posY14[MAX_PLAYERS]; // //
  139. new Float:posZ14[MAX_PLAYERS]; // Explode //
  140. new Eplant; // //
  141. //--------------------------------------------------------------//
  142. //--------------------------------------------------------------//
  143. new Text3D:tehouse; // Gang House //
  144. new Text3D:thouse; // Gang House //
  145. new Text3D:textloot; // Loot //
  146. new Text3D:capturet; // Pickup //
  147. new Text3D:ganggate; // Gate Text //
  148. //--------------------------------------------------------------//
  149. //--------------------------------------------------------------//
  150. new bomb; // Bomb //
  151. new ebomb; // Bomb //
  152. new hp; // Health //
  153. new ar; // Pickups //
  154. new mg; // Weapon //
  155. new rk; // Pickups //
  156. new gate; // Gate //
  157. new ghouse; // Pickup //
  158. new loot; // Pickup //
  159. new capture; // Capture //
  160. new captureicon; // Icon //
  161. new capturecp; // Capture //
  162. new capturetimer; // Protection //
  163. new ghouset; // Protection //
  164. new ghousetx; // Protection //
  165. //--------------------------------------------------------------//
  166. //--------------------------------------------------------------//
  167. new lootarea, bool:isinlootarea; //Ifplayerisnearthepiokup//
  168. new capturearea, bool:isincapturearea; //Ifplayerisnearthepiokup//
  169. new ghousearea, bool:isinghousearea; //Ifplayerisnearthepiokup//
  170. new eghousearea, bool:isineghousearea; //Ifplayerisnearthepiokup//
  171. //-------------------------------------------------------------------//
  172. //-------------------------------------------------------------------//
  173. new heal_timer[MAX_PLAYERS]; // Heal Pickups //
  174. new armour_timer[MAX_PLAYERS]; // Cooldown //
  175. new minigun_timer[MAX_PLAYERS]; // Weapons Pickups //
  176. new rocket_timer[MAX_PLAYERS]; // Cooldown //
  177. //-------------------------------------------------------------------//
  178. //-------------------------------------------------------------------//
  179. new Makingzone; // //
  180. new Float:ZMinX; // //
  181. new Float:ZMaxX; // //
  182. new Float:ZMinY; // Create //
  183. new Float:ZMaxY; // Territory //
  184. new GangZone; // //
  185. new Create; // //
  186. new Tprotection; // //
  187. //------------------------------------------------------------------//
  188. forward heal(playerid);
  189. forward armour(playerid);
  190. forward minigun(playerid);
  191. forward rocket(playerid);
  192. forward captured(playerid);
  193. forward planted(playerid);
  194. forward explode(playerid);
  195. forward defuse(playerid);
  196. forward Unfreeze(playerid);
  197. forward Createzone(playerid,color);
  198.  
  199. public OnFilterScriptExit()
  200. {
  201. for(new x; x<MAX_PLAYERS; x++){if(noclipdata[x][cameramode] == CAMERA_MODE_FLY) CancelFlyMode(x);}
  202. GangZoneDestroy(GangZone);
  203. return 1;
  204. }
  205. public OnPlayerConnect(playerid)
  206. {
  207. noclipdata[playerid][cameramode] = CAMERA_MODE_NONE;noclipdata[playerid][lrold] = 0;noclipdata[playerid][udold] = 0;noclipdata[playerid][mode] = 0;noclipdata[playerid][lastmove] = 0;noclipdata[playerid][accelmul] = 0.0; coordInfo[playerid][RotSpeed] = 1000;
  208. IsCreating[playerid] = false;IsReSettingStart[playerid] = false;IsReSettingEnd[playerid] = false;SettingFirstLoc[playerid] = false;SettingLastLoc[playerid] = false;IsCamMoving[playerid] = false;coordInfo[playerid][MoveSpeed] = 1000;
  209. return 1;
  210. }
  211. public OnPlayerSpawn(playerid)
  212. {
  213. if(GangSpawn == 0) SetPlayerPos(playerid,-2226.6367, 95.9487, 1036.0600),SetPlayerInterior(playerid, 1),SetPlayerFacingAngle(playerid, 0),SetCameraBehindPlayer(playerid),SetPlayerInterior(playerid, 0),TogglePlayerControllable(playerid, false),SetTimerEx("Unfreeze", 1000, false, "i", playerid);
  214. 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),SetPlayerInterior(playerid, 1),GivePlayerWeapon(playerid,34,6000),TogglePlayerControllable(playerid, false),SetTimerEx("Unfreeze", 1000, false, "i", playerid);
  215. return 1;
  216. }
  217. public OnPlayerCommandText(playerid, cmdtext[])
  218. {
  219. if (strcmp("/gec", cmdtext, true, 10) == 0)
  220. {
  221. if(IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can't use the editor inside a vehicle!");
  222. if(IsCamMoving[playerid] == false){if(GetPVarType(playerid, "FlyMode")){CancelFlyMode(playerid);IsCreating[playerid] = false;}else FlyMode(playerid);
  223. }
  224. return 1;
  225. }
  226. if (strcmp("/editgang", cmdtext, true, 10) == 0)
  227. {
  228. if(IsPlayerAdmin(playerid))
  229. {
  230. 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}Reset Teleports\n{FF0000}Remove Teleports\n{FF0000}Set Teleport\n{FF0000}Set Territory\n{FF0000}Reload Gate","Select","Close");
  231. }
  232. else{}
  233. return 1;
  234. }
  235. if (strcmp("/base", cmdtext, true, 10) == 0)
  236. {
  237. ShowPlayerDialog(playerid, GANGBASE ,DIALOG_STYLE_LIST,"Base Teleports","{FFFF00}Gang Tester V3.2","Teleport","Close");
  238. return 1;
  239. }
  240. if(strcmp("/loot", cmdtext, true, 10) == 0)
  241. {
  242. if(isinlootarea) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You are not near the loot pickup!");
  243. {
  244. SendClientMessage(playerid, 0xFF0000FF, "ERROR: No more loot for you! Make more gang points if you want to earn more!");
  245. }
  246. return 1;
  247. }
  248. if (strcmp("/gtloc 0", cmdtext, true, 10) == 0)
  249. {
  250. if(IsPlayerAdmin(playerid))
  251. {
  252. if(Teleport0 > 0)return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can use this command only once! Remove Teleports and try again!");GetPlayerPos(playerid, posX0, posY0, posZ0),GetPlayerFacingAngle(playerid, posA1),Teleport0 = 1,SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Teleport position set");
  253. }
  254. else
  255. {
  256. }
  257. return 1;
  258. }
  259. if (strcmp("/gtloc 1", cmdtext, true, 10) == 0)
  260. {
  261. if(IsPlayerAdmin(playerid))
  262. {
  263. if(Teleport1 > 0)return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can use this command only once! Remove Teleports and try again!");GetPlayerPos(playerid, posX1, posY1, posZ1),GetPlayerFacingAngle(playerid, posA1),Teleport1 = 1,SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Teleport position set");
  264. }
  265. else
  266. {
  267. }
  268. return 1;
  269. }
  270. if (strcmp("/gtloc 2", cmdtext, true, 10) == 0)
  271. {
  272. if(IsPlayerAdmin(playerid))
  273. {
  274. if(Teleport2 > 0)return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can use this command only once! Remove Teleports and try again!");GetPlayerPos(playerid, posX2, posY2, posZ2),GetPlayerFacingAngle(playerid, posA2),Teleport2 = 1,SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Teleport position set");
  275. }
  276. else
  277. {
  278. }
  279. return 1;
  280. }
  281. if (strcmp("/gtloc 3", cmdtext, true, 10) == 0)
  282. {
  283. if(IsPlayerAdmin(playerid))
  284. {
  285. if(Teleport3 > 0)return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can use this command only once! Remove Teleports and try again!");GetPlayerPos(playerid, posX3, posY3, posZ3),GetPlayerFacingAngle(playerid, posA3),Teleport3 = 1,SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Teleport position set");
  286. }
  287. else
  288. {
  289. }
  290. return 1;
  291. }
  292. if (strcmp("/gtloc 4", cmdtext, true, 10) == 0)
  293. {
  294. if(IsPlayerAdmin(playerid))
  295. {
  296. if(Teleport4 > 0)return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can use this command only once! Remove Teleports and try again!");GetPlayerPos(playerid, posX4, posY4, posZ4),GetPlayerFacingAngle(playerid, posA4),Teleport4 = 1,SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Teleport position set");
  297. }
  298. else
  299. {
  300. }
  301. return 1;
  302. }
  303. ////////////////////////////////////////////////////////////////////////////////
  304. ////////////////////////////////////////////////////////////////////////////////
  305. ////////////////////////////////////////////////////////////////////////////////
  306. if(strcmp("/capture start", cmdtext, true, 10) == 0)
  307. {
  308. if(Makingzone > 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can't capture this gang without the territory! Try again later!");
  309. if(IsPlayerInArea(playerid, ZMinX,ZMinY,ZMaxX,ZMaxY))
  310. {
  311. new name[24], string[64], string1[64];
  312. GetPlayerPos(playerid, X, Y, Z),GetPlayerName( playerid, name, 24 ),GangZoneFlashForAll(GangZone,RED);
  313. format(string, sizeof(string), "~r~Capture started ~n~~y~by ~b~%s", name,GetPlayerColor(playerid)),GameTextForAll(string, 5000, 3),format(string1,sizeof(string1), "Capturing by: {005AFF}%s\n{FF0000}Time left: {00FF00}%d", name, capturetimer),UpdateDynamic3DTextLabelText(capturet, 0xFF0000FF, string1),capturetimer = SetTimer("captured",10000,false);
  314. SetPlayerChatBubble(playerid, "Capturing", 0xFF0000FF, 100.0, 10000);
  315. }
  316. else
  317. {
  318. SendClientMessage(playerid, 0xFF0000FF, "ERROR: You are not on a territory!");
  319. }
  320. return 1;
  321. }
  322. ////////////////////////////////////////////////////////////////////////////////
  323. ////////////////////////////////////////////////////////////////////////////////
  324. ////////////////////////////////////////////////////////////////////////////////
  325. if(strcmp("/capture", cmdtext, true, 10) == 0)
  326. {
  327. if(Makingzone > 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can't capture this gang without the territory! Try again later!");
  328. if(isincapturearea) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You are not near the capture pickup!");
  329. {
  330. new name[24], string[64], string1[64];
  331. GetPlayerPos(playerid, X, Y, Z),GetPlayerName( playerid, name, 24 ),GangZoneFlashForAll(GangZone,RED),captureicon = CreateDynamicMapIcon(X, Y, Z, 61, -1, -1, -1, -1, 25, MAPICON_LOCAL, -1, 0),capturecp = CreateDynamicCP(X, Y, Z-0.90, 8, -1, -1, -1, 25, -1, 0);
  332. format(string, sizeof(string), "~r~Capture started ~n~~y~by ~b~%s", name,GetPlayerColor(playerid)),GameTextForAll(string, 5000, 3),format(string1,sizeof(string1), "Capturing by: {005AFF}%s\n{FF0000}Time left: {00FF00}%d", name, capturetimer),UpdateDynamic3DTextLabelText(capturet, 0xFF0000FF, string1),capturetimer = SetTimer("captured",10000,false);
  333. SetPlayerChatBubble(playerid, "Capturing", 0xFF0000FF, 100.0, 10000);
  334. }
  335. return 1;
  336. }
  337. ////////////////////////////////////////////////////////////////////////////////
  338. ////////////////////////////////////////////////////////////////////////////////
  339. ////////////////////////////////////////////////////////////////////////////////
  340. if(strcmp("/enter", cmdtext, true, 10) == 0)
  341. {
  342. if(isinghousearea) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You are not near the gang house!");
  343. if(Enter == 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: House location not set!");
  344. {
  345. SetPlayerPos(playerid, posX12, posY12, posZ12),SetPlayerFacingAngle(playerid, posA12),SetCameraBehindPlayer(playerid),SetPlayerInterior(playerid,1),SetPlayerVirtualWorld(playerid, 1);
  346. }
  347. return 1;
  348. }
  349. if(strcmp("/exit", cmdtext, true, 10) == 0)
  350. {
  351. if(isineghousearea) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You are not near the gang house!");
  352. if(Exit == 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: House location not set!");
  353. {
  354. SetPlayerPos(playerid, posX13, posY13, posZ13),SetPlayerFacingAngle(playerid, posA13),SetCameraBehindPlayer(playerid),SetPlayerInterior(playerid,0),SetPlayerVirtualWorld(playerid, 0);
  355. }
  356. return 1;
  357. }
  358. ////////////////////////////////////////////////////////////////////////////////
  359. ////////////////////////////////////////////////////////////////////////////////
  360. ////////////////////////////////////////////////////////////////////////////////
  361. if(strcmp("/blowgate", cmdtext, true, 10) == 0)
  362. {
  363. if(IsPlayerInRangeOfPoint(playerid, 15, 2293.84, 2499.34, 5.57))
  364. {
  365. SetPlayerChatBubble(playerid, "Planting", 0xFF0000FF, 100.0, 10000);
  366. GameTextForPlayer(playerid, "~g~~h~Planting ~n~~r~~h~please wait", 5000, 3),ghouset = SetTimer("planted",10000,false);
  367. }
  368. else{SendClientMessage(playerid, 0xFF0000FF, "ERROR: You are not near any gate!");}
  369. return 1;
  370. }
  371. if(strcmp("/repairgate", cmdtext, true, 10) == 0)
  372. {
  373. if(IsPlayerInRangeOfPoint(playerid, 15, 2293.84, 2499.34, 5.57))
  374. {
  375. SetPlayerChatBubble(playerid, "Repairing", 0xFF0000FF, 100.0, 10000);
  376. GameTextForPlayer(playerid, "~g~~h~Repairing ~n~~r~~h~please wait", 5000, 3),ghousetx = SetTimer("defuse",10000,false);
  377. }
  378. else{SendClientMessage(playerid, 0xFF0000FF, "ERROR: You are not near any gate!");}
  379. return 1;
  380. }
  381. ////////////////////////^^Replace with the new location^^///////////////////////
  382. ////////////////////////////////////////////////////////////////////////////////
  383. ////////////////////////////////////////////////////////////////////////////////
  384. ////////////////////////////////////////////////////////////////////////////////
  385. if(strcmp("/og", cmdtext, true, 10) == 0)
  386. {
  387. if(Plant == 1) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can't use the gate when is destroyed! Use /repairgate to fix it!");
  388. if(IsPlayerInRangeOfPoint(playerid, 15, 1447.3624, 663.1961, 12.4153))
  389. {
  390. MoveDynamicObject(gate, 1447.3624, 663.1961, 6.8769, 3, 0.0000, 0.0000, 180.0000);
  391. }
  392. else
  393. {
  394. SendClientMessage(playerid, 0xFF0000FF, "ERROR: You are not near any gate!");
  395. }
  396. return 1;
  397. }
  398. ////////////////////////^^Replace with the new gate^^///////////////////////
  399. ////////////////////////////////////////////////////////////////////////////////
  400. ////////////////////////////////////////////////////////////////////////////////
  401. ////////////////////////////////////////////////////////////////////////////////
  402. if(strcmp("/cg", cmdtext, true, 10) == 0)
  403. {
  404. if(Plant == 1) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can't use the gate when is destroyed! Use /repairgate to fix it!");
  405. if(IsPlayerInRangeOfPoint(playerid, 15, 1447.3624, 663.1961, 12.4153))
  406. {
  407. MoveDynamicObject(gate, 1447.3624, 663.1961, 12.4153, 3, 0.0000, 0.0000, 180.0000);
  408. }
  409. else
  410. {
  411. SendClientMessage(playerid, 0xFF0000FF, "ERROR: You are not near any gate!");
  412. }
  413. return 1;
  414. }
  415. ////////////////////////^^Replace with the new gate^^///////////////////////
  416. ////////////////////////////////////////////////////////////////////////////////
  417. ////////////////////////////////////////////////////////////////////////////////
  418. ////////////////////////////////////////////////////////////////////////////////
  419. return 0;
  420. }
  421. public OnPlayerPickUpDynamicPickup(playerid, pickupid)
  422. {
  423. if(pickupid == hp){if(heal_timer[playerid] > 0)return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can heal only once every 30 seconds!");SetPlayerHealth(playerid,100),GameTextForPlayer(playerid, "~r~~h~Hp Filled", 2500, 3),heal_timer[playerid] = SetTimer("heal",30000,true);}
  424. if(pickupid == ar){if(armour_timer[playerid] > 0)return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can heal only once every 30 seconds!");SetPlayerArmour(playerid,100),GameTextForPlayer(playerid, "~b~~h~Armour Filled", 2500, 3),armour_timer[playerid] = SetTimer("armour",30000,true);}
  425. if(pickupid == mg){if(minigun_timer[playerid] > 0)return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can load this gun only once every 1 minute!");GivePlayerWeapon(playerid, 38, 50),GameTextForPlayer(playerid, "~g~Gun loaded", 2500, 3),minigun_timer[playerid] = SetTimer("minigun",60000,true);}
  426. if(pickupid == rk){if(rocket_timer[playerid] > 0)return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can load this gun only once every 1 minute!");GivePlayerWeapon(playerid, 35, 10),GameTextForPlayer(playerid, "~g~Gun loaded", 2500, 3),rocket_timer[playerid] = SetTimer("rocket",60000,true);}
  427. if(pickupid == ghouse){}
  428. if(pickupid == loot){}
  429. if(pickupid == capture){}
  430. if(pickupid == bomb){}
  431. return 1;
  432. }
  433. public OnPlayerEnterDynamicCP(playerid, checkpointid)
  434. {
  435. if(checkpointid == tp){if(Teleport0 == 1)SetPlayerPos(playerid, posX0, posY0, posZ0),SetPlayerFacingAngle(playerid, posA0),SetPlayerInterior(playerid,0),SetPlayerVirtualWorld(playerid, 0);}
  436. if(checkpointid == tp1){if(Teleport1 == 1) SetPlayerPos(playerid, posX1, posY1, posZ1),SetPlayerFacingAngle(playerid, posA1),SetPlayerInterior(playerid,0),SetPlayerVirtualWorld(playerid, 0);}
  437. if(checkpointid == tp2){if(Teleport2 == 1)SetPlayerPos(playerid, posX2, posY2, posZ2),SetPlayerFacingAngle(playerid, posA2),SetPlayerInterior(playerid,0),SetPlayerVirtualWorld(playerid, 0);}
  438. if(checkpointid == tp3){if(Teleport3 == 1)SetPlayerPos(playerid, posX3, posY3, posZ3),SetPlayerFacingAngle(playerid, posA3),SetPlayerInterior(playerid,0),SetPlayerVirtualWorld(playerid, 0);}
  439. if(checkpointid == tp4){if(Teleport4 == 1)SetPlayerPos(playerid, posX4, posY4, posZ4),SetPlayerFacingAngle(playerid, posA4),SetPlayerInterior(playerid,0),SetPlayerVirtualWorld(playerid, 0);}
  440. if(checkpointid == capturecp){}
  441. return 1;
  442. }
  443.  
  444. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  445. {
  446. if(dialogid == SPAWN)// Save Spawn //
  447. {
  448. if(response)
  449. {
  450. if(listitem == 0)
  451. {
  452. GetPlayerPos(playerid, posX, posY, posZ),GetPlayerFacingAngle(playerid, posA),GetPlayerInterior(playerid),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Spawn saved!"),GangSpawn = 1;
  453. }
  454. if(listitem == 1)
  455. {
  456. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Spawn reset!"),GangSpawn = 0;
  457. }
  458. }
  459. return 1;
  460. }
  461. if(dialogid == CAPTURE)// Set Capture //
  462. {
  463. if(response)
  464. {
  465. if(listitem == 0){DestroyDynamicPickup(capture),DestroyDynamic3DTextLabel(capturet),DestroyDynamicArea(capturearea);SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Capture on territory saved!");}
  466. if(listitem == 1){DestroyDynamicPickup(capture),DestroyDynamic3DTextLabel(capturet),DestroyDynamicArea(capturearea),GetPlayerPos(playerid, X, Y, Z),capture = CreateDynamicPickup(1314, 1, X, Y, Z, -1),capturet = CreateDynamic3DTextLabel("{FF0000}/capture", -1, X, Y, Z, 50.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1),capturearea = CreateDynamicCircle(X, Y, 0.50, -1, -1, -1),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Capture saved!");}
  467. if(listitem == 2){DestroyDynamicPickup(capture),DestroyDynamic3DTextLabel(capturet),DestroyDynamicArea(capturearea),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Capture destroyed!");}
  468. }
  469. return 1;
  470. }
  471. if(dialogid == HOUSE)// Set House //
  472. {
  473. if(response)
  474. {
  475. if(listitem == 0)
  476. {
  477. DestroyDynamicPickup(ghouse),DestroyDynamic3DTextLabel(thouse),GetPlayerPos(playerid, X, Y, Z),ghouse = CreateDynamicPickup(1239, 1, X, Y, Z, -1),ghousearea = CreateDynamicCircle(X, Y, 0.50, -1, -1, -1),GetPlayerPos(playerid, posX13, posY13, posZ13),GetPlayerFacingAngle(playerid, posA13),Exit = 1,SetPlayerInterior(playerid, GetPlayerInterior(playerid));
  478. thouse = CreateDynamic3DTextLabel("{FFFF00}/enter\n{FFFFFF}Gang House", -1, X, Y, Z, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, -1, -1, -1);SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Gang House saved!");
  479. }
  480. if(listitem == 1)
  481. {
  482. DestroyDynamic3DTextLabel(tehouse),GetPlayerPos(playerid, X, Y, Z),GetPlayerPos(playerid, posX12, posY12, posZ12),GetPlayerFacingAngle(playerid, posA12),Enter = 1,eghousearea = CreateDynamicCircle(X, Y, 0.50, -1, -1, -1),tehouse = CreateDynamic3DTextLabel("Type {FFCC00}/exit {FFFFFF}to exit\nfrom this gang house!", -1, X, Y, Z, 50.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Gang House Exit saved!");
  483. }
  484. if(listitem == 2){DestroyDynamicPickup(ghouse),DestroyDynamic3DTextLabel(thouse),DestroyDynamicArea(eghousearea),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Gang House destroyed!");}
  485. if(listitem == 3){DestroyDynamic3DTextLabel(tehouse),DestroyDynamicArea(ghousearea),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Gang House Exit destroyed!");}
  486. }
  487. return 1;
  488. }
  489. if(dialogid == BASE)// Set Base //
  490. {
  491. if(response)
  492. {
  493. if(listitem == 0){GetPlayerPos(playerid, posX11, posY11, posZ11),GetPlayerFacingAngle(playerid, posA11),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Base saved!"),Base = 1;}
  494. if(listitem == 1){SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Base reset!"),Base = 0;}
  495. }
  496. return 1;
  497. }
  498. if(dialogid == LOOT)// Set Loot //
  499. {
  500. if(response)
  501. {
  502. if(listitem == 0){DestroyDynamicPickup(loot),DestroyDynamic3DTextLabel(textloot),GetPlayerPos(playerid, X, Y, Z),loot = CreateDynamicPickup(1550, 1, X, Y, Z, -1),lootarea = CreateDynamicCircle(X, Y, 0.50, -1, -1, -1),textloot = CreateDynamic3DTextLabel("{CC9900}Gang Loot \n{FFFFFF}Money: {FF0000}0{FFFFFF}, Coins: {FF0000}0{FFFFFF}, Gems: {FF0000}0\n{FF0000}/loot", -1, X, Y, Z, 50.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, -1, -1, -1),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Loot saved!");}
  503. if(listitem == 1){DestroyDynamicArea(lootarea),DestroyDynamicPickup(loot),DestroyDynamic3DTextLabel(textloot),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Loot destroyed!");}
  504. }
  505. return 1;
  506. }
  507. if(dialogid == HEALTH)// Set Health //
  508. {
  509. if(response)
  510. {
  511. if(listitem == 0){DestroyDynamicPickup(hp),GetPlayerPos(playerid, X, Y, Z),hp = CreateDynamicPickup(1240, 1, X, Y, Z, 0),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Health saved!");}
  512. if(listitem == 1){DestroyDynamicPickup(hp),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Health destroyed!");}
  513. }
  514. return 1;
  515. }
  516. if(dialogid == ARMOUR)// Set Armour //
  517. {
  518. if(response)
  519. {
  520. if(listitem == 0){DestroyDynamicPickup(ar),GetPlayerPos(playerid, X, Y, Z),ar = CreateDynamicPickup(1242, 1, X, Y, Z, 0),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Armour saved!");}
  521. if(listitem == 1){DestroyDynamicPickup(ar),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Armour destroyed!");}
  522. }
  523. return 1;
  524. }
  525. if(dialogid == MINIGUN)// Set Minigun //
  526. {
  527. if(response)
  528. {
  529. if(listitem == 0){DestroyDynamicPickup(mg),GetPlayerPos(playerid, X, Y, Z),mg = CreateDynamicPickup(362, 1, X, Y, Z, -1),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Minigun saved!");}
  530. if(listitem == 1){DestroyDynamicPickup(mg),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Minigun destroyed!");}
  531. }
  532. return 1;
  533. }
  534. if(dialogid == ROCKET)// Set Rocket //
  535. {
  536. if(response)
  537. {
  538. if(listitem == 0){DestroyDynamicPickup(rk),GetPlayerPos(playerid, X, Y, Z),rk = CreateDynamicPickup(359, 1, X, Y, Z, -1),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Rocket saved!");}
  539. if(listitem == 1){DestroyDynamicPickup(rk),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Rocket destroyed!");}
  540. }
  541. return 1;
  542. }
  543. if(dialogid == GATE)// Reload Gate //
  544. {
  545. if(response)
  546. {
  547. if(listitem == 0){SetPlayerPos(playerid,1447.3624, 663.1961, 12.4153);}
  548. if(listitem == 1)
  549. {
  550. //SendClientMessage(playerid, 0xFF0000FF, "ERROR: There is no gate loaded!");
  551. DestroyDynamicObject(gate),DestroyDynamic3DTextLabel(ganggate),SendClientMessage(playerid, 0x00CC3300, "SUCCES: Gate reloaded!");
  552. 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, 1447.3624, 663.1961, 12.4153, 50.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, 0);
  553. gate = CreateDynamicObject(980, 1447.3624, 663.1961, 12.4153, 0.00, 0.00, 180.00);
  554. }
  555. if(listitem == 2){DestroyDynamicObject(gate),DestroyDynamic3DTextLabel(ganggate),SendClientMessage(playerid, 0x00CC3300, "SUCCES: Gate destroyed!");}
  556. }
  557. return 1;
  558. }
  559. if(dialogid == EDITGANG)
  560. {
  561. if(response)
  562. {
  563. if(listitem == 0)//GANG SPAWN
  564. {
  565. ShowPlayerDialog(playerid, SPAWN ,DIALOG_STYLE_LIST,"{FF0000}Set Spawn","{FF0000}Set Spawn\n{FF0000}Reset Spawn","Select","Close");
  566. }
  567. if(listitem == 1)//GANG CAPTURE
  568. {
  569. ShowPlayerDialog(playerid, CAPTURE ,DIALOG_STYLE_LIST,"{FF0000}Set Capture","{FF0000}Set Capture on Territory\n{FF0000}Set Capture\n{FF0000}Destroy Capture","Select","Close");
  570. }
  571. if(listitem == 2)//GANG HOUSE
  572. {
  573. ShowPlayerDialog(playerid, HOUSE ,DIALOG_STYLE_LIST,"{FF0000}Set Gang House","{FF0000}Set Gang House\n{FF0000}Set Gang House Exit\n{FF0000}Destroy Gang House\n{FF0000}Destroy Gang House Exit","Select","Close");
  574. }
  575. if(listitem == 3)//GANG BASE
  576. {
  577. ShowPlayerDialog(playerid, BASE ,DIALOG_STYLE_LIST,"{FF0000}Set Base","{FF0000}Set Base\n{FF0000}Reset Base","Select","Close");
  578. }
  579. if(listitem == 4)//GANG LOOT
  580. {
  581. ShowPlayerDialog(playerid, LOOT ,DIALOG_STYLE_LIST,"{FF0000}Set Loot","{FF0000}Set Loot\n{FF0000}Destroy Loot","Select","Close");
  582. }
  583. if(listitem == 5)//GANG HEALTH
  584. {
  585. ShowPlayerDialog(playerid, HEALTH ,DIALOG_STYLE_LIST,"{FF0000}Set Health","{FF0000}Set Health\n{FF0000}Destroy Health","Select","Close");
  586. }
  587. if(listitem == 6)//GANG ARMOUR
  588. {
  589. ShowPlayerDialog(playerid, ARMOUR ,DIALOG_STYLE_LIST,"{FF0000}Set Armour","{FF0000}Set Armour\n{FF0000}Destroy Armour","Select","Close");
  590. }
  591. if(listitem == 7)//GANG MINIGUN
  592. {
  593. ShowPlayerDialog(playerid, MINIGUN ,DIALOG_STYLE_LIST,"{FF0000}Set Minigun","{FF0000}Set Minigun\n{FF0000}Destroy Minigun","Select","Close");
  594. }
  595. if(listitem == 8)//GANG ROCKET
  596. {
  597. ShowPlayerDialog(playerid, ROCKET ,DIALOG_STYLE_LIST,"{FF0000}Set Rocket","{FF0000}Set Rocket\n{FF0000}Destroy Rocket","Select","Close");
  598. }
  599. if(listitem == 9)//REMOVE VEHICLES
  600. {
  601. DestroyNearbyVehicles(playerid, 250);SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Vehicles removed!");
  602. }
  603. if(listitem == 10)//SET VEHICLES
  604. {
  605. if(IsPlayerInAnyVehicle(playerid))
  606. {
  607. 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");
  608. }
  609. else
  610. {
  611. SendClientMessage(playerid, 0xFF0000FF, "ERROR: You are not in a vehicle");
  612. }
  613. }
  614. if(listitem == 11)//RESET TELEPORTS
  615. {
  616. if(IsPlayerAdmin(playerid)){Teleport0 = 0,Teleport1 = 0,Teleport2 = 0,Teleport3 = 0,Teleport4 = 0,GameTextForPlayer(playerid, "~g~~h~Successfully!", 5000, 3);}else{}
  617. }
  618. if(listitem == 12)//REMOVE TELEPORTS
  619. {
  620. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Teleports removed!"),DestroyDynamicCP(tp),DestroyDynamicCP(tp1),DestroyDynamicCP(tp2),DestroyDynamicCP(tp3),DestroyDynamicCP(tp4);
  621. DestroyDynamic3DTextLabel(ltp),DestroyDynamic3DTextLabel(ltp1),DestroyDynamic3DTextLabel(ltp2),DestroyDynamic3DTextLabel(ltp3),DestroyDynamic3DTextLabel(ltp4);
  622. teleport0 = 0,teleport1 = 0,teleport2 = 0,teleport3 = 0,teleport4 = 0,Teleport0 = 0,Teleport1 = 0,Teleport2 = 0,Teleport3 = 0,Teleport4 = 0;
  623. }
  624. if(listitem == 13)//SET TELEPORTS
  625. {
  626. ShowPlayerDialog(playerid, TELEPORTS ,DIALOG_STYLE_LIST ,"{FF0000}Set Teleport","{FF0000}1)\n{FF0000}2)\n{FF0000}3)\n{FF0000}4)\n{FF0000}5)","Create","Close");
  627. }
  628. if(listitem == 14)//SET TERRITORY
  629. {
  630. ShowPlayerDialog(playerid, TERRITORY, DIALOG_STYLE_LIST,"{FF0000}Set Territory List","{FF0000}Create Territory\n{FF0000}Save Territory\n{FF0000}Destroy Territory","Select","Cancel");
  631. return 1;
  632. }
  633. if(listitem == 15)//RELOAD GATE
  634. {
  635. if(teleport0 > 0) ShowPlayerDialog(playerid, 1011 ,DIALOG_STYLE_INPUT,"{FF0000}Teleport Name","\t{CCCCFF}Insert an teleport name bellow\n{FF0000}Hint: {CCCCFF}You can use hexcolor to add color to the text!","Create","Close");
  636. ShowPlayerDialog(playerid, GATE ,DIALOG_STYLE_LIST,"{FF0000}Set Gate","{FF0000}Goto Gate\n{FF0000}Reload Gate\n{FF0000}Destroy Gate","Select","Close");
  637. ////////////////////////^^Replace with the new gate^^///////////////////////
  638. }
  639. }
  640. return 1;
  641. }
  642. if(dialogid == GANGBASE)// Save Base Teleport //
  643. {
  644. if(response)
  645. {
  646. if(Base == 1){SetPlayerPos(playerid, posX11, posY11, posZ11),SetPlayerFacingAngle(playerid, posA11),SetPlayerInterior(playerid, 0),SetCameraBehindPlayer(playerid),GameTextForPlayer(playerid,"~g~~h~Teleported to Base",2000,3);}
  647. else{SendClientMessage(playerid, 0xFF0000FF, "ERROR: Gang Base is not created!");}
  648. }
  649. return 1;
  650. }
  651. if(dialogid == 1010)// Create Teleport #1 //
  652. {
  653. if(response)
  654. {
  655. if(teleport0 > 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: This teleport is already created!");GetPlayerPos(playerid,X,Y,Z);tp = CreateDynamicCP(X, Y, Z-0.90, 1, -1, -1, -1, 1, -1, 0);ltp = CreateDynamic3DTextLabel("", -1, X,Y,Z, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, -1, -1, -1);UpdateDynamic3DTextLabelText(ltp, -1, inputtext);SendClientMessage(playerid,0x00CC3300, "SUCCESS: Teleport created successfully! Now, use command /gtloc 0 to save teleport location!");teleport0 = 1;
  656. }
  657. return 1;
  658. }
  659. if(dialogid == 1011)// Create Teleport #1 //
  660. {
  661. if(response)
  662. {
  663. if(teleport1 > 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: This teleport is already created!");GetPlayerPos(playerid,X,Y,Z),tp1 = CreateDynamicCP(X,Y,Z-0.90, 1, -1, -1, -1, 1, -1, 0),ltp1 = CreateDynamic3DTextLabel("", -1, X,Y,Z, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, -1, -1, -1),UpdateDynamic3DTextLabelText(ltp1, -1, inputtext),SendClientMessage(playerid,0x00CC3300, "SUCCESS: Teleport created successfully! Now, use command /gtloc 1 to save teleport location!"),teleport1 = 1;
  664. }
  665. return 1;
  666. }
  667. if(dialogid == 1012)// Create Teleport #2 //
  668. {
  669. if(response)
  670. {
  671. if(teleport2 > 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: This teleport is already created!");GetPlayerPos(playerid,X,Y,Z),tp2 = CreateDynamicCP(X,Y,Z-0.90, 1, -1, -1, -1, 1, -1, 0),ltp2 = CreateDynamic3DTextLabel("", -1, X,Y,Z, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, -1, -1, -1),UpdateDynamic3DTextLabelText(ltp2, -1, inputtext),SendClientMessage(playerid,0x00CC3300, "SUCCESS: Teleport created successfully! Now, use command /gtloc 2 to save teleport location!"),teleport2 = 1;
  672. }
  673. return 1;
  674. }
  675. if(dialogid == 1013)// Create Teleport #3 //
  676. {
  677. if(response)
  678. {
  679. if(teleport3 > 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: This teleport is already created!");GetPlayerPos(playerid,X, Y, Z),tp3 = CreateDynamicCP(X, Y, Z-0.90, 1, -1, -1, -1, 1, -1, 0),ltp3 = CreateDynamic3DTextLabel("", -1, X, Y, Z, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, -1, -1, -1),UpdateDynamic3DTextLabelText(ltp3, -1, inputtext),SendClientMessage(playerid,0x00CC3300, "SUCCESS: Teleport created successfully! Now, use command /gtloc 3 to save teleport location!"),teleport3 = 1;
  680. }
  681. return 1;
  682. }
  683. if(dialogid == 1014)// Create Teleport #4 //
  684. {
  685. if(response)
  686. {
  687. if(teleport4 > 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: This teleport is already created!");GetPlayerPos(playerid,X,Y,Z),tp4 = CreateDynamicCP(X,Y,Z-0.90, 1, -1, -1, -1, 1, -1, 0),ltp4 = CreateDynamic3DTextLabel("", -1, X,Y,Z, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, -1, -1, -1),UpdateDynamic3DTextLabelText(ltp4, -1, inputtext),SendClientMessage(playerid,0x00CC3300, "SUCCESS: Teleport created successfully! Now, use command /gtloc 4 to save teleport location!"),teleport4 = 1;
  688. }
  689. return 1;
  690. }
  691. if(dialogid == TELEPORTS)// Teleports List //
  692. {
  693. if(response)
  694. {
  695. if(listitem == 0)// Teleport 0 - Dialog Menu //
  696. {
  697. ShowPlayerDialog(playerid, 1010 ,DIALOG_STYLE_INPUT,"{FF0000}Teleport Name","Insert an teleport name bellow","Create","Close");
  698. }
  699. if(listitem == 1)// Teleport 1 - Dialog Menu //
  700. {
  701. ShowPlayerDialog(playerid, 1011 ,DIALOG_STYLE_INPUT,"{FF0000}Teleport Name","Insert an teleport name bellow","Create","Close");
  702. }
  703. if(listitem == 2)// Teleport 2 - Dialog Menu //
  704. {
  705. ShowPlayerDialog(playerid, 1012 ,DIALOG_STYLE_INPUT,"{FF0000}Teleport Name","Insert an teleport name bellow","Create","Close");
  706. }
  707. if(listitem == 3)// Teleport 3 - Dialog Menu //
  708. {
  709. ShowPlayerDialog(playerid, 1013 ,DIALOG_STYLE_INPUT,"{FF0000}Teleport Name","Insert an teleport name bellow","Create","Close");
  710. }
  711. if(listitem == 4)// Teleport 4 - Dialog Menu //
  712. {
  713. ShowPlayerDialog(playerid, 1014 ,DIALOG_STYLE_INPUT,"{FF0000}Teleport Name","Insert an teleport name bellow","Create","Close");
  714. }
  715. }
  716. return 1;
  717. }
  718. if(dialogid == VEHICLES)
  719. {
  720. if(response)
  721. {
  722. new CarSpawned[MAX_PLAYERS],currentveh;new vid = GetVehicleModel(GetPlayerVehicleID(playerid));GetPlayerPos(playerid, X, Y, Z),GetPlayerFacingAngle(playerid, A),currentveh = GetPlayerVehicleID(playerid),DestroyVehicle(currentveh),CarSpawned[playerid] = AddStaticVehicleEx(vid, X, Y, Z, A, strval(inputtext),strval(inputtext), 0),SetVehicleZAngle(currentveh, A),LinkVehicleToInterior(CarSpawned[playerid], 0),SendClientMessage(playerid,0x00CC3300, "SUCCESS: Vehicle created!");
  723. }
  724. return 1;
  725. }
  726. if(dialogid == TERRITORY)
  727. {
  728. if(response)
  729. {
  730. if(listitem == 0)
  731. {
  732. if(Tprotection > 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You already create an territory!");if(Makingzone == 1) return SendClientMessage(playerid,0xFF0000FF,"ERROR: You already created an zone! Remove it and try again!");ShowPlayerDialog(playerid,1,2,"{FF0000}Territory Colors","Blue\nRed\nGreen\nPurple\nYellow\nGrey\nLightblue\nWhite\nBlack","Select","Cancel"),Makingzone = 1,Tprotection = 1;
  733. }
  734. if(listitem == 1)
  735. {
  736. new string[128];if(Makingzone == 0) return SendClientMessage(playerid,0xFF0000FF,"ERROR: Create one first and try again!");KillTimer(Create),format(string,sizeof(string),"GangZoneCreate(%f,%f,%f,%f);\r\n",ZMinX,ZMinY,ZMaxX,ZMaxY),SendClientMessage(playerid,0x00CC3300,"SUCCESS: Territory saved!"),Makingzone = 0;
  737. }
  738. if(listitem == 2)
  739. {
  740. KillTimer(Create),Makingzone = 0,Tprotection = 0,GangZoneDestroy(GangZone),SendClientMessage(playerid,0x00CC3300,"SUCCESS: Territory destroyed!");
  741. }
  742. }
  743. }
  744. if(dialogid == 01)
  745. {
  746. if(response)
  747. {
  748. if(listitem == 0)
  749. {
  750. new color;GetPlayerPos(playerid,ZMinX,ZMinY,Z),color = 0x0000FFAA,GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY),GangZoneShowForAll(GangZone,color),Create = SetTimerEx("Createzone",100,1,"ud",playerid,color),SendClientMessage(playerid,0x00CC3300,"SUCCESS: Territory created! Now check the minimap and use /editgang to save the size of the territory!");
  751. }
  752. if(listitem == 1)
  753. {
  754. new color;GetPlayerPos(playerid,ZMinX,ZMinY,Z),color = 0xFF0000AA,GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY),GangZoneShowForAll(GangZone,color),Create = SetTimerEx("Createzone",100,1,"ud",playerid,color),SendClientMessage(playerid,0x00CC3300,"SUCCESS: Territory created! Now check the minimap and use /editgang to save the size of the territory!");
  755. }
  756. if(listitem == 2)
  757. {
  758. new color;GetPlayerPos(playerid,ZMinX,ZMinY,Z),color = 0x00FF00AA,GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY),GangZoneShowForAll(GangZone,color),Create = SetTimerEx("Createzone",100,1,"ud",playerid,color),SendClientMessage(playerid,0x00CC3300,"SUCCESS: Territory created! Now check the minimap and use /editgang to save the size of the territory!");
  759. }
  760. if(listitem == 3)
  761. {
  762. new color;GetPlayerPos(playerid,ZMinX,ZMinY,Z),color = 0xFF00FFAA,GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY),GangZoneShowForAll(GangZone,color),Create = SetTimerEx("Createzone",100,1,"ud",playerid,color),SendClientMessage(playerid,0x00CC3300,"SUCCESS: Territory created! Now check the minimap and use /editgang to save the size of the territory!");
  763. }
  764. if(listitem == 4)
  765. {
  766. new color;GetPlayerPos(playerid,ZMinX,ZMinY,Z),color = 0xFFFF00AA,GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY),GangZoneShowForAll(GangZone,color),Create = SetTimerEx("Createzone",100,1,"ud",playerid,color),SendClientMessage(playerid,0x00CC3300,"SUCCESS: Territory created! Now check the minimap and use /editgang to save the size of the territory!");
  767. }
  768. if(listitem == 5)
  769. {
  770. new color;GetPlayerPos(playerid,ZMinX,ZMinY,Z),color = 0x888888AA,GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY),GangZoneShowForAll(GangZone,color),Create = SetTimerEx("Createzone",100,1,"ud",playerid,color),SendClientMessage(playerid,0x00CC3300,"SUCCESS: Territory created! Now check the minimap and use /editgang to save the size of the territory!");
  771. }
  772. if(listitem == 6)
  773. {
  774. new color;GetPlayerPos(playerid,ZMinX,ZMinY,Z),color = 0x00FFFFAA,GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY),GangZoneShowForAll(GangZone,color),Create = SetTimerEx("Createzone",100,1,"ud",playerid,color),SendClientMessage(playerid,0x00CC3300,"SUCCESS: Territory created! Now check the minimap and use /editgang to save the size of the territory!");
  775. }
  776. if(listitem == 7)
  777. {
  778. new color;GetPlayerPos(playerid,ZMinX,ZMinY,Z),color = 0xFFFFFFAA,GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY),GangZoneShowForAll(GangZone,color),Create = SetTimerEx("Createzone",100,1,"ud",playerid,color),SendClientMessage(playerid,0x00CC3300,"SUCCESS: Territory created! Now check the minimap and use /editgang to save the size of the territory!");
  779. }
  780. if(listitem == 8)
  781. {
  782. new color;GetPlayerPos(playerid,ZMinX,ZMinY,Z),color = 0x000000AA,GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY),GangZoneShowForAll(GangZone,color),Create = SetTimerEx("Createzone",100,1,"ud",playerid,color),SendClientMessage(playerid,0x00CC3300,"SUCCESS: Territory created! Now check the minimap and use /editgang to save the size of the territory!");
  783. }
  784. }
  785. else if(!response){Makingzone = 0;}
  786. }
  787. return 0;
  788. }
  789. public Createzone(playerid,color)
  790. {
  791. GangZoneHideForAll(GangZone),GangZoneDestroy(GangZone),GetPlayerPos(playerid,ZMaxX,ZMaxY,Z),GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY),GangZoneShowForAll(GangZone,color);
  792. return 1;
  793. }
  794. public OnPlayerLeaveDynamicCP(playerid, checkpointid)
  795. {
  796. if(checkpointid == capturecp){DestroyDynamicCP(capturecp),GangZoneStopFlashForAll(GangZone),GameTextForPlayer(playerid, "~r~capture failed", 2500, 3),UpdateDynamic3DTextLabelText(capturet, 0xFF0000FF, "/capture"),KillTimer(capturetimer),DestroyDynamicMapIcon(captureicon);}
  797. return 1;
  798. }
  799. public OnPlayerEnterDynamicArea(playerid, areaid)
  800. {
  801. ////////////////////////////////////////////////////////////////////////////
  802. if(areaid == lootarea){isinlootarea = false;}
  803. ////////////////////////////////////////////////////////////////////////////
  804. if(areaid == capturearea){isincapturearea = false;}
  805. ////////////////////////////////////////////////////////////////////////////
  806. if(areaid == ghousearea){isinghousearea = false,KillTimer(ghouset),KillTimer(ghousetx);}
  807. ////////////////////////////////////////////////////////////////////////////
  808. if(areaid == eghousearea){isineghousearea = false;}
  809. ////////////////////////////////////////////////////////////////////////////
  810. }
  811. public OnPlayerLeaveDynamicArea(playerid, areaid)
  812. {
  813. ////////////////////////////////////////////////////////////////////////////
  814. if(areaid == lootarea){isinlootarea = true;}
  815. ////////////////////////////////////////////////////////////////////////////
  816. if(areaid == capturearea){isincapturearea = true;}
  817. ////////////////////////////////////////////////////////////////////////////
  818. if(areaid == ghousearea){isinghousearea = true;}
  819. ////////////////////////////////////////////////////////////////////////////
  820. if(areaid == eghousearea){isineghousearea = true;}
  821. ////////////////////////////////////////////////////////////////////////////
  822. }
  823. public captured(playerid)
  824. {
  825. GangZoneShowForAll(GangZone,GetPlayerColor(playerid)),GameTextForPlayer(playerid, "~r~successfully captured!", 2500, 3),KillTimer(capturetimer),DestroyDynamicCP(capturecp),UpdateDynamic3DTextLabelText(capturet, 0xFF0000FF, "/capture"),DestroyDynamicMapIcon(captureicon);
  826. return 1;
  827. }
  828. public planted(playerid)
  829. {
  830. if(Eplant == 1){}GetPlayerPos(playerid, posX14[playerid], posY14[playerid], posZ14[playerid]),GameTextForPlayer(playerid, "~g~~h~planted!", 2500, 3),bomb = CreateDynamicPickup(1654, 1, posX14[playerid], posY14[playerid], posZ14[playerid], -1),KillTimer(ghouset),ebomb = SetTimer("explode",3000,false),Eplant = 1;
  831. }
  832. public explode(playerid)
  833. {
  834. new string[ 64 ];DestroyDynamicPickup(bomb),CreateExplosion(posX14[playerid], posY14[playerid], posZ14[playerid], 6, 5.0),KillTimer(ebomb),Plant = 1,DestroyDynamicObject(gate),UpdateDynamic3DTextLabelText(ganggate, -1, "If you are in this gang use {FFFF00}/opengate(/og) {FFFFFF}to open gate \nand {FFFF00}/closegate(/cg) {FFFFFF}to close gate! \n{FF0000}/Repairgate"),format( string, sizeof(string), "~r~Your gang gate was destroyed!"),GameTextForPlayer(playerid,string, 5000, 3);
  835. }
  836. public defuse(playerid)
  837. {
  838. new string[128];Plant = 0,KillTimer(ghousetx),UpdateDynamic3DTextLabelText(ganggate, -1, "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"),format( string, sizeof(string), "~g~~h~repaired!"),GameTextForPlayer(playerid,string, 5000, 3);
  839. gate = CreateDynamicObject(980, 1447.3624, 663.1961, 12.4153, 0.00, 0.00, 180.00);
  840. ////////////////////////^^Replace with the new gate^^///////////////////////
  841. }
  842. ////////////////////////////////////////////////////////////////////////////////
  843. public OnPlayerUpdate(playerid)
  844. {
  845. if(noclipdata[playerid][cameramode] == CAMERA_MODE_FLY)
  846. {
  847. new keys,ud,lr;
  848. GetPlayerKeys(playerid,keys,ud,lr);
  849. if(noclipdata[playerid][mode] && (GetTickCount() - noclipdata[playerid][lastmove] > 100))
  850. {MoveCamera(playerid);}
  851. if(noclipdata[playerid][udold] != ud || noclipdata[playerid][lrold] != lr)
  852. {
  853. if((noclipdata[playerid][udold] != 0 || noclipdata[playerid][lrold] != 0) && ud == 0 && lr == 0){StopPlayerObject(playerid, noclipdata[playerid][flyobject]);noclipdata[playerid][mode] = 0;noclipdata[playerid][accelmul] = 0.0;
  854. }
  855. else{noclipdata[playerid][mode] = GetMoveDirectionFromKeys(ud, lr);MoveCamera(playerid);
  856. }
  857. }
  858. noclipdata[playerid][udold] = ud; noclipdata[playerid][lrold] = lr;
  859. return 0;
  860. }
  861. return 1;
  862. }
  863. ////////////////////////////////////////////////////////////////////////////////
  864. public heal(playerid){heal_timer[playerid] = 0,KillTimer(heal_timer[playerid]);return 1;}
  865. public armour(playerid){armour_timer[playerid] = 0,KillTimer(armour_timer[playerid]);return 1;}
  866. public minigun(playerid){minigun_timer[playerid] = 0,KillTimer(minigun_timer[playerid]);return 1;}
  867. public rocket(playerid){rocket_timer[playerid] = 0,KillTimer(rocket_timer[playerid]);return 1;}
  868. public Unfreeze(playerid){TogglePlayerControllable(playerid, true);return 1;}
  869. stock MoveCamera(playerid)
  870. {
  871. new Float:speed = MOVE_SPEED * noclipdata[playerid][accelmul], Float:x, Float:y, Float:z, Float:FV[3], Float:CP[3];GetPlayerCameraPos(playerid, CP[0], CP[1], CP[2]);GetPlayerCameraFrontVector(playerid, FV[0], FV[1], FV[2]);if(noclipdata[playerid][accelmul] <= 1) noclipdata[playerid][accelmul] += ACCEL_RATE;GetNextCameraPosition(noclipdata[playerid][mode], CP, FV, x, y, z);MovePlayerObject(playerid, noclipdata[playerid][flyobject], x, y, z, speed);noclipdata[playerid][lastmove] = GetTickCount();return 1;
  872. }
  873. stock FlyMode(playerid)
  874. {
  875. new Float:x, Float:y, Float:z;IsCreating[playerid] = true;SettingFirstLoc[playerid] = true;GetPlayerPos(playerid, x, y, z);noclipdata[playerid][flyobject] = CreatePlayerObject(playerid, 19300, x, y, z, 0.0, 0.0, 0.0);TogglePlayerSpectating(playerid, true);AttachCameraToPlayerObject(playerid, noclipdata[playerid][flyobject]);SetPVarInt(playerid, "FlyMode", 1);noclipdata[playerid][cameramode] = CAMERA_MODE_FLY;
  876. GameTextForPlayer(playerid, "~r~Gang Editor Camera: ~g~~n~Enable ~n~~y~type ~b~/gec ~y~to disable the camera", 5000, 3);return 1;
  877. }
  878. stock CancelFlyMode(playerid)
  879. {
  880. DeletePVar(playerid, "FlyMode");CancelEdit(playerid);TogglePlayerSpectating(playerid, false);DestroyPlayerObject(playerid, noclipdata[playerid][flyobject]);noclipdata[playerid][cameramode] = CAMERA_MODE_NONE;IsReSettingStart[playerid] = false;IsReSettingEnd[playerid] = false;SettingFirstLoc[playerid] = false;SettingLastLoc[playerid] = false;GameTextForPlayer(playerid, "~r~Gang Editor Camera: ~r~~n~Disable", 5000, 3);
  881. return 1;
  882. }
  883. IsPlayerInArea(playerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY)
  884. {
  885. new Float:x, Float:y, Float:z;GetPlayerPos(playerid, x, y, z);if(x >= MinX && x <= MaxX && y >= MinY && y <= MaxY) {
  886. return 1;}return 0;
  887. }
  888. stock DestroyNearbyVehicles(playerid, Float:radi)
  889. {
  890. new Float:posx, Float:posy, Float:posz, Float:tempposx, Float:tempposy, Float:tempposz;for(new i=1; i<MAX_VEHICLES; i++){if(GetVehicleModel(i)){GetPlayerPos(playerid, X, Y, Z),GetVehiclePos(i, posx, posy, posz),tempposx = (posx - X),tempposy = (posy - Y),tempposz = (posz - Z);if(((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))){DestroyVehicle(i);}}}
  891. }
  892. stock RespawnNearbyVehicles(playerid, Float:radi)
  893. {
  894. new Float:posx, Float:posy, Float:posz, Float:tempposx, Float:tempposy, Float:tempposz;for(new i=1; i<MAX_VEHICLES; i++){if(GetVehicleModel(i)){GetPlayerPos(playerid, X, Y, Z),GetVehiclePos(i, posx, posy, posz),tempposx = (posx - X),tempposy = (posy - Y),tempposz = (posz - Z);if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))){SetVehicleToRespawn(i);}}}
  895. }
  896. stock GetMoveDirectionFromKeys(ud, lr)
  897. {
  898. new direction = 0;
  899. if(lr < 0)
  900. {
  901. if(ud < 0) direction = MOVE_FORWARD_LEFT;
  902. else if(ud > 0) direction = MOVE_BACK_LEFT;
  903. else direction = MOVE_LEFT;
  904. }
  905. else if(lr > 0)
  906. {
  907. if(ud < 0) direction = MOVE_FORWARD_RIGHT;
  908. else if(ud > 0) direction = MOVE_BACK_RIGHT;
  909. else direction = MOVE_RIGHT;
  910. }
  911. else if(ud < 0) direction = MOVE_FORWARD;
  912. else if(ud > 0) direction = MOVE_BACK;
  913. return direction;
  914. }
  915. stock GetNextCameraPosition(move_mode, Float:CP[3], Float:FV[3], &Float:x, &Float:y, &Float:z)
  916. {
  917. #define OFFSET_x (FV[0]*6000.0)
  918. #define OFFSET_y (FV[1]*6000.0)
  919. #define OFFSET_z (FV[2]*6000.0)
  920. switch(move_mode)
  921. {
  922. case MOVE_FORWARD:
  923. {x = CP[0]+OFFSET_x;y = CP[1]+OFFSET_y;z = CP[2]+OFFSET_z;}
  924. case MOVE_BACK:
  925. {x = CP[0]-OFFSET_x;y = CP[1]-OFFSET_y;z = CP[2]-OFFSET_z;}
  926. case MOVE_LEFT:
  927. {x = CP[0]-OFFSET_y;y = CP[1]+OFFSET_x;z = CP[2];}
  928. case MOVE_RIGHT:
  929. {x = CP[0]+OFFSET_y;y = CP[1]-OFFSET_x;z = CP[2];}
  930. case MOVE_BACK_LEFT:
  931. {x = CP[0]+(-OFFSET_x - OFFSET_y);y = CP[1]+(-OFFSET_y + OFFSET_x);z = CP[2]-OFFSET_z;}
  932. case MOVE_BACK_RIGHT:
  933. {x = CP[0]+(-OFFSET_x + OFFSET_y);y = CP[1]+(-OFFSET_y - OFFSET_x);z = CP[2]-OFFSET_z;}
  934. case MOVE_FORWARD_LEFT:
  935. {x = CP[0]+(OFFSET_x - OFFSET_y);y = CP[1]+(OFFSET_y + OFFSET_x);z = CP[2]+OFFSET_z;}
  936. case MOVE_FORWARD_RIGHT:
  937. {x = CP[0]+(OFFSET_x + OFFSET_y);y = CP[1]+(OFFSET_y - OFFSET_x);z = CP[2]+OFFSET_z;}
  938. }
  939. }
Add Comment
Please, Sign In to add comment