[Include] [INC]Area functions and callbacks.
#1

Area functions and callbacks

This is a simple include file that can be very helpful for many different things. It's quick and easy to implement in your script.

Functions

native CreateArea(x1, y1, x2, y2) //Format : MaxX, MaxY, MinX, MinY - Returns the areaid
native DestroyArea(areaid)
native IsPlayerInArea(playerid, areaid)
native ReturnPlayerArea(playerid)
native Areas_OnPlayerConnect(playerid)
native Areas_OnPlayerDisconnect(playerid)
native Areas_OnGameModeInit()


To use
Add
pawn Code:
#include <areas> // Top of script
And add the following functions to their specific callbacks in the script you will be using them in.
pawn Code:
Areas_OnPlayerConnect(playerid) // OnPlayerConnect
Areas_OnPlayerDisconnect(playerid) //OnPlayerDisconnect
Areas_OnGameModeInit() //OnGameModeInit

public OnPlayerEnterArea(playerid,areaid)//Somewhere else not in a function
{
   return 1;
}

public OnPlayerExitArea(playerid,areaid)//Somewhere else not in a function
{
   return 1;
}
To create areas
Simply go in game and save the coordinates for each limit for the area.

_N(MaxY)_
| |
W(MaxX)| |E(MinX)
|_______|
S(MinY)

Then plug in the coordinates.

http://depositfiles.com/files/j5r6og7tb
http://pastebin.com/m5424ff87 - Paste in notepad - file/save as/Areas.inc

Enjoy.
Reply


Messages In This Thread
[INC]Area functions and callbacks. - by Backwardsman97 - 08.01.2009, 02:14
Re: [INC]Area functions and callbacks. - by farse - 08.01.2009, 03:21
Re: [INC]Area functions and callbacks. - by Francis[French] - 08.01.2009, 03:30
Re: [INC]Area functions and callbacks. - by 56avenue - 08.01.2009, 03:33
Re: [INC]Area functions and callbacks. - by Backwardsman97 - 08.01.2009, 03:35
Re: [INC]Area functions and callbacks. - by OKStyle - 15.01.2009, 13:40
Re: [INC]Area functions and callbacks. - by sciman001 - 04.11.2011, 03:45
Re: [INC]Area functions and callbacks. - by Backwardsman97 - 04.11.2011, 05:56
Re: [INC]Area functions and callbacks. - by EvgeN 1137 - 04.11.2011, 07:09

Forum Jump:


Users browsing this thread: 3 Guest(s)