Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- forward CheckAdminArea();
- public OnFilterScriptInit()
- {
- SetTimer("CheckAdminArea",3000,1);
- return 1;
- }
- stock IsPlayerInArea(playerid, Float:min_x, Float:max_x, Float:min_y, Float:max_y)
- {
- new Float:pos[3]; //Save his position this this triple-var.
- 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].
- 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.
- return 0; //Else it returns 0.
- }
- public CheckAdminArea()
- {
- for(new i; i < MAX_PLAYERS; i++)
- {
- if(!IsPlayerConnected(i)) continue;
- if(IsPlayerInArea(i,2082.2393,2417.5349,1203.1693,1363.7429) && !IsPlayerAdmin(i))
- {
- //Do your stuff
- SetPlayerHealth(i,0);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment