[Include] rl_areas - Create your own areas in one line!
#1

RL_AREAS - Create your own areas in one line!
version: 0.2.4

Hello,
First of all sorry for my bad English, if i had any mistake please correct me.
I made little include that gives you option to create area in just one line!
It's very simple, working on just one timer (if you doesn't have any area created the timer not working) and check for most close area.

Functions
Code:
// IsValidAreaID(areaid)
if(IsValidAreaID(1))
	return SendClientMessage(0, -1, "Area number 1 is valid and in use!");
Check if the given area is valid and in use.
Return: Bool (true / false)

Code:
// CreateArea(X, Y, Z, Radius = DEFAULT_RADIUS, Interior = -1, VirtualWorld = -1)
new
	myArea = CreateArea(0.0, 0.0, 0.0, 20.0, -1, -1);
Create circle area in radius that defined by you.
Return: Int (area ID)

Code:
// DestroyArea(areaid)
new
	myArea = CreateArea(0.0, 0.0, 0.0, 20.0, -1, -1);
DestroyArea(myArea);
Destroy created area, must be valid!
Return: Bool (success / fail)

Code:
// IsPlayerInArea(playerid, areaid)
if(IsPlayerInArea(0, 1))
	return SendClientMessage(0, -1, "You are in area number 1!");
Check if player in specific area
Return: Bool (true / false)

Code:
// IsPlayerInAnyArea(playerid)
if(IsPlayerInAnyArea(0))
	return SendClientMessage(0, -1, "You are in one of server areas!");
Check if player in any of created areas
Return: Bool (true / false)

Code:
// GetPlayerArea(playerid)
new
	areastr[64];
format(areastr, 64, "You are in area number %d!", GetPlayerArea(0));
return SendClientMessage(0, -1, areastr);
Get player area ID
Return: Int (area ID)

CallBacks
Code:
public OnPlayerEnterArea(playerid, areaid) {

}
Called when player enters area

Code:
public OnPlayerExitArea(playerid, areaid) {

}
Called when player exits area

Credits
Quote:

* Thanks to:
* RaFaeL - Scripting, PAWN
* SA:MP Team past, present, future - SA:MP.

Download
v0.2.4:
Pastebin - http://pastebin.com/cKyP0x1C

Bugs & Suggestions
Quote:

Known bugs:
* None

Quote:

Suggestions:
* ADD CUBE area type
* ADD TRAINGLE area type
* ADD PerPLayer area creating
* Allow to non meter Z param

Whats new?
Quote:

None.

Enjoy!
Reply
#2

wow i like it
אני גם מישראל
אני זה fxp146145 מהפורום.
Reply
#3

Quote:
Originally Posted by ofekw2
View Post
wow i like it
אני גם מישראל
אני זה fxp146145 מהפורום.
Thanks, but only English in this selection. How many time I can say it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)