Dialog input fucking up!
#1

pawn Код:
if(dialogid == 5)
    {
        if(response)
        {
            new deposit = strval(inputtext);
            if(PlayerInfo[playerid][pBank] >= deposit)
            {
                PlayerInfo[playerid][pBank] = PlayerInfo[playerid][pBank]-deposit;
                GivePlayerCash(playerid, -deposit);
                format(string, sizeof(string), "[Info:] You have deposit $%d, new balance: $%d", deposit,PlayerInfo[playerid][pBank]);
                SendClientMessage(playerid, COLOR_WHITE, string);
                PlayerActionMessage(playerid,15.0,"puts some money in his bankaccount");
                PlayerSave(playerid);
            }
        }
    }
pawn Код:
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_INPUT, "Deposit", "Amount:", "Deposit", "Cancel");
When I deposit something nothing happens!
Reply
#2

pawn Код:
GivePlayerCash(playerid, GetPlayerCash(playerid)-deposit);
hmm try that?
Reply
#3

Hmm yeah, thanks!

EDIT: Still not working!
Reply
#4

whats not working with the code atm?
Reply
#5

Nothing happends when I deposit something. It's maybe with the new deposit = strval(inputtext); but idk.
Reply
#6

Код:
if(PlayerInfo[playerid][pBank] >= deposit)
            {
Im hoping pBank has a value
Reply
#7

It has, contains the players bank amount. This dialog thing is for the ATM machines
Reply
#8

pawn Код:
if(dialogid == 5)
    {
        if(response)
        {
            new deposit = strval(inputtext);
            if(GetPlayerCash(playerid) >= deposit)
            {
                PlayerInfo[playerid][pBank] = PlayerInfo[playerid][pBank]-deposit;
                GivePlayerCash(playerid, -deposit);
                format(string, sizeof(string), "[Info:] You have deposit $%d, new balance: $%d", deposit,PlayerInfo[playerid][pBank]);
                SendClientMessage(playerid, COLOR_WHITE, string);
                PlayerActionMessage(playerid,15.0,"puts some money in his bankaccount");
                PlayerSave(playerid);
            }
        }
    }
You mean something like this?
EDIT: Changed GetPlayerMoney() to GetPlayerCash()
Reply
#9

Thank you so much guys! Really helpful
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)