IsPlayerInRangeOfPoint question. - 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: IsPlayerInRangeOfPoint question. (
/showthread.php?tid=464821)
IsPlayerInRangeOfPoint question. -
CesarLT - 19.09.2013
Hello, I am new to using this function and I am wondering, I've this in my script:
pawn Код:
CMD:buyweapon(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, 1712.5798,-1640.3907,20.2239))
{
ShowPlayerDialog(playerid, 13, DIALOG_STYLE_MSGBOX, "Test", "Test", "Close", "");
}
return 1;
}
Now, if works just fine, BUT I need it to return a negative answer (sendclientmessage) if the player is not near it.
ex:
pawn Код:
sendclientmessage(playerid, -1, "You're not at the weapon shop, so you're not able to buy a gun.");
How can I make it happen? Thanks in advance.
Re: IsPlayerInRangeOfPoint question. -
xganyx - 19.09.2013
pawn Код:
CMD:buyweapon(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, 1712.5798,-1640.3907,20.2239))
{
ShowPlayerDialog(playerid, 13, DIALOG_STYLE_MSGBOX, "Test", "Test", "Close", "");
}
else return SendClientMessage(playerid, -1, "You're not at the weapon shop, so you're not able to buy a gun.");
return 1;
}
Re: IsPlayerInRangeOfPoint question. -
CesarLT - 19.09.2013
Quote:
Originally Posted by xganyx
pawn Код:
CMD:buyweapon(playerid, params[]) { if(IsPlayerInRangeOfPoint(playerid, 5.0, 1712.5798,-1640.3907,20.2239)) { ShowPlayerDialog(playerid, 13, DIALOG_STYLE_MSGBOX, "Test", "Test", "Close", ""); } else return SendClientMessage(playerid, -1, "You're not at the weapon shop, so you're not able to buy a gun."); return 1; }
|
Thanks.