hallo,
folgendes problem ich habe /transfer als dialog gemacht nur das problem wenn ich z.b. id 3 eingebe im dialog und danach 10$ dann überweist er immer an id 0 die 10$ und nicht an die id 3 x.X
if(dialogid == DIALOG_ATM)
{//ATM Menü
if(response==0)
{
SendClientMessage(playerid,BLAU,"Bitte Karte entnehmen!");
return 1;
}
if(response==1)
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid,DIALOG_DEPOSIT,DIALOG_STYLE_INPUT,"ATM Menü - Einzahlen","Gib bitte den gewünschten {008000}Betrag {B0C4DE}ein:","Einzahlen","Abbrechen");
}
case 1:
{
ShowPlayerDialog(playerid,DIALOG_WITHDRAW,DIALOG_STYLE_INPUT,"ATM Menü - Auszahlen","Gib bitte den gewünschten {008000}Betrag {B0C4DE}ein:","Auszahlen","Abbrechen");
}
case 2:
{
if(PlayerInfo[playerid][pLevel] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, " Du musst mindestens Level 3 sein!");
return 1;
}
ShowPlayerDialog(playerid,DIALOG_TRANSFER1,DIALOG_STYLE_INPUT,"ATM Menü - Überweisen","Gib bitte die gewünschte Spieler {FFFF00}ID {B0C4DE}oder den {FFFF00}Namen {B0C4DE}ein:","Bestätigen","Abbrechen");
}
case 3:
{
format(string,sizeof(string),"Du hast {00FF00}%d$ {B0C4DE}auf deinem Konto.",PlayerInfo[playerid][pAccount]);
ShowPlayerDialog(playerid,DIALOG_BALANCE,DIALOG_STYLE_MSGBOX,"ATM Menü - Kontostand",string,"Schließen","Schließen");
PlayerPlaySound(playerid,1052,0.0,0.0,0.0);
}
}
}
if(dialogid == DIALOG_TRANSFER1)
{//ATM Menü - Überweisen1
if(response==0)
{
SendClientMessage(playerid,BLAU,"Bitte Karte entnehmen!");
return 1;
}
if(response==1)
{
giveplayerid = ReturnUser(inputtext);
strtok(inputtext,idx);
if(!strlen(inputtext))
{
SendClientMessage(playerid,COLOR_RED," Keine ID/Name!");
ShowPlayerDialog(playerid,DIALOG_TRANSFER1,DIALOG_STYLE_INPUT,"ATM Menü - Überweisen","Gib bitte die gewünschte Spieler {FFFF00}ID {B0C4DE}oder den {FFFF00}Namen {B0C4DE}ein:","Bestätigen","Abbrechen");
return 1;
}
if (IsPlayerConnected(giveplayerid))
{
ShowPlayerDialog(playerid,DIALOG_TRANSFER2,DIALOG_STYLE_INPUT,"ATM Menü - Überweisen","Gib bitte den gewünschten {008000}Betrag {B0C4DE}ein:","Überweisen","Abbrechen");
}
else
{
format(string,sizeof(string)," Dieser Spieler ist Offline.");
SendClientMessage(playerid,COLOR_RED,string);
ShowPlayerDialog(playerid,DIALOG_TRANSFER1,DIALOG_STYLE_INPUT,"ATM Menü - Überweisen","Gib bitte die gewünschte Spieler {FFFF00}ID {B0C4DE}oder den {FFFF00}Namen {B0C4DE}ein:","Bestätigen","Abbrechen");
}
return 1;
}
}
if(dialogid == DIALOG_TRANSFER2)
{//ATM Menü - Überweisen2
if(response==0)
{
SendClientMessage(playerid,BLAU,"Bitte Karte entnehmen!");
return 1;
}
if(response==1)
{
if(!strlen(inputtext))
{
SendClientMessage(playerid,COLOR_RED," Kein Betrag!");
ShowPlayerDialog(playerid,DIALOG_TRANSFER2,DIALOG_STYLE_INPUT,"ATM Menü - Überweisen","Gib bitte den gewünschten {008000}Betrag {B0C4DE}ein:","Überweisen","Abbrechen");
return 1;
}
moneys = strval(inputtext);
GetPlayerName(giveplayerid,giveplayer,sizeof(giveplayer));
GetPlayerName(playerid,sendername,sizeof(sendername));
playermoney = PlayerInfo[playerid][pAccount] ;
if (moneys < 1)
{
SendClientMessage(playerid,COLOR_RED," Ungültiger Betrag!");
ShowPlayerDialog(playerid,DIALOG_TRANSFER2,DIALOG_STYLE_INPUT,"ATM Menü - Überweisen","Gib bitte den gewünschten {008000}Betrag {B0C4DE}ein:","Überweisen","Abbrechen");
return 1;
}
if (moneys > 0 && playermoney >= moneys)
{
PlayerInfo[playerid][pAccount] -= moneys;
PlayerInfo[giveplayerid][pAccount] += moneys;
format(string,sizeof(string),"Du hast {141414}%d{008000}$ {FFFFFF}auf %s sein Konto überwiesen.",moneys,giveplayer,giveplayerid);
PlayerPlaySound(playerid,1052,0.0,0.0,0.0);
SendClientMessage(playerid,COLOR_WHITE,string);
format(string,sizeof(string),"Du hast {141414}%d{008000}$ {FFFFFF}auf dein Konto von %s überwiesen bekommen.",moneys,sendername,playerid);
SendClientMessage(giveplayerid,COLOR_WHITE,string);
format(string,sizeof(string),"%s hat {141414}%d{008000}$ {FFFFFF}an %s überwiesen.",sendername,moneys,giveplayer);
if(moneys >= 100000)
{
ABroadCast(COLOR_YELLOW,string,1);
}
printf("%s",string);
PayLog(string);
PlayerPlaySound(giveplayerid,1052,0.0,0.0,0.0);
/*if(PlayerInfo[playerid][pConnectTime] > 200)
{
ConsumingMoney[playerid] = 1; PlayerGiveMoney(playerid,-500);
SendClientMessage(playerid,COLOR_WHITE,"Überweisungsgebühr: 500$");
}
else if(PlayerInfo[playerid][pConnectTime] > 150)
{
ConsumingMoney[playerid] = 1; PlayerGiveMoney(playerid,-400);
SendClientMessage(playerid,COLOR_WHITE,"Überweisungsgebühr: 400$");
}
else if(PlayerInfo[playerid][pConnectTime] > 100)
{
ConsumingMoney[playerid] = 1; PlayerGiveMoney(playerid,-300);
SendClientMessage(playerid,COLOR_WHITE,"Überweisungsgebühr: 300$");
}
else if(PlayerInfo[playerid][pConnectTime] > 50)
{
ConsumingMoney[playerid] = 1; PlayerGiveMoney(playerid,-200);
SendClientMessage(playerid,COLOR_WHITE,"Überweisungsgebühr: 200$");
}
else
{
ConsumingMoney[playerid] = 1; PlayerGiveMoney(playerid,-100);
SendClientMessage(playerid,COLOR_WHITE,"Überweisungsgebühr: 100$");
}*/
}
else
{
SendClientMessage(playerid,COLOR_RED," Du hast nicht soviel Geld!");
ShowPlayerDialog(playerid,DIALOG_TRANSFER2,DIALOG_STYLE_INPUT,"ATM Menü - Überweisen","Gib bitte den gewünschten {008000}Betrag {B0C4DE}ein:","Überweisen","Abbrechen");
}
return 1;
}
}
Mfg Snake1990