Hallo.
Habe Mal Ein bank System Gescripter doch
es kommen keine errors oder nur halt es geht nicht
Bitte um Hilfe
Code
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
new string[256];
if(listitem == 0)
{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Geld Abheben","Bitte gib Die Summe ein.","OK","Abbrechen");
return 1;
}
if(listitem == 1)
{
ShowPlayerDialog(playerid,3,DIALOG_STYLE_INPUT,"Geld Einzahlen","Bitte gib Die Summe ein.","OK","Abbrechen");
return 1;
}
if(listitem == 2)
{
format(string, sizeof(string), "Du Hast %d$ auf deinem Konto.", PlayerInfo[playerid][pAccount]);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
if(listitem == 3)
{
ShowPlayerDialog(playerid,4,DIALOG_STYLE_INPUT,"Geld Überweisen","Bitte gebe nun Den Namen des Empfängers ein.","OK","Abbrechen");
return 1;
}
return 1;
}
if(dialogid == 2)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid,4,DIALOG_STYLE_INPUT,"Geld Abheben","Bitte gib nun Die Summe ein.","OK","Abbrechen");
return 1;
}
}
if(dialogid == 4)
{
new cashdeposit = strval(inputtext);
new string[256];
if(listitem == 0)
{
if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)
{
SendClientMessage(playerid, COLOR_RED, "Du hast nicht soviel Geld auf deinem Konto!");
return 1;
}
ConsumingMoney[playerid] = 1;
GivePlayerMoney(playerid,cashdeposit);
PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-cashdeposit;
format(string, sizeof(string), "Du hast %d$ von deinem Konto abgehoben.", cashdeposit);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
}
if(dialogid == 3)
{
new cashdeposit = strval(inputtext);
new string[256];
if(listitem == 0)
{
if (cashdeposit > GetPlayerMoney(playerid) || cashdeposit < 1)
{
SendClientMessage(playerid, COLOR_RED, "Du hast nicht soviel Bargeld!");
return 1;
}
GivePlayerMoney(playerid,-cashdeposit);
PlayerInfo[playerid][pAccount]=cashdeposit+PlayerInfo[playerid][pAccount];
format(string, sizeof(string), "Du hast %d$ in deinem Konto eingezahlt.", cashdeposit);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
}
if(dialogid == 4)
{
new giveplayer[MAX_PLAYER_NAME];
new giveplayerid = strval(inputtext);
if(listitem == 0)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
ShowPlayerDialog(playerid,5,DIALOG_STYLE_INPUT,"Geld Überweisen","Bitte gib noch den Spielernamen ein.","OK","Abbrechen");
}
}
if(dialogid == 5)
{
new string[256];
new playermoney;
new giveplayer[MAX_PLAYER_NAME];
new sendername[MAX_PLAYER_NAME];
new moneys = strval(inputtext);
new giveplayerid = strval(inputtext);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = PlayerInfo[playerid][pAccount];
if(listitem == 0)
{
if (moneys > 0 && playermoney >= moneys)
{
PlayerInfo[playerid][pAccount] -= moneys;
PlayerInfo[giveplayerid][pAccount] += moneys;
format(string, sizeof(string), "Du hast %d$ Überwiesen an %s.", moneys, sendername);
if(moneys >= 500000)
{
SendClientMessage(playerid, COLOR_RED, "Bitte Eine Summe Unter 500.000$");
return 1;
}
}
}
printf("%s", string);
PayLog(string);
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
return 1;
}
return 1;
}
Alles anzeigen