ShowPlayerDialog helpH
#1

Hi all,
first, excuse me for bad English, i'am a noob, but i hope u understand what im say,
so, i have a ShowPlayerDialog Gui System/Login System

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	new sendername[MAX_PLAYER_NAME];
	new string[128];
	if(response)
	{
		if(dialogid == 12346 || dialogid == 12347)
		{
		  if(strlen(inputtext))
		  {
				new tmppass[64];
				strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
				Encrypt(tmppass);
				OnPlayerLogin(playerid,tmppass);
			}
			else
			{
				new loginstring[128];
				new loginname[64];
				GetPlayerName(playerid,loginname,sizeof(loginname));
				format(loginstring,sizeof(loginstring),"Falsches Passwort\nBitte gebe das richtige Passwort ein:",loginname);
				ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"Anmelden",loginstring,"Anmelden","Abbrechen");
				gPlayerLogTries[playerid] += 1;
				if(gPlayerLogTries[playerid] == 4) { Ban(playerid); }
			}
		}
		if(dialogid == 12345)
		{
		  if(strlen(inputtext))
		  {
				GetPlayerName(playerid, sendername, sizeof(sendername));
				format(string, sizeof(string), "%s.ini", sendername);
				new File: hFile = fopen(string, io_read);
				if (hFile)
				{
					SendClientMessage(playerid, COLOR_YELLOW, "Dieser Spielername wird momentan verwendet, bitte wдhle ein anderen.");
					fclose(hFile);
					return 1;
				}
				new tmppass[64];
				strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
				Encrypt(tmppass);
				OnPlayerRegister(playerid,tmppass);
			}
			else
			{
 				new regstring[128];
				new regname[64];
				GetPlayerName(playerid,regname,sizeof(regname));
				format(regstring,sizeof(regstring),"Willkommen %s,\nDein Spielername ist nicht Registriert.\nBitte Registriere dich:",regname);
				ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"Registrieren",regstring,"Registrieren","Abbrechen");
			}
		}
	}
 	else
	{
		Kick(playerid);
	}
	if(dialogid == 10)
	{
		if(listitem == 0)
		{
			if(PlayerInfo[playerid][pEcKarte] == 1)
			{
	 			SendClientMessage(playerid, COLOR_RED, "Du kannst dir keine Neue Bank Karte einrichten,");
		  	SendClientMessage(playerid, COLOR_RED, "du besitzt schon eine.");
		  }
		  else
		  {
		    PlayerInfo[playerid][pEcKarte] = 1;
				SendClientMessage(playerid, COLOR_RED, "Deine Bank Konto wurde erfolgreich erstellt,");
				SendClientMessage(playerid, COLOR_RED, "du kannst das unter /licenses sehen.");
			}
		}
 		if(listitem == 1)
		{
      new bankstring[128];
			format(bankstring,sizeof(bankstring),"Auf deinem Bank Konto sind %d $",PlayerInfo[playerid][pAccount]);
			ShowPlayerDialog(playerid,10,DIALOG_STYLE_MSGBOX,"Bank System",bankstring,"Hautpmenu","SchlieЯen");
		}
		if(listitem == 2)
		{
			//Do Nothing
		}
		if(listitem == 3)
		{
			//Do Nothing
		}
	}
	return 1;
}
In the Register/Login code, when im press Abbrechen(eng: exit)
then i become a server kick,
so my problem is in the Bank System what i make,
example i in this code
Код:
if(listitem == 10)
		{
            new bankstring[128];
			format(bankstring,sizeof(bankstring),"Auf deinem Bank Konto sind %d $",PlayerInfo[playerid][pAccount]);
			ShowPlayerDialog(playerid,10,DIALOG_STYLE_MSGBOX,"Bank System",bankstring,"Hautpmenu","SchlieЯen");
		}
when i klick for that i become a dialog window with my current money what i have in my account
now i need help, who can help me with this problems?
when i klick HauptMenu the Dialog Window got closed
when i klick Abbrechen i become a kick,
who can help me and change the code,
kick only on login/register system when i klick abbrechen, at bank system when i klick abbecheni like to close the dialog window and on hauptmenu to reopen the bank menu.
excuse me again for that shit noob english, but i cant it better,
i hope u undersstand my text and can help me.
Thank You for the help.
//eddit
pls help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)