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

Server Help

$
0
0
hey I have this
PHP Code:

    else if (newkeys == && oldkeys == KEY_SECONDARY_ATTACK)
    {
        if (
GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && areatype[playerarea[playerid]][0] == AREA_TYPE_ATM)
        {
            
ShowPlayerDialog2(playeridDIALOG_ATMDIALOG_STYLE_LIST"ATM""Withdraw\nBalance""Select""Cancel");
            
ClearAnimations(playerid);
        }
    } 

PHP Code:

if (dialogid == DIALOG_ATM)
    {
        if (
response)
        {
            if (
GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CUFFED) return SendClientMessage2(playeridCOLOR_RED"Error: You are cuffed!");
            if (
listitem == 0)
            {
                
ShowPlayerDialog2(playeridDIALOG_ATM_WITHDRAWDIALOG_STYLE_INPUT"ATM""Type below how much you want to withdraw.""Withdraw""Cancel");
            }
            else if (
listitem == 1)
            {
                
format(string50"Your bank balance is $%d."dini_Int(AddDirFile(dir_userfilesplayername), "bank"));
                
SendClientMessage2(playeridCOLOR_GREENstring);
            }
        }
        return 
1;
    }

    if (
dialogid == DIALOG_ATM_WITHDRAW)
    {
        if (
GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CUFFED)
            return 
SendClientMessage2(playeridCOLOR_RED"Error: You are cuffed!");
        if (
response)
        {
            
temp1 strval(inputtext);
            if (
temp1 1)
            {
                
ShowPlayerDialog2(playeridDIALOG_ATM_WITHDRAWDIALOG_STYLE_INPUT"ATM""Type below how much you want to withdraw.\n\n{E60026}Invalid amount.""Withdraw""Cancel");
                return 
1;
            }
            if (
temp1 10000)
            {
                
ShowPlayerDialog2(playeridDIALOG_ATM_WITHDRAWDIALOG_STYLE_INPUT"ATM""Type below how much you want to withdraw.\n\n{E60026}Max withdrawal limit is $10000.""Withdraw""Cancel");
                return 
1;
            }
            
temp2 dini_Int(AddDirFile(dir_userfilesplayername), "bank");
            if (
temp1 temp2)
            {
                
ShowPlayerDialog2(playeridDIALOG_ATM_WITHDRAWDIALOG_STYLE_INPUT"ATM""Type below how much you want to withdraw.\n\n{E60026}Your account doesn't hold that amount.""Withdraw""Cancel");
                return 
1;
            }
            
dini_IntSet(AddDirFile(dir_userfilesplayername), "bank"temp2-temp1);
            
GivePlayerMoney(playeridtemp1);
            
format(string100"You have withdrawn $%d. Your new balance is $%d."temp1,temp2-temp1);
            
SendClientMessage2(playeridCOLOR_YELLOWstring);
        }
        else {
            
ShowPlayerDialog2(playeridDIALOG_ATMDIALOG_STYLE_LIST"ATM""Withdraw\nBalance""Select""Cancel");
        }
        return 
1;
    } 

idk why when I use withdraw every time the server get fucked and the commands gets unknown can any one help me?

Viewing all articles
Browse latest Browse all 18226

Trending Articles



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