Advertisement
Guest User

Untitled

a guest
Jan 29th, 2015
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.25 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #undef MAX_PLAYERS
  4. #define MAX_PLAYERS (100)
  5.  
  6. #include <editarea>
  7.  
  8.  
  9. public OnPlayerCommandText(playerid, cmdtext[])
  10. {
  11.     if(IsPlayerEditArea(playerid))
  12.     {
  13.         SendClientMessage(playerid, -1, "Nie możesz korzystać z komend podczas korzystania z edytora!");
  14.         return 1;
  15.     }
  16.  
  17.     if (strcmp("/edit", cmdtext, true, 5) == 0)
  18.     {
  19.         PlayerEditArea(playerid, 10);
  20.         return 1;
  21.     }
  22.     return 0;
  23. }
  24.  
  25. public OnPlayerEditAreaFinish(playerid, areaid, Float:minx, Float:maxx, Float:miny, Float:maxy, success)
  26. {
  27.     if(success == EDITAREA_REASON_FAIL) return 1;
  28.  
  29.     switch(areaid)
  30.     {
  31.         case 1:
  32.         {
  33.             printf("%d", areaid);
  34.         }
  35.         case 10:
  36.         {
  37.             if(success == EDITAREA_REASON_CANCEL) return 1;
  38.  
  39.             new gangzone = GangZoneCreate(minx,miny,maxx,maxy);
  40.             GangZoneShowForPlayer(playerid, gangzone, 0xFF0000FF);
  41.             /*
  42.             CreateDynamicRectangle(Float:minx, Float:maxx, Float:miny, Float:maxy);
  43.             */
  44.         }
  45.     }
  46.     return 1;
  47. }
  48. public OnPlayerEditAreaUpdate(playerid, areaid, Float:minx, Float:maxx, Float:miny, Float:maxy)
  49. {
  50.     new str[128];
  51.     format(str, 128, "MinX: %.1f MaxX: %.1f MinY: %.1f MaxY: %.1f | Areaid: %d", Float:minx, Float:maxx, Float:miny, Float:maxy, areaid);
  52.     SendClientMessage(playerid, -1, str);
  53.     return 1;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement