check if player is inside a gang zone? - 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: check if player is inside a gang zone? (
/showthread.php?tid=145501)
check if player is inside a gang zone? -
Joruz_Tellino - 02.05.2010
hi i wnna create a safe zone
but how do i check if the player is inside a gang zone?
Re: check if player is inside a gang zone? -
Backwardsman97 - 02.05.2010
pawn Код:
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
if((X < GANG_X_MAX) && (X < GAME_X_MIN) && (Y < GANG_Y_MAX) && (Y > GANG_Y_MIN))
{
//He's in the gang zone
}
Just replace the coordinates with the correct ones.
Re: check if player is inside a gang zone? -
Mauzen - 02.05.2010
Quote:
Originally Posted by Baked-Banana
pawn Код:
new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid,X,Y,Z); if((X < GANG_X_MAX) && (X < GAME_X_MIN) && (Y < GANG_Y_MAX) && (Y > GANG_Y_MIN)) { //He's in the gang zone }
Just replace the coordinates with the correct ones.
|
You forgot to hold shift at x_min
it has to be (just to avoid questions if copied and pasted)
pawn Код:
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
if((X < GANG_X_MAX) && (X > GAME_X_MIN) && (Y < GANG_Y_MAX) && (Y > GANG_Y_MIN))
{
//He's in the gang zone
}
Re: check if player is inside a gang zone? -
Torran - 02.05.2010
Actulley your both wrong xd
Your both using GANG then you suddenly switch to GAME then you go back to GANG,
I just use IsPlayerInArea for checking if players are inside gangzone though