Jump to content

Vreau sa bag RCON password 2


Trudix

Recommended Posts

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

In server.cfg la rcon in loc de parola pune 0, adica sa il dezactivezi si baga asta in script.

[pawn]

#include < a_samp >

#include <  zcmd  >

#define Second_Rcon "changeme"

new

iAttempt[ MAX_PLAYERS ] = 0,

bool: iRcon[ MAX_PLAYERS ] = false;

CMD:rlogin( playerid, params[ ] )

{

    if ( !strcmp( Second_Rcon, params ) && !( !strlen( params ) ) )

{

SendClientMessage( playerid, -1, "Te-ai logat cu succes." );

iRcon[ playerid ] = true;

}

else

{

    if( iAttempt[ playerid ] >= 3 ) return Kick( playerid );

    {

    SendClientMessage( playerid, -1, "Parola gresita!" );

iAttempt[ playerid ] ++;

}

}

return 1;

}

CMD:test( playerid, params[ ] )

{

if( !iRcon[ playerid ] == false ) return SendClientMessage( playerid, -1, "Nu esti RCON!" );

{

    SendClientMessage( playerid, -1, "Esti RCON!" );

}

return 1;

}

public OnPlayerDisconnect( playerid, reason )

{

    iAttempt[ playerid ] = 0;

    iRcon[ playerid ] = false;

return 1;

}

[/pawn]

Just Rock

Link to comment
Share on other sites

In server.cfg la rcon in loc de parola pune 0, adica sa il dezactivezi si baga asta in script.

[pawn]

#include < a_samp >

#include <  zcmd  >

#define Second_Rcon "changeme"

new

iAttempt[ MAX_PLAYERS ] = 0,

bool: iRcon[ MAX_PLAYERS ] = false;

CMD:rlogin( playerid, params[ ] )

{

    if ( !strcmp( Second_Rcon, params ) && !( !strlen( params ) ) )

{

SendClientMessage( playerid, -1, "Te-ai logat cu succes." );

iRcon[ playerid ] = true;

}

else

{

    if( iAttempt[ playerid ] >= 3 ) return Kick( playerid );

    {

    SendClientMessage( playerid, -1, "Parola gresita!" );

iAttempt[ playerid ] ++;

}

}

return 1;

}

CMD:test( playerid, params[ ] )

{

if( !iRcon[ playerid ] == false ) return SendClientMessage( playerid, -1, "Nu esti RCON!" );

{

    SendClientMessage( playerid, -1, "Esti RCON!" );

}

return 1;

}

public OnPlayerDisconnect( playerid, reason )

{

    iAttempt[ playerid ] = 0;

    iRcon[ playerid ] = false;

return 1;

}

[/pawn]

Imi poti spune cu ce ma ajuta acest script?

Link to comment
Share on other sites

Daca titlul era "Vreau sa bag RCON password 2" tu ce crezi ca ar putea sa fie?

Chiar atat de dobitoci sunteti?

Poate include si altceva...nu pot sa stiu

#Chiar imi bag pUula in rasa ta, sa stii.

Salut !

PS: numai cretini aici, parca voi v-ati nascut stiind sa faceti servere

Link to comment
Share on other sites

Uite un script:

#define FILTERSCRIPT

#include <a_samp>

//-------------------Defines--------------------
#define SecondaryRconPass "Beta" //Parola a 2-a
#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

#Chiar imi bag pUula in rasa ta, sa stii.

PS: numai cretini aici, parca voi v-ati nascut stiind sa faceti servere

Rasa mea iti multumeste, tigane!

PS: numai cretini aici, parca voi v-ati nascut stiind sa faceti servere

Noi suntem cretini? Invata sa asculti si dupa spune de altu ca e cretin.

Just Rock

Link to comment
Share on other sites

  • 3 weeks later...
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.