IsPlayerInRangeOfPoint question.
#1

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

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;
}
Reply
#3

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


Forum Jump:


Users browsing this thread: 1 Guest(s)