Advertisement
Guest User

[FS] External Gang Zones

a guest
Jun 25th, 2011
692
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.80 KB | None | 0 0
  1. //--------------------------------External Gang Zones FilterScript by [_FFG_]BuLLeT------------------------------------------------
  2. #include <a_samp>
  3. #define FLANK_THICKNESS 50
  4. #define COLOR_ZONE 0xFF0000FF
  5. new Float:ZoneCoords[1][4] = { //coordinates of normal gang zone
  6. {1256.7238,1142.2188,1727.8041,1864.1296}
  7. };
  8.  
  9. new Zone[4];
  10. new ZoneCreated;
  11.  
  12. public OnFilterScriptInit()
  13. {
  14. print("\n|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|");
  15. print(" External Gang Zones [FS] by [_FFG_]BuLLeT");
  16. print("|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|\n");
  17. ZoneCreated = 0;
  18. return 1;
  19. }
  20.  
  21. public OnFilterScriptExit()
  22. {
  23. return 1;
  24. }
  25.  
  26. public OnPlayerConnect(playerid)
  27. {
  28. if(ZoneCreated == 1)
  29. {
  30. GangZoneShowForPlayer(playerid,Zone[0],COLOR_ZONE);
  31. GangZoneShowForPlayer(playerid,Zone[1],COLOR_ZONE);
  32. GangZoneShowForPlayer(playerid,Zone[2],COLOR_ZONE);
  33. GangZoneShowForPlayer(playerid,Zone[3],COLOR_ZONE);
  34. }
  35. return 1;
  36. }
  37.  
  38. public OnPlayerDisconnect(playerid, reason)
  39. {
  40. if(ZoneCreated == 1)
  41. {
  42. GangZoneHideForPlayer(playerid,Zone[0]);
  43. GangZoneHideForPlayer(playerid,Zone[1]);
  44. GangZoneHideForPlayer(playerid,Zone[2]);
  45. GangZoneHideForPlayer(playerid,Zone[3]);
  46. }
  47. return 1;
  48. }
  49.  
  50. public OnPlayerCommandText(playerid, cmdtext[])
  51. {
  52. if (strcmp("/zone", cmdtext, true, 5) == 0) //creates external gang zone from normal coordinates. It's made of 4 gang zones
  53. {
  54. Zone[0] = GangZoneCreate(ZoneCoords[0][2],ZoneCoords[0][1]-FLANK_THICKNESS,ZoneCoords[0][2]+FLANK_THICKNESS,ZoneCoords[0][3]+FLANK_THICKNESS);
  55. Zone[1] = GangZoneCreate(ZoneCoords[0][0]-FLANK_THICKNESS,ZoneCoords[0][1]-FLANK_THICKNESS,ZoneCoords[0][0],ZoneCoords[0][3]+FLANK_THICKNESS);
  56. Zone[2] = GangZoneCreate(ZoneCoords[0][0],ZoneCoords[0][1]-FLANK_THICKNESS,ZoneCoords[0][2],ZoneCoords[0][1]);
  57. Zone[3] = GangZoneCreate(ZoneCoords[0][0],ZoneCoords[0][3],ZoneCoords[0][2],ZoneCoords[0][3]+FLANK_THICKNESS);
  58. ZoneCreated = 1;
  59. for(new i = 0; i <= MAX_PLAYERS; i++)
  60. {
  61. if(IsPlayerConnected(i))
  62. {
  63. GangZoneShowForPlayer(i,Zone[0],COLOR_ZONE);
  64. GangZoneShowForPlayer(i,Zone[1],COLOR_ZONE);
  65. GangZoneShowForPlayer(i,Zone[2],COLOR_ZONE);
  66. GangZoneShowForPlayer(i,Zone[3],COLOR_ZONE);
  67. }
  68. }
  69. return 1;
  70. }
  71. if (strcmp("/dzone", cmdtext, true, 6) == 0)
  72. {
  73. for(new i = 0; i <= MAX_PLAYERS; i++)
  74. {
  75. if(IsPlayerConnected(i))
  76. {
  77. GangZoneHideForPlayer(i,Zone[0]);
  78. GangZoneHideForPlayer(i,Zone[1]);
  79. GangZoneHideForPlayer(i,Zone[2]);
  80. GangZoneHideForPlayer(i,Zone[3]);
  81. }
  82. }
  83. GangZoneDestroy(Zone[0]);
  84. GangZoneDestroy(Zone[1]);
  85. GangZoneDestroy(Zone[2]);
  86. GangZoneDestroy(Zone[3]);
  87. ZoneCreated = 0;
  88. return 1;
  89. }
  90. return 0;
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement