Advertisement
Guest User

Gang Tester V3.3 - Major improvements

a guest
Sep 25th, 2020
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 50.93 KB | None | 0 0
  1. #include <a_samp>
  2. #include <streamer>
  3. #include <sscanf2>
  4. #include <zcmd>
  5. #define SPAWN 19980
  6. #define CAPTURE 19981
  7. #define LOOT 19982
  8. #define HOUSE 19983
  9. #define HEALTH 19984
  10. #define ARMOUR 19985
  11. #define MINIGUN 19986
  12. #define ROCKET 19987
  13. #define GATE 19988
  14. #define BASE 19989
  15. #define EDITGANG 29990
  16. #define GANGBASE 19991
  17. #define TELEPORTS 19992
  18. #define VEHICLES 19993
  19. #define TERRITORY 19994
  20. #define GCMDS 19995
  21. #define SETTINGS 19996
  22. #define CLASS 19997
  23. #define RED 0xFF0000FF
  24. #define DIALOG_MENU 1678
  25. #define DIALOG_MOVE_SPEED 1679
  26. #define DIALOG_ROT_SPEED 1680
  27. #define DIALOG_EXPORTNAME 1681
  28. #define DIALOG_CLOSE_NEW 1682
  29. #define MOVE_SPEED 100.0
  30. #define ACCEL_RATE 0.02
  31. #define CAMERA_MODE_NONE 0
  32. #define CAMERA_MODE_FLY 1
  33. #define MOVE_FORWARD 2
  34. #define MOVE_BACK 3
  35. #define MOVE_LEFT 4
  36. #define MOVE_RIGHT 5
  37. #define MOVE_FORWARD_LEFT 6
  38. #define MOVE_FORWARD_RIGHT 7
  39. #define MOVE_BACK_LEFT 8
  40. #define MOVE_BACK_RIGHT 9
  41. #define strcpy(%0,%1) strcat((%0[0] = '\0', %0), %1)
  42. ////////////////////////////////////////////////////////////////////////////////
  43. #define GANG_GATE1Objectid ObjectID
  44. #define GANG_GATE1Position X, Y, Z
  45. #define GANG_GATE1Rotation Rx, Ry, Rz
  46. #define GANG_GATE2Objectid ObjectID
  47. #define GANG_GATE2Position X, Y, Z
  48. #define GANG_GATE2Rotation Rx, Ry, Rz
  49. ////////////////////////////////////////////////////////////////////////////////
  50. //----------------------------------------------------------------------------//
  51. //----------------------------------------------------------------------------//`
  52. new bool:IsCreating[MAX_PLAYERS] = false;new bool:IsReSettingStart[MAX_PLAYERS] = false;new bool:IsReSettingEnd[MAX_PLAYERS] = false;new bool:SettingFirstLoc[MAX_PLAYERS] = false;new bool:SettingLastLoc[MAX_PLAYERS] = false;new bool:IsCamMoving[MAX_PLAYERS] = false;const Float:fScale = 5.0;
  53. new Float:X,Float:Y,Float:Z,Float:A,Float:posX11,Float:posY11,Float:posZ11,Float:posA11,Base,Float:posX12,Float:posY12,Float:posZ12,Float:posA12,Enter,Float:posX13,Float:posY13,Float:posZ13,Float:posA13,Exit,Float:posX14,Float:posY14,Float:posZ14;
  54. new Float:posX0,Float:posY0,Float:posZ0,Float:posA0,Teleport0;new Float:posX1,Float:posY1,Float:posZ1,Float:posA1,Teleport1;new Float:posX2,Float:posY2,Float:posZ2,Float:posA2,Teleport2;new Float:posX3,Float:posY3,Float:posZ3,Float:posA3,Teleport3;new Float:posX4,Float:posY4,Float:posZ4,Float:posA4,Teleport4;new Text3D:tehouse,Text3D:thouse,Text3D:textloot,Text3D:capturet,Text3D:ganggate,Text3D:ganggate2;
  55. new hp,ar,mg,rk,gate,gate2,ghouse,loot,capture,captureicon,capturecp,capturetimer,ghouset,ghousetx,bomb,ebomb,Plant,Eplant;new lootarea, bool:isinlootarea,capturearea, bool:isincapturearea,ghousearea, bool:isinghousearea,eghousearea, bool:isineghousearea;
  56. 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}
  57. new heal_timer[MAX_PLAYERS],armour_timer[MAX_PLAYERS],minigun_timer[MAX_PLAYERS],rocket_timer[MAX_PLAYERS];new Float:ZMinX,Float:ZMinY,Float:ZMaxX,Float:ZMaxY,Makingzone,GangZone,Create,Tprotection;
  58. new tp0,tp1,tp2,tp3,tp4;new Text3D:ltp0,Text3D:ltp1,Text3D:ltp2,Text3D:ltp3,Text3D:ltp4;new teleport0,teleport1,teleport2,teleport3,teleport4;new Float:posX,Float:posY,Float:posZ,Float:posA;
  59. enum noclipenum{cameramode,flyobject,mode,lrold,udold,lastmove,Float:accelmul}
  60. new coordInfo[MAX_PLAYERS][Coordinates],noclipdata[MAX_PLAYERS][noclipenum];
  61. //----------------------------------------------------------------------------//
  62. //----------------------------------------------------------------------------//
  63. public OnFilterScriptInit()
  64. {
  65. return 1;
  66. }
  67. public OnFilterScriptExit()
  68. {
  69. for(new x; x<MAX_PLAYERS; x++){if(noclipdata[x][cameramode] == CAMERA_MODE_FLY) CancelFlyMode(x);GangZoneDestroy(GangZone);}
  70. return 1;
  71. }
  72. public OnPlayerConnect(playerid)
  73. {
  74. 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;
  75. IsCreating[playerid] = false;IsReSettingStart[playerid] = false;IsReSettingEnd[playerid] = false;SettingFirstLoc[playerid] = false;SettingLastLoc[playerid] = false;IsCamMoving[playerid] = false;coordInfo[playerid][MoveSpeed] = 1000;
  76. return 1;
  77. }
  78. public OnPlayerSpawn(playerid)
  79. {
  80. if(GetPlayerTeam(playerid) == 1) SetPlayerPos(playerid, posX, posY, posZ+0.10),SetPlayerFacingAngle(playerid, posA),SetCameraBehindPlayer(playerid),ResetPlayerWeapons(playerid),SetPlayerInterior(playerid, 1),TogglePlayerControllable(playerid, false),SetTimerEx("Unfreeze", 1000, false, "i", playerid),
  81. GivePlayerWeapon(playerid,34,6000),GivePlayerWeapon(playerid,32,6000),GivePlayerWeapon(playerid,31,6000),GivePlayerWeapon(playerid,24,6000),GivePlayerWeapon(playerid,26,6000),GivePlayerWeapon(playerid,9,1);
  82. return 1;
  83. }
  84. ////////////////////////////////////////////////////////////////////////////////
  85. CMD:baseinfo(playerid, params[])
  86. {
  87. //SendClientMessage(playerid, 0xFF0000FF, "ERROR: No data has been loaded! Try again later!");
  88. SendClientMessage(playerid, 0xFF0000FF, "+=================================+");
  89. SendClientMessage(playerid, 0xFF0000FF, " Gang Info: [NAME]");
  90. SendClientMessage(playerid, 0x00CC3300, "Use {FFFFFF}/class {00CC33}to select your spawn point");
  91. SendClientMessage(playerid, 0x00CC3300, "Created Objects: {FFFFFF}[COUNT] {00CC33}Removed Objects: {FFFFFF}[COUNT]");
  92. SendClientMessage(playerid, 0x00CC3300, "Textured Objects: {FFFFFF}[COUNT] {00CC33}Scripted Texts: {FFFFFF}[COUNT]");
  93. SendClientMessage(playerid, 0x00CC3300, "Download: {FFFFFF}[LINK]");
  94. SendClientMessage(playerid, 0xFF0000FF, "+=================================+");
  95. return 1;
  96. }
  97.  
  98. CMD:class(playerid, params[])
  99. {
  100. ShowPlayerDialog(playerid, CLASS, DIALOG_STYLE_LIST, "{FF0000}Server Spawn", "{00FF00}Global Spawn\n{FF0000}Gang Spawn #1", "Select", "Close");
  101. return 1;
  102. }
  103. CMD:gec(playerid, params[])
  104. {
  105. if(IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can't use the editor inside a vehicle!");
  106. if(IsCamMoving[playerid] == false){if(GetPVarType(playerid, "FlyMode")){CancelFlyMode(playerid);IsCreating[playerid] = false;}else FlyMode(playerid);}
  107. return 1;
  108. }
  109. CMD:editgang(playerid,params[])
  110. {
  111. if(IsPlayerAdmin(playerid))
  112. {
  113. 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");
  114. }
  115. return 1;
  116. }
  117. CMD:base(playerid, params[])
  118. {
  119. ShowPlayerDialog(playerid, GANGBASE ,DIALOG_STYLE_LIST,"Base Teleports","{FFFF00}Gang Tester V3.2","Teleport","Close");
  120. return 1;
  121. }
  122. CMD:loot(playerid, params[])
  123. {
  124. if(isinlootarea) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You are not near the loot pickup!");
  125. {
  126. SendClientMessage(playerid, 0xFF0000FF, "ERROR: No more loot for you! Make more gang points if you want to earn more!");
  127. }
  128. return 1;
  129. }
  130. CMD:enter(playerid, params[])
  131. {
  132. if(isinghousearea) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You are not near the gang house!");
  133. if(Enter == 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: House location not set!");
  134. {
  135. SetPlayerPos(playerid, posX12, posY12, posZ12),SetPlayerFacingAngle(playerid, posA12),SetCameraBehindPlayer(playerid),SetPlayerInterior(playerid,1),SetPlayerVirtualWorld(playerid, 1);
  136. }
  137. return 1;
  138. }
  139. CMD:exit(playerid, params[])
  140. {
  141. if(isineghousearea) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You are not near the gang house!");
  142. if(Exit == 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: House location not set!");
  143. {
  144. SetPlayerPos(playerid, posX13, posY13, posZ13),SetPlayerFacingAngle(playerid, posA13),SetCameraBehindPlayer(playerid),SetPlayerInterior(playerid,0),SetPlayerVirtualWorld(playerid, 0);
  145. }
  146. return 1;
  147. }
  148. ////////////////////////////////////////////////////////////////////////////////
  149. CMD:gtloc(playerid, params[])
  150. {
  151. new option[5];
  152. if(IsPlayerAdmin(playerid))
  153. if(sscanf(params, "s[5]", option)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /gtloc [Teleport ID]");
  154.  
  155. if(!strcmp(option, "1", true))
  156. {
  157. if(Teleport0 > 0)return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can use this command only once! Reset or Remove Teleports and try again!");GetPlayerPos(playerid, posX0, posY0, posZ0),GetPlayerFacingAngle(playerid, posA0),Teleport0 = 1,SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Teleport position set");
  158. return 1;
  159. }
  160. if(!strcmp(option, "2", true))
  161. {
  162. if(Teleport1 > 0)return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can use this command only once! Reset or Remove Teleports and try again!");GetPlayerPos(playerid, posX1, posY1, posZ1),GetPlayerFacingAngle(playerid, posA1),Teleport1 = 1,SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Teleport position set");
  163. return 1;
  164. }
  165. if(!strcmp(option, "3", true))
  166. {
  167. if(Teleport2 > 0)return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can use this command only once! Reset or Remove Teleports and try again!");GetPlayerPos(playerid, posX2, posY2, posZ2),GetPlayerFacingAngle(playerid, posA2),Teleport2 = 1,SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Teleport position set");
  168. return 1;
  169. }
  170. if(!strcmp(option, "4", true))
  171. {
  172. if(Teleport3 > 0)return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can use this command only once! Reset or Remove Teleports and try again!");GetPlayerPos(playerid, posX3, posY3, posZ3),GetPlayerFacingAngle(playerid, posA3),Teleport3 = 1,SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Teleport position set");
  173. return 1;
  174. }
  175. if(!strcmp(option, "5", true))
  176. {
  177. if(Teleport4 > 0)return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can use this command only once! Reset or Remove Teleports and try again!");GetPlayerPos(playerid, posX4, posY4, posZ4),GetPlayerFacingAngle(playerid, posA4),Teleport4 = 1,SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Teleport position set");
  178. return 1;
  179. }
  180. return 1;
  181. }
  182. CMD:capture(playerid, params[])
  183. {
  184. if(isincapturearea) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You are not near the capture pickup!");
  185. {
  186. new name[24], string[64], string1[64];
  187. 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);
  188. 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);
  189. SetPlayerChatBubble(playerid, "Capturing", 0xFF0000FF, 100.0, 10000);
  190. }
  191. return 1;
  192. }
  193. ////////////////////////////////////////////////////////////////////////////////
  194. ////////////////////////////////////////////////////////////////////////////////
  195. ////////////////////////////////////////////////////////////////////////////////
  196. CMD:blowgate(playerid, params[])
  197. {
  198. if(IsPlayerInRangeOfPoint(playerid, 15, GANG_GATE1Position))
  199. {
  200. SetPlayerChatBubble(playerid, "Planting", 0xFF0000FF, 100.0, 10000);
  201. GameTextForPlayer(playerid, "~g~~h~Planting", 5000, 3),ghouset = SetTimer("planted",10000,false);
  202. }
  203. else{SendClientMessage(playerid, 0xFF0000FF, "ERROR: You are not near any gate!");}
  204. return 1;
  205. }
  206. CMD:repairgate(playerid, params[])
  207. {
  208. if(IsPlayerInRangeOfPoint(playerid, 15, GANG_GATE1Position))
  209. {
  210. SetPlayerChatBubble(playerid, "Repairing", 0xFF0000FF, 100.0, 10000);
  211. GameTextForPlayer(playerid, "~g~~h~Repairing ~n~~r~~h~please wait", 5000, 3),ghousetx = SetTimer("defuse",10000,false);
  212. }
  213. else{SendClientMessage(playerid, 0xFF0000FF, "ERROR: You are not near any gate!");}
  214. return 1;
  215. }
  216. ////////////////////////////////////////////////////////////////////////////////
  217. ////////////////////////////////////////////////////////////////////////////////
  218. ////////////////////////////////////////////////////////////////////////////////
  219. CMD:og(playerid, params[])
  220. {
  221. if(IsPlayerInRangeOfPoint(playerid, 15.0, GANG_GATE1Position))
  222. {
  223. if(Plant == 1) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can't use the gate when is destroyed! Use /repairgate to fix it!");
  224. MoveDynamicObject(gate, GANG_GATE1Position-7, 3, GANG_GATE1Rotation);
  225. }
  226. else if(IsPlayerInRangeOfPoint(playerid, 15.0, GANG_GATE2Position))
  227. {
  228. MoveDynamicObject(gate2, GANG_GATE2Position-7, 3, GANG_GATE2Rotation);
  229. }
  230. return 1;
  231. }
  232. CMD:cg(playerid, params[])
  233. {
  234. if(IsPlayerInRangeOfPoint(playerid, 15.0, GANG_GATE1Position))
  235. {
  236. if(Plant == 1) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can't use the gate when is destroyed! Use /repairgate to fix it!");
  237. MoveDynamicObject(gate, GANG_GATE1Position, 3, GANG_GATE1Rotation);
  238. }
  239. else if(IsPlayerInRangeOfPoint(playerid, 15.0, GANG_GATE2Position))
  240. {
  241. MoveDynamicObject(gate2, GANG_GATE2Position, 3, GANG_GATE2Rotation);
  242. }
  243. return 1;
  244. }
  245. CMD:opengate(playerid, params[])
  246. {
  247. if(IsPlayerInRangeOfPoint(playerid, 15.0, GANG_GATE1Position))
  248. {
  249. if(Plant == 1) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can't use the gate when is destroyed! Use /repairgate to fix it!");
  250. MoveDynamicObject(gate, GANG_GATE1Position-7, 3, GANG_GATE1Rotation);
  251. }
  252. else if(IsPlayerInRangeOfPoint(playerid, 15.0, GANG_GATE2Position))
  253. {
  254. MoveDynamicObject(gate2, GANG_GATE2Position-7, 3, GANG_GATE2Rotation);
  255. }
  256. return 1;
  257. }
  258. CMD:closegate(playerid, params[])
  259. {
  260. if(IsPlayerInRangeOfPoint(playerid, 15.0, GANG_GATE1Position))
  261. {
  262. if(Plant == 1) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You can't use the gate when is destroyed! Use /repairgate to fix it!");
  263. MoveDynamicObject(gate, GANG_GATE1Position, 3, GANG_GATE1Rotation);
  264. }
  265. else if(IsPlayerInRangeOfPoint(playerid, 15.0, GANG_GATE2Position))
  266. {
  267. MoveDynamicObject(gate2, GANG_GATE2Position, 3, GANG_GATE2Rotation);
  268. }
  269. return 1;
  270. }
  271. ////////////////////////////////////////////////////////////////////////////////
  272. ////////////////////////////////////////////////////////////////////////////////
  273. ////////////////////////////////////////////////////////////////////////////////
  274. public OnPlayerPickUpDynamicPickup(playerid, pickupid)
  275. {
  276. 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);}
  277. 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);}
  278. 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);}
  279. 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);}
  280. if(pickupid == ghouse){}
  281. if(pickupid == loot){}
  282. if(pickupid == capture){}
  283. if(pickupid == bomb){}
  284. return 1;
  285. }
  286. public OnPlayerEnterDynamicCP(playerid, checkpointid)
  287. {
  288. if(checkpointid == tp0){if(Teleport0 == 1)SetPlayerPos(playerid, posX0, posY0, posZ0),SetPlayerFacingAngle(playerid, posA0),SetPlayerInterior(playerid,0),SetPlayerVirtualWorld(playerid, 0);}
  289. if(checkpointid == tp1){if(Teleport1 == 1)SetPlayerPos(playerid, posX1, posY1, posZ1),SetPlayerFacingAngle(playerid, posA1),SetPlayerInterior(playerid,0),SetPlayerVirtualWorld(playerid, 0);}
  290. if(checkpointid == tp2){if(Teleport2 == 1)SetPlayerPos(playerid, posX2, posY2, posZ2),SetPlayerFacingAngle(playerid, posA2),SetPlayerInterior(playerid,0),SetPlayerVirtualWorld(playerid, 0);}
  291. if(checkpointid == tp3){if(Teleport3 == 1)SetPlayerPos(playerid, posX3, posY3, posZ3),SetPlayerFacingAngle(playerid, posA3),SetPlayerInterior(playerid,0),SetPlayerVirtualWorld(playerid, 0);}
  292. if(checkpointid == tp4){if(Teleport4 == 1)SetPlayerPos(playerid, posX4, posY4, posZ4),SetPlayerFacingAngle(playerid, posA4),SetPlayerInterior(playerid,0),SetPlayerVirtualWorld(playerid, 0);}
  293. if(checkpointid == capturecp){}
  294. return 1;
  295. }
  296. public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
  297. {
  298. if(GetPlayerTeam(playerid) == 1)GameTextForPlayer(playerid, "~R~warning~n~~w~stop shooting ~n~your teammate", 3000, 3);
  299. }
  300. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  301. {
  302. if(dialogid == SPAWN)// Save Spawn //
  303. {
  304. if(response)
  305. {
  306. if(listitem == 0)
  307. {
  308. new int;
  309. GetPlayerPos(playerid, posX, posY, posZ),GetPlayerFacingAngle(playerid, posA),int = GetPlayerInterior(playerid),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Spawn saved!");for( new i; i < MAX_PLAYERS; i++ ){SetPlayerTeam(i, 1);SetPlayerInterior(playerid, int);}
  310. }
  311. if(listitem == 1)
  312. {
  313. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Spawn reset!"),SetPlayerTeam(playerid, 0);
  314. }
  315. }
  316. return 1;
  317. }
  318. if(dialogid == CAPTURE)// Set Capture //
  319. {
  320. if(response)
  321. {
  322. if(listitem == 0){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!");}
  323. if(listitem == 1){DestroyDynamicPickup(capture),DestroyDynamic3DTextLabel(capturet),DestroyDynamicArea(capturearea),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Capture destroyed!");}
  324. }
  325. return 1;
  326. }
  327. if(dialogid == HOUSE)// Set House //
  328. {
  329. if(response)
  330. {
  331. if(listitem == 0)
  332. {
  333. 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));
  334. thouse = CreateDynamic3DTextLabel("{FFFF00}/enter\n{FFFFFF}Gang House", -1, X, Y, Z, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1);SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Gang House saved!");
  335. }
  336. if(listitem == 1)
  337. {
  338. 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!");
  339. }
  340. if(listitem == 2){DestroyDynamicPickup(ghouse),DestroyDynamic3DTextLabel(thouse),DestroyDynamicArea(eghousearea),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Gang House destroyed!");}
  341. if(listitem == 3){DestroyDynamic3DTextLabel(tehouse),DestroyDynamicArea(ghousearea),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Gang House Exit destroyed!");}
  342. }
  343. return 1;
  344. }
  345. if(dialogid == BASE)// Set Base //
  346. {
  347. if(response)
  348. {
  349. if(listitem == 0){GetPlayerPos(playerid, posX11, posY11, posZ11),GetPlayerFacingAngle(playerid, posA11),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Base saved!"),Base = 1;}
  350. if(listitem == 1){SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Base reset!"),Base = 0;}
  351. }
  352. return 1;
  353. }
  354. if(dialogid == LOOT)// Set Loot //
  355. {
  356. if(response)
  357. {
  358. 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,0, -1, -1, -1),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Loot saved!");}
  359. if(listitem == 1){DestroyDynamicArea(lootarea),DestroyDynamicPickup(loot),DestroyDynamic3DTextLabel(textloot),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Loot destroyed!");}
  360. }
  361. return 1;
  362. }
  363. if(dialogid == HEALTH)// Set Health //
  364. {
  365. if(response)
  366. {
  367. if(listitem == 0){DestroyDynamicPickup(hp),GetPlayerPos(playerid, X, Y, Z),hp = CreateDynamicPickup(1240, 1, X, Y, Z, 0),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Health saved!");}
  368. if(listitem == 1){DestroyDynamicPickup(hp),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Health destroyed!");}
  369. }
  370. return 1;
  371. }
  372. if(dialogid == ARMOUR)// Set Armour //
  373. {
  374. if(response)
  375. {
  376. if(listitem == 0){DestroyDynamicPickup(ar),GetPlayerPos(playerid, X, Y, Z),ar = CreateDynamicPickup(1242, 1, X, Y, Z, 0),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Armour saved!");}
  377. if(listitem == 1){DestroyDynamicPickup(ar),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Armour destroyed!");}
  378. }
  379. return 1;
  380. }
  381. if(dialogid == MINIGUN)// Set Minigun //
  382. {
  383. if(response)
  384. {
  385. if(listitem == 0){DestroyDynamicPickup(mg),GetPlayerPos(playerid, X, Y, Z),mg = CreateDynamicPickup(362, 1, X, Y, Z, -1),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Minigun saved!");}
  386. if(listitem == 1){DestroyDynamicPickup(mg),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Minigun destroyed!");}
  387. }
  388. return 1;
  389. }
  390. if(dialogid == ROCKET)// Set Rocket //
  391. {
  392. if(response)
  393. {
  394. if(listitem == 0){DestroyDynamicPickup(rk),GetPlayerPos(playerid, X, Y, Z),rk = CreateDynamicPickup(359, 1, X, Y, Z, -1),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Rocket saved!");}
  395. if(listitem == 1){DestroyDynamicPickup(rk),SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Rocket destroyed!");}
  396. }
  397. return 1;
  398. }
  399. if(dialogid == GATE)// Reload Gate //
  400. {
  401. if(response)
  402. {
  403. if(listitem == 0){SetPlayerPos(playerid,GANG_GATE1Position);}
  404. if(listitem == 1)
  405. {
  406. //SendClientMessage(playerid, 0xFF0000FF, "ERROR: There is no gate loaded!");
  407. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  408. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  409. DestroyDynamicObject(gate),DestroyDynamic3DTextLabel(ganggate),DestroyDynamicObject(gate2),DestroyDynamic3DTextLabel(ganggate2),SendClientMessage(playerid, 0x00CC3300, "SUCCES: Gate reloaded!");
  410. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  411. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  412. 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, GANG_GATE1Position, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1);
  413. gate = CreateDynamicObject(GANG_GATE1Objectid, GANG_GATE1Position, GANG_GATE1Rotation);
  414. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  415. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  416. //ganggate2 = CreateDynamic3DTextLabel("If you are in this gang use {FFFF00}/opengate(/og) {FFFFFF}to open gate \nand {FFFF00}/closegate(/cg) {FFFFFF}to close gate!", -1, GANG_GATE2Position, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1);
  417. //gate2 = CreateDynamicObject(GANG_GATE2Objectid, GANG_GATE2Position, GANG_GATE2Rotation);
  418. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  419. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  420. }
  421. if(listitem == 2){DestroyDynamicObject(gate),DestroyDynamic3DTextLabel(ganggate),SendClientMessage(playerid, 0x00CC3300, "SUCCES: Gate destroyed!");}
  422. }
  423. return 1;
  424. }
  425. if(dialogid == CLASS)
  426. {
  427. if(response)
  428. {
  429. if(listitem == 0){SetPlayerTeam(playerid, 0);SpawnPlayer(playerid);}
  430. if(listitem == 1){SetPlayerTeam(playerid, 1);SpawnPlayer(playerid);}}
  431. return 1;
  432. }
  433. if(dialogid == EDITGANG)
  434. {
  435. if(response)
  436. {
  437. if(listitem == 0)//GANG SPAWN
  438. {
  439. ShowPlayerDialog(playerid, SPAWN ,DIALOG_STYLE_LIST,"{FF0000}Set Spawn","{FF0000}Set Spawn\n{FF0000}Reset Spawn","Select","Close");
  440. }
  441. if(listitem == 1)//GANG CAPTURE
  442. {
  443. ShowPlayerDialog(playerid, CAPTURE ,DIALOG_STYLE_LIST,"{FF0000}Set Capture","{FF0000}Set Capture\n{FF0000}Destroy Capture","Select","Close");
  444. }
  445. if(listitem == 2)//GANG HOUSE
  446. {
  447. 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");
  448. }
  449. if(listitem == 3)//GANG BASE
  450. {
  451. ShowPlayerDialog(playerid, BASE ,DIALOG_STYLE_LIST,"{FF0000}Set Base","{FF0000}Set Base\n{FF0000}Reset Base","Select","Close");
  452. }
  453. if(listitem == 4)//GANG LOOT
  454. {
  455. ShowPlayerDialog(playerid, LOOT ,DIALOG_STYLE_LIST,"{FF0000}Set Loot","{FF0000}Set Loot\n{FF0000}Destroy Loot","Select","Close");
  456. }
  457. if(listitem == 5)//GANG HEALTH
  458. {
  459. ShowPlayerDialog(playerid, HEALTH ,DIALOG_STYLE_LIST,"{FF0000}Set Health","{FF0000}Set Health\n{FF0000}Destroy Health","Select","Close");
  460. }
  461. if(listitem == 6)//GANG ARMOUR
  462. {
  463. ShowPlayerDialog(playerid, ARMOUR ,DIALOG_STYLE_LIST,"{FF0000}Set Armour","{FF0000}Set Armour\n{FF0000}Destroy Armour","Select","Close");
  464. }
  465. if(listitem == 7)//GANG MINIGUN
  466. {
  467. ShowPlayerDialog(playerid, MINIGUN ,DIALOG_STYLE_LIST,"{FF0000}Set Minigun","{FF0000}Set Minigun\n{FF0000}Destroy Minigun","Select","Close");
  468. }
  469. if(listitem == 8)//GANG ROCKET
  470. {
  471. ShowPlayerDialog(playerid, ROCKET ,DIALOG_STYLE_LIST,"{FF0000}Set Rocket","{FF0000}Set Rocket\n{FF0000}Destroy Rocket","Select","Close");
  472. }
  473. if(listitem == 9)//REMOVE VEHICLES
  474. {
  475. DestroyNearbyVehicles(playerid, 250);SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Vehicles removed!");
  476. }
  477. if(listitem == 10)//SET VEHICLES
  478. {
  479. if(IsPlayerInAnyVehicle(playerid))
  480. {
  481. 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");
  482. }
  483. else
  484. {
  485. SendClientMessage(playerid, 0xFF0000FF, "ERROR: You are not in a vehicle");
  486. }
  487. }
  488. if(listitem == 11)//RESET TELEPORTS
  489. {
  490. if(IsPlayerAdmin(playerid)){Teleport0 = 0,Teleport1 = 0,Teleport2 = 0,Teleport3 = 0,Teleport4 = 0,GameTextForPlayer(playerid, "~g~~h~Successfully!", 5000, 3);}else{}
  491. }
  492. if(listitem == 12)//REMOVE TELEPORTS
  493. {
  494. SendClientMessage(playerid, 0x00CC3300, "SUCCESS: Teleports removed!"),DestroyDynamicCP(tp0),DestroyDynamicCP(tp1),DestroyDynamicCP(tp2),DestroyDynamicCP(tp3),DestroyDynamicCP(tp4);
  495. DestroyDynamic3DTextLabel(ltp0),DestroyDynamic3DTextLabel(ltp1),DestroyDynamic3DTextLabel(ltp2),DestroyDynamic3DTextLabel(ltp3),DestroyDynamic3DTextLabel(ltp4);
  496. teleport0 = 0,teleport1 = 0,teleport2 = 0,teleport3 = 0,teleport4 = 0,Teleport0 = 0,Teleport1 = 0,Teleport2 = 0,Teleport3 = 0,Teleport4 = 0;
  497. }
  498. if(listitem == 13)//SET TELEPORTS
  499. {
  500. //ShowPlayerDialog(playerid, TELEPORTS, DIALOG_STYLE_INPUT,"{FF0000}Set Teleport","{FF0000}Insert teleport name","Create","Cancel");//test version
  501. 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");
  502. }
  503. if(listitem == 14)//SET TERRITORY
  504. {
  505. //ShowPlayerDialog(playerid, TERRITORY, DIALOG_STYLE_INPUT,"{FF0000}Set Territory List","{FF0000}Insert values","Select","Cancel");//test version
  506. ShowPlayerDialog(playerid, TERRITORY, DIALOG_STYLE_LIST,"{FF0000}Set Territory List","{FF0000}Create Territory\n{FF0000}Save Territory\n{FF0000}Destroy Territory","Select","Cancel");
  507. return 1;
  508. }
  509. if(listitem == 15)//RELOAD GATE
  510. {
  511. 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");
  512. ShowPlayerDialog(playerid, GATE ,DIALOG_STYLE_LIST,"{FF0000}Set Gate","{FF0000}Goto Gate\n{FF0000}Reload Gate\n{FF0000}Destroy Gate","Select","Close");
  513. }
  514. }
  515. return 1;
  516. }
  517. if(dialogid == GANGBASE)// Save Base Teleport //
  518. {
  519. if(response)
  520. {
  521. 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);}
  522. else{SendClientMessage(playerid, 0xFF0000FF, "ERROR: Gang Base is not created!");}
  523. }
  524. return 1;
  525. }
  526. if(dialogid == TELEPORTS)// Teleports List //
  527. {
  528. if(response)
  529. {
  530. if(listitem == 0)
  531. {
  532. ShowPlayerDialog(playerid, 1010 ,DIALOG_STYLE_INPUT,"{FF0000}Teleport Name","Insert an teleport name bellow","Create","Close");
  533. }
  534. else if(listitem == 1)
  535. {
  536. ShowPlayerDialog(playerid, 1011 ,DIALOG_STYLE_INPUT,"{FF0000}Teleport Name","Insert an teleport name bellow","Create","Close");
  537. }
  538. else if(listitem == 2)
  539. {
  540. ShowPlayerDialog(playerid, 1012 ,DIALOG_STYLE_INPUT,"{FF0000}Teleport Name","Insert an teleport name bellow","Create","Close");
  541. }
  542. else if(listitem == 3)
  543. {
  544. ShowPlayerDialog(playerid, 1013 ,DIALOG_STYLE_INPUT,"{FF0000}Teleport Name","Insert an teleport name bellow","Create","Close");
  545. }
  546. else if(listitem == 4)
  547. {
  548. ShowPlayerDialog(playerid, 1014 ,DIALOG_STYLE_INPUT,"{FF0000}Teleport Name","Insert an teleport name bellow","Create","Close");
  549. }
  550. }
  551. return 1;
  552. }
  553. ////////////////////////////////////////////////////////////////////////////////
  554. if(dialogid == 1010)// Create Teleport #1 //
  555. {
  556. if(response)
  557. {
  558. if(teleport0 > 0) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: This teleport is already created!");GetPlayerPos(playerid,X,Y,Z);tp0 = CreateDynamicCP(X, Y, Z-0.90, 1, -1, -1, -1, 1, -1, 0);ltp0 = CreateDynamic3DTextLabel("", -1, X,Y,Z, 25.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, -1, -1, -1);UpdateDynamic3DTextLabelText(ltp0, -1, inputtext);SendClientMessage(playerid,0x00CC3300, "SUCCESS: Teleport created successfully! Now, use command /gtloc 1 to save teleport location!");teleport0 = 1;
  559. }
  560. return 1;
  561. }
  562. if(dialogid == 1011)// Create Teleport #1 //
  563. {
  564. if(response)
  565. {
  566. 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 2 to save teleport location!"),teleport1 = 1;
  567. }
  568. return 1;
  569. }
  570. if(dialogid == 1012)// Create Teleport #2 //
  571. {
  572. if(response)
  573. {
  574. 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 3 to save teleport location!"),teleport2 = 1;
  575. }
  576. return 1;
  577. }
  578. if(dialogid == 1013)// Create Teleport #3 //
  579. {
  580. if(response)
  581. {
  582. 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 4 to save teleport location!"),teleport3 = 1;
  583. }
  584. return 1;
  585. }
  586. if(dialogid == 1014)// Create Teleport #4 //
  587. {
  588. if(response)
  589. {
  590. 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 5 to save teleport location!"),teleport4 = 1;
  591. }
  592. return 1;
  593. }
  594. ////////////////////////////////////////////////////////////////////////////////
  595. if(dialogid == VEHICLES)
  596. {
  597. if(response)
  598. {
  599. 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), -1),SetVehicleZAngle(currentveh, A),LinkVehicleToInterior(CarSpawned[playerid], 0),SendClientMessage(playerid,0x00CC3300, "SUCCESS: Vehicle created!");
  600. }
  601. return 1;
  602. }
  603. if(dialogid == TERRITORY)
  604. {
  605. if(response)
  606. {
  607. if(listitem == 0)
  608. {
  609. 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;
  610. }
  611. if(listitem == 1)
  612. {
  613. 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;
  614. }
  615. if(listitem == 2)
  616. {
  617. KillTimer(Create),Makingzone = 0,Tprotection = 0,GangZoneDestroy(GangZone),SendClientMessage(playerid,0x00CC3300,"SUCCESS: Territory destroyed!");
  618. }
  619. }
  620. }
  621. if(dialogid == 01)
  622. {
  623. if(response)
  624. {
  625. if(listitem == 0)
  626. {
  627. 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!");
  628. }
  629. if(listitem == 1)
  630. {
  631. 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!");
  632. }
  633. if(listitem == 2)
  634. {
  635. 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!");
  636. }
  637. if(listitem == 3)
  638. {
  639. 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!");
  640. }
  641. if(listitem == 4)
  642. {
  643. 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!");
  644. }
  645. if(listitem == 5)
  646. {
  647. 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!");
  648. }
  649. if(listitem == 6)
  650. {
  651. 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!");
  652. }
  653. if(listitem == 7)
  654. {
  655. 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!");
  656. }
  657. if(listitem == 8)
  658. {
  659. 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!");
  660. }
  661. }
  662. else if(!response){Makingzone = 0;}
  663. }
  664. return 0;
  665. }
  666. forward Createzone(playerid,color);
  667. public Createzone(playerid,color)
  668. {
  669. GangZoneHideForAll(GangZone),GangZoneDestroy(GangZone),GetPlayerPos(playerid,ZMaxX,ZMaxY,Z),GangZone = GangZoneCreate(ZMinX,ZMinY,ZMaxX,ZMaxY),GangZoneShowForAll(GangZone,color);
  670. return 1;
  671. }
  672. public OnPlayerLeaveDynamicCP(playerid, checkpointid)
  673. {
  674. if(checkpointid == capturecp){DestroyDynamicCP(capturecp),GangZoneStopFlashForAll(GangZone),GameTextForPlayer(playerid, "~r~capture failed", 2500, 3),UpdateDynamic3DTextLabelText(capturet, 0xFF0000FF, "/capture"),KillTimer(capturetimer),DestroyDynamicMapIcon(captureicon);}
  675. return 1;
  676. }
  677. public OnPlayerEnterDynamicArea(playerid, areaid)
  678. {
  679. ////////////////////////////////////////////////////////////////////////////
  680. if(areaid == lootarea){isinlootarea = false;}
  681. ////////////////////////////////////////////////////////////////////////////
  682. if(areaid == capturearea){isincapturearea = false;}
  683. ////////////////////////////////////////////////////////////////////////////
  684. if(areaid == ghousearea){isinghousearea = false,KillTimer(ghouset),KillTimer(ghousetx);}
  685. ////////////////////////////////////////////////////////////////////////////
  686. if(areaid == eghousearea){isineghousearea = false;}
  687. ////////////////////////////////////////////////////////////////////////////
  688. }
  689. public OnPlayerLeaveDynamicArea(playerid, areaid)
  690. {
  691. ////////////////////////////////////////////////////////////////////////////
  692. if(areaid == lootarea){isinlootarea = true;}
  693. ////////////////////////////////////////////////////////////////////////////
  694. if(areaid == capturearea){isincapturearea = true;}
  695. ////////////////////////////////////////////////////////////////////////////
  696. if(areaid == ghousearea){isinghousearea = true;}
  697. ////////////////////////////////////////////////////////////////////////////
  698. if(areaid == eghousearea){isineghousearea = true;}
  699. ////////////////////////////////////////////////////////////////////////////
  700. }
  701. public captured(playerid)
  702. {
  703. GangZoneShowForAll(GangZone,GetPlayerColor(playerid)),GameTextForPlayer(playerid, "~r~successfully captured!", 2500, 3),KillTimer(capturetimer),DestroyDynamicCP(capturecp),UpdateDynamic3DTextLabelText(capturet, 0xFF0000FF, "/capture"),DestroyDynamicMapIcon(captureicon);
  704. return 1;
  705. }
  706. public planted(playerid)
  707. {
  708. new string[128];if(Eplant == 1){}GetObjectPos(gate, posX14, posY14, posZ14),GameTextForPlayer(playerid, "~g~~h~planted!", 2500, 3),bomb = CreatePickup(1654, 1, posX14, posY14, posZ14, -1),KillTimer(ghouset),ebomb = SetTimer("explode",3000,false),Eplant = 1,GameTextForPlayer(playerid,string, 5000, 3);
  709. }
  710. public explode(playerid)
  711. {
  712. new string[ 64 ];if(GetPlayerTeam(playerid) == 1)format( string, sizeof(string), "~r~Your gang gate was destroyed!");
  713. DestroyPickup(bomb),CreateExplosion(posX14, posY14, posZ14, 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");
  714. }
  715. public defuse(playerid)
  716. {
  717. 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);
  718. gate = CreateDynamicObject(GANG_GATE1Objectid,GANG_GATE1Position,GANG_GATE1Rotation);
  719. ////////////////////////^^Replace with the new gate^^///////////////////////
  720. }
  721. ////////////////////////////////////////////////////////////////////////////////
  722. public OnPlayerUpdate(playerid)
  723. {
  724. if(noclipdata[playerid][cameramode] == CAMERA_MODE_FLY)
  725. {
  726. new keys,ud,lr;
  727. GetPlayerKeys(playerid,keys,ud,lr);
  728. if(noclipdata[playerid][mode] && (GetTickCount() - noclipdata[playerid][lastmove] > 100))
  729. {MoveCamera(playerid);}
  730. if(noclipdata[playerid][udold] != ud || noclipdata[playerid][lrold] != lr)
  731. {
  732. 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;
  733. }
  734. else{noclipdata[playerid][mode] = GetMoveDirectionFromKeys(ud, lr);MoveCamera(playerid);
  735. }
  736. }
  737. noclipdata[playerid][udold] = ud; noclipdata[playerid][lrold] = lr;
  738. return 0;
  739. }
  740. return 1;
  741. }
  742. ////////////////////////////////////////////////////////////////////////////////
  743. forward heal(playerid);
  744. forward armour(playerid);
  745. forward minigun(playerid);
  746. forward rocket(playerid);
  747. forward captured(playerid);
  748. forward planted(playerid);
  749. forward explode(playerid);
  750. forward defuse(playerid);
  751. forward Unfreeze(playerid);
  752. public heal(playerid){heal_timer[playerid] = 0,KillTimer(heal_timer[playerid]);return 1;}
  753. public armour(playerid){armour_timer[playerid] = 0,KillTimer(armour_timer[playerid]);return 1;}
  754. public minigun(playerid){minigun_timer[playerid] = 0,KillTimer(minigun_timer[playerid]);return 1;}
  755. public rocket(playerid){rocket_timer[playerid] = 0,KillTimer(rocket_timer[playerid]);return 1;}
  756. public Unfreeze(playerid){TogglePlayerControllable(playerid, true);return 1;}
  757. stock MoveCamera(playerid)
  758. {
  759. 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;
  760. }
  761. stock FlyMode(playerid)
  762. {
  763. 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;
  764. GameTextForPlayer(playerid, "~r~Gang Editor Camera: ~g~~n~Enable ~n~~y~type ~b~/gec ~y~to disable the camera", 5000, 3);return 1;
  765. }
  766. stock CancelFlyMode(playerid)
  767. {
  768. 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);
  769. return 1;
  770. }
  771. stock DestroyNearbyVehicles(playerid, Float:radi)
  772. {
  773. 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);}}}
  774. }
  775. stock RespawnNearbyVehicles(playerid, Float:radi)
  776. {
  777. 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);}}}
  778. }
  779. stock GetMoveDirectionFromKeys(ud, lr)
  780. {
  781. new direction = 0;
  782. if(lr < 0)
  783. {
  784. if(ud < 0) direction = MOVE_FORWARD_LEFT;
  785. else if(ud > 0) direction = MOVE_BACK_LEFT;
  786. else direction = MOVE_LEFT;
  787. }
  788. else if(lr > 0)
  789. {
  790. if(ud < 0) direction = MOVE_FORWARD_RIGHT;
  791. else if(ud > 0) direction = MOVE_BACK_RIGHT;
  792. else direction = MOVE_RIGHT;
  793. }
  794. else if(ud < 0) direction = MOVE_FORWARD;
  795. else if(ud > 0) direction = MOVE_BACK;
  796. return direction;
  797. }
  798. stock GetNextCameraPosition(move_mode, Float:CP[3], Float:FV[3], &Float:x, &Float:y, &Float:z)
  799. {
  800. #define OFFSET_x (FV[0]*6000.0)
  801. #define OFFSET_y (FV[1]*6000.0)
  802. #define OFFSET_z (FV[2]*6000.0)
  803. switch(move_mode)
  804. {
  805. case MOVE_FORWARD:
  806. {x = CP[0]+OFFSET_x;y = CP[1]+OFFSET_y;z = CP[2]+OFFSET_z;}
  807. case MOVE_BACK:
  808. {x = CP[0]-OFFSET_x;y = CP[1]-OFFSET_y;z = CP[2]-OFFSET_z;}
  809. case MOVE_LEFT:
  810. {x = CP[0]-OFFSET_y;y = CP[1]+OFFSET_x;z = CP[2];}
  811. case MOVE_RIGHT:
  812. {x = CP[0]+OFFSET_y;y = CP[1]-OFFSET_x;z = CP[2];}
  813. case MOVE_BACK_LEFT:
  814. {x = CP[0]+(-OFFSET_x - OFFSET_y);y = CP[1]+(-OFFSET_y + OFFSET_x);z = CP[2]-OFFSET_z;}
  815. case MOVE_BACK_RIGHT:
  816. {x = CP[0]+(-OFFSET_x + OFFSET_y);y = CP[1]+(-OFFSET_y - OFFSET_x);z = CP[2]-OFFSET_z;}
  817. case MOVE_FORWARD_LEFT:
  818. {x = CP[0]+(OFFSET_x - OFFSET_y);y = CP[1]+(OFFSET_y + OFFSET_x);z = CP[2]+OFFSET_z;}
  819. case MOVE_FORWARD_RIGHT:
  820. {x = CP[0]+(OFFSET_x + OFFSET_y);y = CP[1]+(OFFSET_y - OFFSET_x);z = CP[2]+OFFSET_z;}
  821. }
  822. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement