hey I have this
idk why when I use withdraw every time the server get fucked and the commands gets unknown can any one help me?
PHP Code:
else if (newkeys == 0 && oldkeys == KEY_SECONDARY_ATTACK)
{
if (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && areatype[playerarea[playerid]][0] == AREA_TYPE_ATM)
{
ShowPlayerDialog2(playerid, DIALOG_ATM, DIALOG_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(playerid, COLOR_RED, "Error: You are cuffed!");
if (listitem == 0)
{
ShowPlayerDialog2(playerid, DIALOG_ATM_WITHDRAW, DIALOG_STYLE_INPUT, "ATM", "Type below how much you want to withdraw.", "Withdraw", "Cancel");
}
else if (listitem == 1)
{
format(string, 50, "Your bank balance is $%d.", dini_Int(AddDirFile(dir_userfiles, playername), "bank"));
SendClientMessage2(playerid, COLOR_GREEN, string);
}
}
return 1;
}
if (dialogid == DIALOG_ATM_WITHDRAW)
{
if (GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CUFFED)
return SendClientMessage2(playerid, COLOR_RED, "Error: You are cuffed!");
if (response)
{
temp1 = strval(inputtext);
if (temp1 < 1)
{
ShowPlayerDialog2(playerid, DIALOG_ATM_WITHDRAW, DIALOG_STYLE_INPUT, "ATM", "Type below how much you want to withdraw.\n\n{E60026}Invalid amount.", "Withdraw", "Cancel");
return 1;
}
if (temp1 > 10000)
{
ShowPlayerDialog2(playerid, DIALOG_ATM_WITHDRAW, DIALOG_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_userfiles, playername), "bank");
if (temp1 > temp2)
{
ShowPlayerDialog2(playerid, DIALOG_ATM_WITHDRAW, DIALOG_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_userfiles, playername), "bank", temp2-temp1);
GivePlayerMoney(playerid, temp1);
format(string, 100, "You have withdrawn $%d. Your new balance is $%d.", temp1,temp2-temp1);
SendClientMessage2(playerid, COLOR_YELLOW, string);
}
else {
ShowPlayerDialog2(playerid, DIALOG_ATM, DIALOG_STYLE_LIST, "ATM", "Withdraw\nBalance", "Select", "Cancel");
}
return 1;
}