Guest User

Untitled

a guest
May 19th, 2013
541
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.78 KB | None | 0 0
  1. /*
  2. Ihr könnt damit machen was ihr wollt :D
  3. */
  4.  
  5. #include <a_samp>
  6. #include <zcmd>
  7. #include <YSI\y_ini>
  8.  
  9.  
  10.  
  11. enum{
  12. DIALOG_TZONE = 433,
  13. DIALOG_ZONE_NAME
  14. }
  15.  
  16. enum Zone{
  17. Float:minx,
  18. Float:miny,
  19. Float:maxx,
  20. Float:maxy,
  21. Name[64]
  22. };
  23. new
  24. z[MAX_GANG_ZONES][Zone],
  25. LastZone = 0,
  26. Start[MAX_PLAYERS],
  27. gangzone[MAX_GANG_ZONES],
  28. schleife;
  29.  
  30.  
  31. public OnFilterScriptInit()
  32. {
  33. print("\n--------------------------------------");
  34. print(" t_Zone geladen (c) by !TheO");
  35. print("--------------------------------------\n");
  36. return 1;
  37. }
  38.  
  39. public OnFilterScriptExit()
  40. {
  41. for(;schleife<MAX_GANG_ZONES;schleife++){
  42. GangZoneHideForAll(gangzone[schleife]);
  43. }
  44. return 1;
  45. }
  46.  
  47.  
  48. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  49. {
  50. switch(dialogid){
  51. case DIALOG_TZONE:{
  52. if(response){
  53. LastZone++;
  54. ShowPlayerDialog(playerid, DIALOG_ZONE_NAME, DIALOG_STYLE_INPUT,"t_Zone","Type the Name of The Zone!","Next","");
  55.  
  56. }
  57. }
  58. case DIALOG_ZONE_NAME:{
  59. if(response){
  60. format(z[LastZone][Name], 64, "%s", inputtext);
  61. //strcat(z[LastZone][Name],inputtext);
  62. SendClientMessage(playerid,0xFF0005FF,"Press ~k~~VEHICLE_ENTER_EXIT~ to Start!");
  63. Start[playerid] = 1;
  64. }
  65. }
  66. }
  67. return 0;
  68. }
  69.  
  70. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  71. {
  72. new Float:p[3],string[256],file[100];
  73. if(newkeys & 16){
  74. if(IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid, 0xFF0005FF,"You are in a Car!");
  75. if(Start[playerid] == 1)
  76. {
  77. GetPlayerPos(playerid, p[0],p[1],p[2]);
  78. z[LastZone][minx] = p[0];
  79. z[LastZone][miny] = p[1];
  80. Start[playerid] = 2;
  81. SendClientMessage(playerid,0xFF0005FF,"Walk diagonally to the other side and Press ~k~~VEHICLE_ENTER_EXIT~!");
  82. return 1;
  83. }
  84. if(Start[playerid] == 2)
  85. {
  86. GetPlayerPos(playerid, p[0],p[1],p[2]);
  87. z[LastZone][maxx] = p[0];
  88. z[LastZone][maxy] = p[1];
  89. gangzone[LastZone] = GangZoneCreate(z[LastZone][minx],z[LastZone][miny],z[LastZone][maxx],z[LastZone][maxy]);
  90. GangZoneShowForAll(gangzone[LastZone], 0xFF0005FF);
  91. format(string,128,"Zone are saved in Scriptfiles! t_Zone/%s.txt",z[LastZone][Name]);
  92. SendClientMessage(playerid,0x41FF00FF,string);
  93. format(string,256,"\r\nnew %s = GangZoneCreate(%f,%f,%f,%f);\r\nGangZoneShowForAll(%s, COLOR);",\
  94. z[LastZone][Name],z[LastZone][minx],z[LastZone][miny],z[LastZone][maxx],\
  95. z[LastZone][maxy],z[LastZone][Name]);
  96. format(file,100,"t_Zone/%s.txt",z[LastZone][Name]);
  97. new
  98. INI:ini = INI_Open(file);
  99. INI_WriteString(ini, "Zonen System", string);
  100. INI_Close(ini);
  101. return 1;
  102. }
  103. }
  104.  
  105. return 1;
  106. }
  107.  
  108.  
  109. CMD:tzone(playerid,params[])
  110. {
  111. ShowPlayerDialog(playerid, DIALOG_TZONE, DIALOG_STYLE_LIST,"t_Zone","Create Zone","Next","Exit");
  112. return 1;
  113. }
Advertisement
Add Comment
Please, Sign In to add comment