Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Checking if player is in interior to execute the command

$
0
0
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:
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;
        }
}


Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>