[Include] Player Area's (OnPlayerEnterArea etc)
#1

Hi there!
First of all: I don't know if it's made yet. As far as I know, it isn't. I couldn't find it in the search option, so I decided to make it.
With this include, you can create area's and remove/update them. With a callback, you can check if a player did enter/exit an area.

Functions

Код:
IsPlayerInArea(playerid, areaid); - Check if a player is in 'areaid'

IsAreaCreated(areaid); - Check if the 'areaid' is created or not

GetLowestFreeAreaID(); - You don't need to use it. This is to prevent eventually bugs. It checks the first free area id

CreateArea(Float:MinX, Float:MaxX, Float:MinY, Float:MaxY, Float:MinZ = -1.0, Float:MaxZ = -1.0) - Creates an area

CreateArea2(Float:MinX, Float:MinY, Float:MaxX, Float:MaxY, Float:MinZ = -1.0, Float:MaxZ = -1.0) - Creates an area (gangzone format)

CreateArea3(Float:MaxX, Float:MinX, Float:MaxY, Float:MinY, Float:MinZ = -1.0, Float:MaxZ = -1.0) - Creates an area (worldbounds format)

DeleteArea(areaid) - Delete an area

UpdateArea(areaid, Float:MinX, Float:MaxX, Float:MinY, Float:MaxY, Float:MinZ = -1.0, Float:MaxZ = -1.0) - Updates an area it's position

UpdateArea2(areaid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY, Float:MinZ = -1.0, Float:MaxZ = -1.0) - Updates an area it's position (gangzone format)

UpdateArea3(areaid, Float:MaxX, Float:MinX, Float:MaxY, Float:MinY, Float:MinZ = -1.0, Float:MaxZ = -1.0) - Updates an area it's position (worldbounds format)

GetAreaInfo(areaid, &Float:MinX, &Float:MaxX, &Float:MinY, &Float:MaxY, &Float:MinZ, &Float:MaxZ) - Get's the position of an area (use variables to get the info!)
Installation
This isn't hard. Just make a new file in your pawno/include folder and put the content from the download in it.
Then, include the function in your filterscript/gamemode.
You can use the next callbacks:

OnPlayerEnterArea(playerid, areaid);
OnPlayerExitArea(playerid, areaid);


Download (v1.1)
http://pastebin.com/qmVwrhLg

Changelog
v1.0:
* Script created and released

v1.1:
* Checks if "IsPlayerInArea" exists. If it does, function'll be named as "IsPlayerInAreaEx".

Test
I've tested it with this gamemode:
http://pastebin.com/zQzmaZti
Just go to ganton and enter+exit it. You'll get the message that you'd enter/exit it.
I'd also did do it on Persing Square. Both working! GetAreaInfo did also work.

Known bugs
None yet. Please report them


I hope that something like this didn't exist yet. Really... :P

Regards,
Kevin
Reply


Messages In This Thread
Player Area's (OnPlayerEnterArea etc) - by Kwarde - 21.02.2011, 17:55
Re: Player Area's (OnPlayerEnterArea etc) - by wups - 21.02.2011, 18:11
Re: Player Area's (OnPlayerEnterArea etc) - by Marricio - 21.02.2011, 18:14
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 21.02.2011, 18:42
Re: Player Area's (OnPlayerEnterArea etc) - by sleepysnowflake - 21.02.2011, 18:43
Re: Player Area's (OnPlayerEnterArea etc) - by Hiddos - 21.02.2011, 18:51
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 21.02.2011, 18:55
Re: Player Area's (OnPlayerEnterArea etc) - by wups - 21.02.2011, 19:27
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 21.02.2011, 19:31
Re: Player Area's (OnPlayerEnterArea etc) - by iMonk3y - 21.02.2011, 19:38
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 21.02.2011, 19:39
Re: Player Area's (OnPlayerEnterArea etc) - by justsomeguy - 21.02.2011, 19:41
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 21.02.2011, 19:42
Re: Player Area's (OnPlayerEnterArea etc) - by justsomeguy - 21.02.2011, 20:23
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 22.02.2011, 05:23
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 21.04.2011, 14:22
Re: Player Area's (OnPlayerEnterArea etc) - by justsomeguy - 24.04.2011, 15:16
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 27.04.2011, 08:28
Re: Player Area's (OnPlayerEnterArea etc) - by Markx - 27.04.2011, 08:35
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 27.04.2011, 08:57
Re: Player Area's (OnPlayerEnterArea etc) - by GangsTa_ - 25.07.2011, 07:01
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 25.07.2011, 08:40
Re: Player Area's (OnPlayerEnterArea etc) - by wups - 25.07.2011, 08:52
Re: Player Area's (OnPlayerEnterArea etc) - by GangsTa_ - 25.07.2011, 08:55
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 25.07.2011, 09:25
Re: Player Area's (OnPlayerEnterArea etc) - by GangsTa_ - 25.07.2011, 09:30
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 25.07.2011, 09:32
Re: Player Area's (OnPlayerEnterArea etc) - by GangsTa_ - 25.07.2011, 09:34
Re: Player Area's (OnPlayerEnterArea etc) - by CoaPsyFactor - 25.07.2011, 09:35
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 25.07.2011, 09:38
Re: Player Area's (OnPlayerEnterArea etc) - by Kaperstone - 10.08.2011, 04:14
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 10.08.2011, 05:44
Re: Player Area's (OnPlayerEnterArea etc) - by CoDeZ - 27.08.2012, 13:53
Re: Player Area's (OnPlayerEnterArea etc) - by Kwarde - 20.02.2013, 00:47
Re: Player Area's (OnPlayerEnterArea etc) - by Pottus - 20.02.2013, 04:00

Forum Jump:


Users browsing this thread: 2 Guest(s)