Rcon pass
#1

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 ?
Reply
#2

Sorry remove this, i got it wrong
Reply
#3

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

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

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;
    }
Reply
#6

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.
Reply
#7

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;
    }
Reply
#8

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

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");
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)