SA-MP Forums Archive
Rcon pass - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Rcon pass (/showthread.php?tid=111048)



Rcon pass - radi - 29.11.2009

hello i got a question
i have this in ongamemodeinit

pawn Код:
SendRconCommand(''rcon_password ****");
but i want that to work with a define
like

pawn Код:
#define RCON "*****"
but this wont work

pawn Код:
SendRconCommand(''rcon_password %s", RCON);
how can i do it like i want to ?


Re: Rcon pass - [NYRP]Mike. - 29.11.2009

Sorry remove this, i got it wrong


Re: Rcon pass - Jefff - 29.11.2009

Or xD
Код:
#define RCON "*****"
Init
Код:
new str[64];
format(str,64,"rcon_password %s",RCON);
SendRconCommand(str);



Re: Rcon pass - radi - 29.11.2009

Quote:
Originally Posted by Jefff
Or xD
Код:
#define RCON "*****"
Init
Код:
new str[64];
format(str,64,"rcon_password %s",RCON);
SendRconCommand(str);
thanks jefff


Re: Rcon pass - radi - 29.11.2009

how do i make that if somesays is by fault
that it will block the word

pawn Код:
if(strfind(text, "%s", true) != -1)
    {
        SendClientMessage(playerid, COLOR_RED, "DUMMY you almost said the rcon pass");
        return 0;
    }



Re: Rcon pass - [NYRP]Mike. - 29.11.2009

add this under OnPlayerText:

pawn Код:
new a;
if(a = RCON)
{
    SendClientMessage(playerid,COLOR,"DUMMY, You almost said the rcon pass");
}
Untested, just a rough idea dont know if its right.


Re: Rcon pass - radi - 29.11.2009

Quote:
Originally Posted by ♣ ©ⓤⓝⓔⓞ ♣
add this under OnPlayerText:

pawn Код:
new a;
if(a = RCON)
{
    SendClientMessage(playerid,COLOR,"DUMMY, You almost said the rcon pass");
}
Untested, just a rough idea dont know if its right.
pawn Код:
C:\DOCUME~1\Tim\BUREAU~1\NIEUWE~2\GAMEMO~1\\****.pwn(3153) : warning 211: possibly unintended assignment
C:\DOCUME~1\Tim\BUREAU~1\NIEUWE~2\GAMEMO~1\****.pwn(3153) : error 006: must be assigned to an array
C:\DOCUME~1\Tim\BUREAU~1\NIEUWE~2\GAMEMO~1\****.pwn(3153) : warning 204: symbol is assigned a value that is never used: "a"
got it i think i test now

pawn Код:
if(strfind(RCON_PASS, "%s", true) != -1)
    {
        SendClientMessage(playerid, COLOR_RED, "FAGGOT YOU ALMOST SAID THE RCON PASS IN CHAT");
        return 0;
    }



Re: Rcon pass - Jefff - 29.11.2009

Код:
	if(strfind(text, RCON, true) != -1)
	{
		SendClientMessage(playerid, COLOR_RED, "DUMMY you almost said the rcon pass");
		return 0;
	}
:P


Re: Rcon pass - Nero_3D - 29.11.2009

To your first question, here a better way
pawn Код:
#define RCON_PASSWORD "password"
pawn Код:
SendRconCommand("rcon_password " RCON_PASSWORD);
And to your second question, the same as you already posted
pawn Код:
if(strfind(text, RCON_PASSWORD, true) != -1)
        return !SendClientMessage(playerid, COLOR_RED, "DUMMY you almost said the rcon pass");



Re: Rcon pass - dice7 - 29.11.2009

You can also get the pass with
pawn Код:
new pass[50];
GetServerVarAsString("rcon_password", pass, 50);