Jump to content
  • 0

Kick la dialog/menu


TzAkS

Question

6 answers to this question

Recommended Posts

Guest PlayON

Poate ca un OnDialogResponse nu are un check de id de dialog si face direct if ( !response ) Kick( playerid );

Intelegi? Nu verifica intai daca ID-ul selectat este cel corect, ci e global, adica merge la toate dialogurile!

Link to comment
Share on other sites

Doar la register am Kick..

new regstring[128];
				new regname[64];
				GetPlayerName(playerid,regname,sizeof(regname));
				format(regstring,sizeof(regstring),"Welcome, %s\nContul Tau Nu Este Inregistrat.\nVa Rugam Inregistrati-va:",regname);
				ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"Inregistrare",regstring,"Inregistrare","Iesire");
			}
		}
	}
	else
	{
		Kick(playerid);
	}
	return 1;
}

Da eu folosesc FS cu dialog..cum am zis si mai sus..da nu inteleg de ce da kick daca da cancel..in FS ala nu e nimic de kick

gXvsYS
Link to comment
Share on other sites

Guest PlayON

Doar la register am Kick..

new regstring[128];
				new regname[64];
				GetPlayerName(playerid,regname,sizeof(regname));
				format(regstring,sizeof(regstring),"Welcome, %s\nContul Tau Nu Este Inregistrat.\nVa Rugam Inregistrati-va:",regname);
				ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"Inregistrare",regstring,"Inregistrare","Iesire");
			}
		}
	}
	else
	{
		Kick(playerid);
	}
	return 1;
}

Da eu folosesc FS cu dialog..cum am zis si mai sus..da nu inteleg de ce da kick daca da cancel..in FS ala nu e nimic de kick

Da-mi tot codu de sus si jos!

Link to comment
Share on other sites

//---------------------------<[ OnDialogResponse ]>--------------------------------------------------------

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),"PAROLA GRESITA\nVa Rugam Introduceti Parola Corecta:",loginname);
				ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"Login",loginstring,"Logare","Iesire");
				gPlayerLogTries[playerid] += 1;
				if(gPlayerLogTries[playerid] == 5) { 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, "Acest Nume Este Folosit, Va Rugam Folositi Altul.");
					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),"Welcome, %s\nContul Tau Nu Este Inregistrat.\nVa Rugam Inregistrati-va:",regname);
				ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"Inregistrare",regstring,"Inregistrare","Iesire");
			}
		}
	}
	else
	{
		Kick(playerid);
	}
	return 1;
}

gXvsYS
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.