SA-MP Forums Archive
Dialog input fucking up! - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dialog input fucking up! (/showthread.php?tid=211934)



Dialog input fucking up! - Flyfishes - 16.01.2011

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!


Re: Dialog input fucking up! - Lorenc_ - 16.01.2011

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


Re: Dialog input fucking up! - Flyfishes - 16.01.2011

Hmm yeah, thanks!

EDIT: Still not working!


Re: Dialog input fucking up! - Lorenc_ - 16.01.2011

whats not working with the code atm?


Re: Dialog input fucking up! - Flyfishes - 16.01.2011

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


Re: Dialog input fucking up! - Lorenc_ - 16.01.2011

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


Re: Dialog input fucking up! - Flyfishes - 16.01.2011

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


Re: Dialog input fucking up! - armyoftwo - 16.01.2011

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()


Re: Dialog input fucking up! - Flyfishes - 16.01.2011

Thank you so much guys! Really helpful