Hier mein kompletter OnDialogResponse Code...
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==DIALOG_LOGIN)
{
if(response==0)
{
SendClientMessage(playerid,BLAU,"Du hast den Vorgang abgebrochen.");
Kick(playerid);
return 1;
}
if(response==1)
{
if(!strlen(inputtext))
{
SendClientMessage(playerid,BLAU,"Das Passwort war nicht lang genug.");
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Dein Account wurde gefunden. Gib bitte das Passwort ein.","Login","Abbrechen");
return 1;
}
else
{
new Spielerdatei[64];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Spielerdatei,sizeof(Spielerdatei),"/ACCS/%s.ini",name);
Login(playerid,inputtext);
SetTimer("LifeTime",60000,1);
return 1;
}
}
}
if(dialogid==DIALOG_REGISTER)
{
if(response==0)
{
SendClientMessage(playerid,BLAU,"Du hast den Vorgang abgebrochen.");
Kick(playerid);
return 1;
}
if(response==1)
{
if(!strlen(inputtext))
{
SendClientMessage(playerid,BLAU,"Das Passwort war nicht lang genug.");
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Registrieren","Gib bitte das gewünschte Passwort ein:","Register","Abbrechen");
return 1;
}
else
{
Register(playerid,inputtext);
return 1;
}
}
}
if(dialogid==DIALOG_HELP)
{
if(response==0)
{
new string[256];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
SendClientMessage(playerid,0xFFFF00FF,"Alle Administratoren die Online sind wurden benachrichtigt, das du Hilfe benötigst.");
format(string, sizeof(string), "%s benötigt Hilfe! Du kannst ihm mit /aw antworten!", sendername);
SendAdminMessage(0xFFFA00FF, string);
return 1;
}
if(response==1)
{
SendClientMessage(playerid,BLAU,"Schön, das du alleine zurecht gefunden hast.");
return 1;
}
}
}
if(dialogid == 20)
{
switch(listitem)// Checking which item was chosen
{
case 0:
{
if(GetPlayerMoney(playerid) < 20)return SendClientMessage(playerid,0xFFFFFF,"Du hast nicht genug Geld!");
GivePlayerMoney(playerid, -20);
SetPlayerHealth(playerid, health+10);
}
case 1:
{
if(GetPlayerMoney(playerid) < 50)return SendClientMessage(playerid,0xFFFFFF,"Du hast nicht genug Geld!");
GivePlayerMoney(playerid, -50);
SetPlayerHealth(playerid, health+20);
}
case 2:
{
if(GetPlayerMoney(playerid) < 80)return SendClientMessage(playerid,0xFFFFFF,"Du hast nicht genug Geld!");
GivePlayerMoney(playerid, -80);
SetPlayerHealth(playerid, health+30);
}
case 3:
{
if(GetPlayerMoney(playerid) < 100)return SendClientMessage(playerid,0xFFFFFF,"Du hast nicht genug Geld!");
GivePlayerMoney(playerid, -100);
SetPlayerHealth(playerid, health+45);
}
case 4:
{
if(GetPlayerMoney(playerid) < 30)return SendClientMessage(playerid,0xFFFFFF,"Du hast nicht genug Geld!");
GivePlayerMoney(playerid, -30);
SetPlayerHealth(playerid, health+15);
}
case 5:
{
if(GetPlayerMoney(playerid) < 20)return SendClientMessage(playerid,0xFFFFFF,"Du hast nicht genug Geld!");
GivePlayerMoney(playerid, -20);
SetPlayerHealth(playerid, health+11);
}
case 6:
{
if(GetPlayerMoney(playerid) < 50)return SendClientMessage(playerid,0xFFFFFF,"Du hast nicht genug Geld!");
GivePlayerMoney(playerid, -50);
SetPlayerHealth(playerid, health+20);
}
case 7:
{
if(GetPlayerMoney(playerid) < 30)return SendClientMessage(playerid,0xFFFFFF,"Du hast nicht genug Geld!");
GivePlayerMoney(playerid, -30);
SetPlayerHealth(playerid, health+15);
}
case 8:
{
if(GetPlayerMoney(playerid) < 35)return SendClientMessage(playerid,0xFFFFFF,"Du hast nicht genug Geld!");
GivePlayerMoney(playerid, -35);
SetPlayerHealth(playerid, health+18);
}
}
}