SA-MP Forums Archive
IsPlayerInArea - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: IsPlayerInArea (/showthread.php?tid=275331)



IsPlayerInArea - StR_MaRy - 09.08.2011

hi, how i can put a public IsPlayerInArea

for example lock at this pictures.

http://postimage.org/image/2xx68jp2c/


Re: IsPlayerInArea - Sascha - 09.08.2011

https://sampwiki.blast.hk/wiki/Areacheck


Re: IsPlayerInArea - StR_MaRy - 09.08.2011

thanks but at the

public isPlayerInArea()
{
new Float:X, Float:Y, Float:Z; //We use this to store player position
for(new i=0; i < MAX_PLAYERS; i++) //This line defines a name for all player, the name is "i"
{
GetPlayerPos(i, X, Y, Z); //Here we are storing the player position on the variables X, Y, and Z defined previously
if (X <= -3915 && X >= -3694 && Y <= 401 && Y >= 37)
/* This line is the important one!. Here, is where you change those numbers, by the ones
you get from the /pos command. As you can see, those coordinates, are only the X and Y ones, the Z
doesnt matter*/
{
SetPlayerHealth(i, -999999.9); //This will ensure, that our player gets killed if he tries to enter
}
}
}

what i type ? the coordonats but ar 2 X and 2 Y if (X <= -3915 && X >= -3694 && Y <= 401 && Y >= 37) tell me an example pls


Re: IsPlayerInArea - Sascha - 09.08.2011

pawn Код:
if(X >= -3915 && X <= -3694 && Y <= 401 && Y >= 37)
-3915 is smaller than -3694 (negative number) :P


Re: IsPlayerInArea - StR_MaRy - 09.08.2011

sorry to disturb you but i type in game the command /pos and give me some coordonats

X: 1719 Y: -1856 && Z: 13

tell me an example if (X <= -3915 && X >= -3694 && Y <= 401 && Y >= 37) put my coordonats on this pls i don't see an Z on this i see 2 X and 2 Y and sorry im not a verry good scripter and for my bad english


Re: IsPlayerInArea - Sascha - 09.08.2011

you need to get 2 corner points..
e.g. the left down corner and the right top corner of the area you want to have...
or the right down corner and the left top corner...


Re: IsPlayerInArea - StR_MaRy - 09.08.2011

this ar the position of left and right

Position Left = X: 640 , Y: -1315 , Z: 13
Position Right = X: 631 , Y: -1223 , Z: 18

show me an example: if (X <= -3915 && X >= -3694 && Y <= 401 && Y >= 37) put my coordonats here pls

or were i put them ...


Re: IsPlayerInArea - Joey Tucker - 09.08.2011

if(X <= 640 && X >= 631 && Y <= -1223 && Y >= -1315)

Anything else?


Re: IsPlayerInArea - StR_MaRy - 09.08.2011

1 more if i want to put another InArea how i can ?


Re: IsPlayerInArea - StR_MaRy - 09.08.2011

i put an sendclientmessage and he send message wen i am in that teritori but only on the right corner wy ? i want all the base the gangzone