[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
#2

It's a good idea
Good Work
Reply
#3

Sucks.



Naaah, good
Reply
#4

Quote:
Originally Posted by [SAP
Francis ]
Sucks.



Naaah, good
lol^
Nice work 10/10
Reply
#5

Quote:
Originally Posted by Avenue
Quote:
Originally Posted by [SAP
Francis ]
Sucks.



Naaah, good
lol^
Nice work 10/10
Thanks :P
Reply
#6

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)
Reply
#7

link dead
Reply
#8

This script is over 2 years old and it wasn't very good then lol.
Reply
#9

Incognito Streamer Plugin better.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)