Plants in zone
#1

So what i'm trying to do is, if player is not in the zone he can't plant weed and if he is in it he can.
Here's the polygon that i've created, now can someone please tell me how to make something that will check if he is in that polygon

http://pastebin.com/mgpZBjbN
Reply
#2

anyone ?
Reply
#3

Use Incognito Streamer, the areas are very effective.
Reply
#4

Yeah but how to select area to make it usable ?
Reply
#5

Код:
IsPlayerInDynamicArea(playerid, areaid, recheck = 0);
Reply
#6

Yeah but there is no id of my area thats why i created the polygon around the place i want to be the area.
Reply
#7

In weed command you put this check:
Код:
if(IsPlayerInDynamicArea(playerid, zones[0]))
{
//DoStuff
}
Reply
#8

So this is how i've done it and it's not working, it's saying Not in the zone !

pawn Код:
poligonzone[0] = CreateDynamicPolygon(gsfzona1);
poligonzone[1] = CreateDynamicPolygon(gsfzona2);
pawn Код:
new Float:gsfzona1[] = {
        -1103.0,-914.0,-1163.0,-914.0,-1192.0,-933.0,-1198.0,-979.0,-1171.0,-996.0,-1098.0,-999.0,-1099.0,-1031.0,-1068.0,-1059.0,-1069.0,-938.0,-1103.0,-914.0
};
new Float:gsfzona2[] = {
        -1034.0,-1060.0,-1034.0,-1033.0,-1067.0,-1000.0,-1068.0,-1058.0,-1034.0,-1060.0
};
pawn Код:
if(!IsPlayerInDynamicArea(playerid, poligonzone[0]) || !IsPlayerInDynamicArea(playerid, poligonzone[1])) return SCM(playerid, GREY, "* Not in the zone  !");
Reply
#9

use your zone , i don't know it's gang zone or something esle but there's a function that we call it
IsPlayerInArea
this is the function :
PHP код:
stock IsPlayerInArea(playeridFloat:MinXFloat:MinYFloat:MaxXFloat:MaxY)
{
    new 
Float:XFloat:YFloat:Z;
    
GetPlayerPos(playeridXYZ);
    if(
>= MinX && <= MaxX && >= MinY && <= MaxY) {
        return 
1;
    }
    return 
0;

Reply
#10

Yeah, but how to use my polygon zones with IsPlayerInArea function ?
Reply
#11

anyone ?
Reply
#12

anyone
Reply
#13

?/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)