Jump to content
  • 0

Vreau sa bag Rcon password 2


Trudix

Question

Salut, sunt incepator in ceea ce tine de samp [creare,scripting]... e primul meu server si as vrea sa bag 2 parole la rcon... dupa ce te loghezi la prima, sa ti-o ceara si pe a doua.

!Nu stiu cum, dar cineva tot imi sparge serverul si le da la toti admin si vip...etc!

Cum pot face?

Folosesc game mode romania real stunt

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

Uite un script:

#define FILTERSCRIPT

#include <a_samp>

//-------------------Defines--------------------
#define SecondaryRconPass "Beta" //Parola secundara
#define DIALOG_TYPE_SecondaryRcon           2013
//----------------------------------------------

//------------------------------------------------------------------------------
new Attempts[MAX_PLAYERS];
//------------------------------------------------------------------------------
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" RCON SPassword - Loaded succesfully!");
	print("--------------------------------------\n");
	return 1;
}
#endif

public OnRconLoginAttempt(ip[], password[], success)
{
	if(success)
	{
		for(new i = 0; i < MAX_PLAYERS; i++)
		{
  			if(IsPlayerConnected(i))
  			{
  			    new pIP[16];
				GetPlayerIp(i, pIP, 16);
				if(!strcmp(pIP,ip,true))
				{
					new string[128];
					format(string,sizeof(string),"{FFFFFF}Please enter the secondary password!");
					ShowPlayerDialog(i, DIALOG_TYPE_SecondaryRcon, DIALOG_STYLE_PASSWORD,"RCON Secondary Password",string, "Ok", "Close");
				}
			}
		}
	}
	return 1;
}


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == DIALOG_TYPE_SecondaryRcon)
	{
	    if (response)
	    {
        	if (!strcmp(SecondaryRconPass, inputtext) && !(!strlen(inputtext)))
			{
    			GameTextForPlayer(playerid, "~r~~h~RCON ~w~~h~Authorized !",3000,3);
			}
			else
			{
				if(Attempts[playerid] == 3)
				{
					SendClientMessage(playerid, 0xFF0000AA, "You are kicked for entering wrong Secondary RCON Password!");
				 	Kick(playerid);
				}
				Attempts[playerid] ++;
				new tmp[140];
	  			SendClientMessage(playerid, 0xFF0000AA, "Invalid RCON Password!");
   				format(tmp,sizeof(tmp),"{FF0000}Invalid Password! \n{FFFFFF}Enter the correct {FF0000}RCON Secondary Password{FFFFFF}!\n\n{FFFF00}Attempts: {FF0000}%d{33FF33}/3", Attempts[playerid]);
				ShowPlayerDialog(playerid, DIALOG_TYPE_SecondaryRcon, DIALOG_STYLE_PASSWORD, "RCON Secondary Password",tmp, "Ok", "Close");
			}
        }
		else
		{
			SendClientMessage(playerid, 0xFF0000AA, "Kicked !");
	    	return Kick(playerid);
 		}
    }
 	return 1;
}

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.