PDA

View Full Version : Creating area


HondaCBR
30/12/2011, 09:22 AM
I want to create area in the skatepark, so if you in there and type a command something will happen, but ignore that for now, all I need now is to create the area, so could someone show me how to do that and where to use each cord?

RED: 1862.8195,-1449.9850,13.4849
PINK:1862.7400,-1351.7928,13.4849
YELLOW:1976.1002,-1351.8217,23.8854
BLUE: 1976.1165,-1449.9783,13.4918

http://img707.imageshack.us/img707/5761/skatepark.png

fangoth1
30/12/2011, 09:25 AM
use
public OnGameModeInit()
{

Aira
30/12/2011, 09:47 AM
Your saying GangZone EH?

HondaCBR
30/12/2011, 10:57 AM
That didn't help. I need the code for making an area, I dont need colour there or anything on the map, I just need that area so when you type for example /area, it will say "You are at the skatepark"

vassilis
30/12/2011, 12:04 PM
GangZoneCreate(Float:minx, Float:miny, Float:maxx, Float:maxy)

BigETI
30/12/2011, 12:13 PM
stock IsInSkatePark(playerid)
{
if(!IsPlayerConnected(playerid)) return false;
new Float:pPos[3];
GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
if(pPos[0] >= 1862.7400 && pPos[0] <= 1976.1165 && pPos[1] >= -1449.9783 && pPos[1] <= -1351.8217) return true;
return false;
}

Then use it like this:
//Somewhere in your code
if(IsInSkatePark(playerid)) SendClientMessage(playerid, 0xFF0000FF, "You are in Skate Park.");

HondaCBR
30/12/2011, 12:19 PM
Would this work exactly in that area?

BigETI
30/12/2011, 10:34 PM
yes...

Jefff
30/12/2011, 10:47 PM
You can use

stock IsInSkatePark(playerid)
{
new Float:pPos[3];
GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
return (pPos[0] >= 1862.7400 && pPos[0] <= 1976.1165 && pPos[1] >= -1449.9783 && pPos[1] <= -1351.8217);
}