[Include] [INC]Area functions and callbacks. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (
https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (
https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] [INC]Area functions and callbacks. (
/showthread.php?tid=60870)
[INC]Area functions and callbacks. -
Backwardsman97 - 08.01.2009
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.
Re: [INC]Area functions and callbacks. -
farse - 08.01.2009
It's a good idea
Good Work
Re: [INC]Area functions and callbacks. -
Francis[French] - 08.01.2009
Sucks.
Naaah, good
Re: [INC]Area functions and callbacks. -
56avenue - 08.01.2009
Quote:
Originally Posted by [SAP
Francis ]
Sucks.
Naaah, good
|
lol^
Nice work 10/10
Re: [INC]Area functions and callbacks. -
Backwardsman97 - 08.01.2009
Quote:
Originally Posted by Avenue
Quote:
Originally Posted by [SAP
Francis ]
Sucks.
Naaah, good
|
lol^
Nice work 10/10
|
Thanks :P
Re: [INC]Area functions and callbacks. -
OKStyle - 15.01.2009
Nice work!
But why in the right side: minX, when it's maxX?
And your include can't work with Float data in
CreateArea.
Code:
CreateArea(-2116.7009,3166.4336,-3039.0186,2103.0229);
Give:
Code:
warning 213: tag mismatch
How to fix:
1) Change
native CreateArea(x1, y1, x2, y2) on
native CreateArea(Float1, Float:y1, Float2, Float:y2)
2) Change
stock CreateArea(x1, y1, x2, y2) on
stock CreateArea(Float1, Float:y1, Float2, Float:y2)
Re: [INC]Area functions and callbacks. -
sciman001 - 04.11.2011
link dead
Re: [INC]Area functions and callbacks. -
Backwardsman97 - 04.11.2011
This script is over 2 years old and it wasn't very good then lol.
Re: [INC]Area functions and callbacks. -
EvgeN 1137 - 04.11.2011
Incognito Streamer Plugin better.