[Include] gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!)
#1

gArea 1.1
What is it ?
gArea is a include that allows you to create easily admin areas, you can just use the functions to create an area, and it will use a callback when a player entered it!

Functions
pawn Код:
CreateArea(Float:x,Float:y,Float:range) //create an area and scan in a circle inside the range
CreateAreaEx(Float:minx,Float:miny,Float:maxx,Float:maxy) //create an area and scan in a square with min x,min y and max x,and max y
ToggleArea(areaid,bool:toggle)//turn area on/off
Callbacks
pawn Код:
OnPlayerEnterArea(playerid,areaid) //will be called if a player is in the area
OnPlayerLeaveArea(playerid,areaid) //will be called if a player left the area
Defines
Please note that these defines needs to be called BEFORE including (so you have to put these ABOVE the include <gArea> part)
pawn Код:
MAX_AREAS //keep this as low as possible (default = 10)
TIMER_TICKRATE //timer in miliseconds (dont go under the 500 ms for to keep the best performance, default = 1000))
FILTERSCRIPT //define this ONLY when you are using the include inside a filterscript

Example filterscript
pawn Код:
#include <a_samp>
//do this ALWAYS to keep the loops as small as possible (increase performance):
#undef MAX_PLAYERS
#define MAX_PLAYERS 32 //adjust this to the ammount of your serverslots


//defining some settings before including gArea
#define MAX_AREAS 2
#define FILTERSCRIPT

//including gArea
#include <gArea>

public OnFilterScriptInit()
{
    CreateAreaEx(2044.6,1867.797,2114.887,1968.367); //making an square area
    CreateArea(0,0,10); //making a circle area taking x=0,y=0 as center
    return 1;
}

public OnPlayerEnterArea(playerid,areaid) //this will be called once a player entered the area
{
    new string[128];format(string,sizeof string,"playerid %i has entered zoneid %i",playerid,areaid);
    SendClientMessageToAll(0xffffff,string);
    return 1;
}

public OnPlayerLeaveArea(playerid,areaid) //this will be called once a player left the area
{
    new string[128];format(string,sizeof string,"playerid %i has left zoneid %i",playerid,areaid);
    SendClientMessageToAll(0xffffff,string);
    return 1;
}
Changelog
Код:
1.0:
Released
1.1:
callback OnPlayerEnterArea will now only be called once if the player entered
callback OnPlayerLeaveArea added (thanks Donya for the idea!)
Download
Pastebin
Reply


Messages In This Thread
gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by gamer931215 - 03.06.2011, 15:41
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by Meinstad - 03.06.2011, 15:47
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by Donya - 03.06.2011, 15:50
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by juraska - 03.06.2011, 15:57
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by gamer931215 - 03.06.2011, 16:14
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by Swiftz - 03.06.2011, 16:15
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by Michael@Belgium - 03.06.2011, 16:20
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by gamer931215 - 03.06.2011, 16:21
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by Donya - 03.06.2011, 17:04
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by gamer931215 - 03.06.2011, 17:12
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by Donya - 03.06.2011, 18:23
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by gamer931215 - 03.06.2011, 18:36
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by Kwarde - 03.06.2011, 18:40
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by gamer931215 - 03.06.2011, 18:49
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by System64 - 03.06.2011, 18:53
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by Kwarde - 03.06.2011, 18:55
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by gamer931215 - 03.06.2011, 18:57
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by Kwarde - 03.06.2011, 18:58
Respuesta: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by Host-samp - 03.06.2011, 19:11
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by [KO]KillerThriller - 03.06.2011, 19:49
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by Sergei - 03.06.2011, 19:52
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by [KO]KillerThriller - 03.06.2011, 21:02
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by Donya - 03.06.2011, 21:38
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by [KO]KillerThriller - 03.06.2011, 22:00
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by Donya - 03.06.2011, 22:02
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by [KO]KillerThriller - 04.06.2011, 10:33
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by [nL]W0rfleR - 04.06.2011, 10:41
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by Donya - 04.06.2011, 13:48
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by System64 - 14.11.2011, 21:35
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by [LaTinb0y]...$ag3R - 15.11.2011, 03:04
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by KfirRP - 16.11.2011, 10:53
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by ArcherTRP - 19.11.2011, 17:06
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by Minwar - 19.11.2011, 22:15
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by gamer931215 - 20.11.2011, 12:14
Re: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by Minwar - 20.11.2011, 14:43
Respuesta: gArea - Areasystem for adminzones/others ! (Using IsPlayerInArea AND IsPlayerInRangeOfPoint!!!) - by jaiser - 20.11.2011, 18:27

Forum Jump:


Users browsing this thread: 2 Guest(s)