Guest User

Hiddos

a guest
Jul 13th, 2010
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.84 KB | None | 0 0
  1. #include <a_samp>
  2. forward CheckAdminArea();
  3. public OnFilterScriptInit()
  4. {
  5.     SetTimer("CheckAdminArea",3000,1);
  6.     return 1;
  7. }
  8.  
  9. stock IsPlayerInArea(playerid, Float:min_x, Float:max_x, Float:min_y, Float:max_y)
  10. {
  11.     new Float:pos[3]; //Save his position this this triple-var.
  12.     GetPlayerPos(playerid,pos[0],pos[1],pos[2]); //Save his X in pos[0], his Y in pos[1] and his Z in pos[2].
  13.     if(min_x <= pos[0] && max_x >= pos[0] && min_y <= pos[1] && max_y >= pos[1]) return 1; //Checks if the player is in the area, and if so returns 1.
  14.     return 0; //Else it returns 0.
  15. }
  16.  
  17. public CheckAdminArea()
  18. {
  19.     for(new i; i < MAX_PLAYERS; i++)
  20.     {
  21.         if(!IsPlayerConnected(i)) continue;
  22.         if(IsPlayerInArea(i,2082.2393,2417.5349,1203.1693,1363.7429) && !IsPlayerAdmin(i))
  23.         {
  24.             //Do your stuff
  25.             SetPlayerHealth(i,0);
  26.         }
  27.     }
  28.     return 1;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment