SA-MP Forums Archive
Checking if player is in interior to execute the command - 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: Checking if player is in interior to execute the command (/showthread.php?tid=641865)



Checking if player is in interior to execute the command - Escobabe - 21.09.2017

So, i want when the player types /bank and he is not in the interior, it returns the message "You're not at the bank to use this command".
But when the player enters the bank interior (in this case Planning Department at LV) it can use the command.

Here is the code:
Код:
CMD:bank( playerid, params[ ] ) {
        if ( !bAcc{ playerid } ) {
         if (!IsPlayerInRangeOfPoint(playerid, 5.0, 2093.3892,1162.2319,11.6552)) return SendClientMessage(playerid,0xFFFFFF,"You need to be near the ATM ($ sign) on map.");
            ShowPlayerDialog( playerid, DIALOG_BANK2, DIALOG_STYLE_MSGBOX, "{FFFFFF}Bank Account",
            "{FFFFFF}You don't have a bank account yet.\nWould you like to create a bank account?", "Yes", "No" );
            return true;
        }
        else {
                if (!IsPlayerInRangeOfPoint(playerid, 5.0, 2093.3892,1162.2319,11.6552)) return SendClientMessage(playerid,0xFFFFFF,"You need to be near the ATM ($ sign) on map.");
                ShowPlayerDialog( playerid, DIALOG_BANK, DIALOG_STYLE_LIST, "{FFFFFF}Bank Account",
                "{FFFFFF}Balance\nDeposit\nWithdraw", "Select", "Cancel" );
                return true;
        }
}



Re: Checking if player is in interior to execute the command - Escobabe - 21.09.2017

Fixed.