check if player is inside a gang zone?
#1

hi i wnna create a safe zone

but how do i check if the player is inside a gang zone?

Reply
#2

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.
Reply
#3

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
}
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)