If statement help
#1

Hey

I want to do the following but i am unsure how.

pawn Код:
if( !IsPlayerInRangeOfPoint( playerid, 2.0, X, Y ,Z ) || !IsPlayerInRangeOfPoint( playerid, 2.0,  X, Y ,Z)) return SendClientMessage(playerid, "Your not in range")
Showplayerdialog...
Even when i am in range it just says your not in range

i want it so if i'm in range of either of the 2 locations it will show the dialog
Reply
#2

PHP код:
if(!IsPlayerInRangeOfPoint(playerid2.0X,) || !IsPlayerInRangeOfPoint(playerid2.0,  X,Z)) return SendClientMessage(playerid, -1,"Your not in range"); 
Reply
#3

its still just sending me the message even if i am inrange of one of the points
Reply
#4

Post the coordinates.
Reply
#5

pawn Код:
if( IsPlayerInRangeOfPoint( playerid, 2.0, X, Y ,Z ) || IsPlayerInRangeOfPoint( playerid, 2.0,  X, Y ,Z ) )
{
    //continue;
}
else
{
    //SetPlayerPos(playerid, X, Y, Z); // Just to debug where the actual place is.
}
Reply
#6

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 2.0, X, Y ,Z ) || IsPlayerInRangeOfPoint(playerid, 2.0, X, Y ,Z ))
{
    //Do stuff
}
else return SendClientMessage(playerid, -1,"Your not in range");
Edit: Lorenc_ beat me.
Reply
#7

You should use && instead ||.
Reply
#8

Thanks guys worked

pawn Код:
OnUserHelpPlayer(userid)
{
    rep++;
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)