Heyho Leute,
ich habe folgendes gemacht:
if(strcmp(cmd, "/withdraw", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsAtATM(playerid))
{
ShowPlayerDialog(playerid, 333, DIALOG_STYLE_LIST, "Sparkasse", "100$\n1000$\n2500$\n5000$\n7500$\n10000$\n20000$\nAnderer Betrag", "Abheben", "Abbruch");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Du bist nicht in der Bank oder an keinem Automaten !");
return 1;
}
}
return 1;
}
if(strcmp(cmd, "/deposit", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsAtATM(playerid))
{
ShowPlayerDialog(playerid, 555, DIALOG_STYLE_LIST, "Sparkasse", "100$\n1000$\n2500$\n5000$\n7500$\n10000$\n20000$\nAnderer Betrag", "Einzahlen", "Abbruch");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Du bist nicht in der Bank oder an keinem Automaten !");
return 1;
}
}
return 1;
}
new tmp[256];
new cashdeposit = strval(tmp);
new s[128];
new string[256];
if(dialogid == 333)
{
if(response)
{
if(listitem == 0)
{
PlayerInfo[playerid][pBank]=PlayerInfo[playerid][pBank]-100;
GivePlayerMoney(playerid, 100);
SendClientMessage(playerid, COLOR_GREEN,"Du hast 100$ von deinem Konto abgehoben");
format(string, sizeof(string), "Kontostand: $%d", PlayerInfo[playerid][pBank]);
SendClientMessage(playerid, COLOR_GREEN, string);
}
if(listitem == 1)
{
PlayerInfo[playerid][pBank]=PlayerInfo[playerid][pBank]-1000;
GivePlayerMoney(playerid, 1000);
SendClientMessage(playerid, COLOR_GREEN,"Du hast 1000$ von deinem Konto abgehoben");
format(string, sizeof(string), "Kontostand: $%d", PlayerInfo[playerid][pBank]);
SendClientMessage(playerid, COLOR_GREEN, string);
}
if(listitem == 2)
{
PlayerInfo[playerid][pBank]=PlayerInfo[playerid][pBank]-2500;
GivePlayerMoney(playerid, 2500);
SendClientMessage(playerid, COLOR_GREEN,"Du hast 2500$ von deinem Konto abgehoben");
format(string, sizeof(string), "Kontostand: $%d", PlayerInfo[playerid][pBank]);
SendClientMessage(playerid, COLOR_GREEN, string);
}
if(listitem == 3)
{
PlayerInfo[playerid][pBank]=PlayerInfo[playerid][pBank]-5000;
GivePlayerMoney(playerid, 5000);
SendClientMessage(playerid, COLOR_GREEN,"Du hast 5000$ von deinem Konto abgehoben");
format(string, sizeof(string), "Kontostand: $%d", PlayerInfo[playerid][pBank]);
SendClientMessage(playerid, COLOR_GREEN, string);
}
if(listitem == 4)
{
PlayerInfo[playerid][pBank]=PlayerInfo[playerid][pBank]-7500;
GivePlayerMoney(playerid, 7500);
SendClientMessage(playerid, COLOR_GREEN,"Du hast 7500$ von deinem Konto abgehoben");
format(string, sizeof(string), "Kontostand: $%d", PlayerInfo[playerid][pBank]);
SendClientMessage(playerid, COLOR_GREEN, string);
}
if(listitem == 5)
{
PlayerInfo[playerid][pBank]=PlayerInfo[playerid][pBank]-10000;
GivePlayerMoney(playerid, 10000);
SendClientMessage(playerid, COLOR_GREEN,"Du hast 10000$ von deinem Konto abgehoben");
format(string, sizeof(string), "Kontostand: $%d", PlayerInfo[playerid][pBank]);
SendClientMessage(playerid, COLOR_GREEN, string);
}
if(listitem == 6)
{
PlayerInfo[playerid][pBank]=PlayerInfo[playerid][pBank]-20000;
GivePlayerMoney(playerid, 20000);
SendClientMessage(playerid, COLOR_GREEN,"Du hast 20000$ von deinem Konto abgehoben");
format(string, sizeof(string), "Kontostand: $%d", PlayerInfo[playerid][pBank]);
SendClientMessage(playerid, COLOR_GREEN, string);
}
if(listitem == 7)
{
format(s,sizeof(s),"Tippe hier den gewünschten Betrag ein:");
ShowPlayerDialog(playerid,444,DIALOG_STYLE_INPUT,"Sparkasse",s,"abheben","Abbrechen");
}
}
}
if(dialogid == 444)
{
if(response)
{
GivePlayerMoney(playerid,cashdeposit);
PlayerInfo[playerid][pBank]=PlayerInfo[playerid][pBank]-cashdeposit;
format(string, sizeof(string), "Du hast $%d von der Bank abgehoben Kontostand: $%d ", cashdeposit,PlayerInfo[playerid][pBank]);
SendClientMessage(playerid, COLOR_GREEN, string);
}
}
So es klappt "alles" einwandfrei, nur dass hier nicht:
if(dialogid == 444)
{
if(response)
{
GivePlayerMoney(playerid,cashdeposit);
PlayerInfo[playerid][pBank]=PlayerInfo[playerid][pBank]-cashdeposit;
format(string, sizeof(string), "Du hast $%d von der Bank abgehoben Kontostand: $%d ", cashdeposit,PlayerInfo[playerid][pBank]);
SendClientMessage(playerid, COLOR_GREEN, string);
}
}
also wenn ich in der Bank bin und gebe /withdraw ein und tippe auf anderen Betrag, dann öffnet sich zwar das andere Dialog, kann aber kein Geld einzahlen ? Da steht dann immer du hast 0$ eingezahlt xD