If statement help - 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)
+--- Thread: If statement help (
/showthread.php?tid=283880)
If statement help -
[DK]Dark_Knight - 17.09.2011
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
Re: If statement help -
Jafet_Macario - 17.09.2011
PHP код:
if(!IsPlayerInRangeOfPoint(playerid, 2.0, X, Y ,Z ) || !IsPlayerInRangeOfPoint(playerid, 2.0, X, Y ,Z)) return SendClientMessage(playerid, -1,"Your not in range");
Re: If statement help -
[DK]Dark_Knight - 17.09.2011
its still just sending me the message even if i am inrange of one of the points
Re: If statement help -
Tee - 17.09.2011
Post the coordinates.
Re: If statement help -
Lorenc_ - 17.09.2011
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.
}
Re: If statement help -
Tee - 17.09.2011
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.
Re: If statement help -
=WoR=Varth - 17.09.2011
You should use && instead ||.
Re: If statement help -
[DK]Dark_Knight - 17.09.2011
Thanks guys worked
pawn Код:
OnUserHelpPlayer(userid)
{
rep++;
return 1;
}