[URGENT] How to print to all rcon admins?
#1

You know the SA-MP Rcon Console? well how to print to it? for (new i=500; i<MAX_RCON_ADMINS; i++) or what?
Reply
#2

Quote:
Originally Posted by Micko9
You know the SA-MP Rcon Console? well how to print to it? for (new i=500; i<MAX_RCON_ADMINS; i++) or what?
If you want to send a message without strings directly to the console:

pawn Код:
print("message");
If you want to send a message with strings directly to the console:

pawn Код:
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "Hi there, %s!", pName);
printf(string);
Reply
#3

Quote:
Originally Posted by Sky4D
Quote:
Originally Posted by Micko9
You know the SA-MP Rcon Console? well how to print to it? for (new i=500; i<MAX_RCON_ADMINS; i++) or what?
If you want to send a message without strings directly to the console:

pawn Код:
print("message");
If you want to send a message with strings directly to the console:

pawn Код:
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "Hi there, %s!", pName);
printf(string);
Hey, I know you, you're Tom Collins
Reply
#4

Quote:
Originally Posted by NiiRV4N4
Quote:
Originally Posted by Sky4D
Quote:
Originally Posted by Micko9
You know the SA-MP Rcon Console? well how to print to it? for (new i=500; i<MAX_RCON_ADMINS; i++) or what?
If you want to send a message without strings directly to the console:

pawn Код:
print("message");
If you want to send a message with strings directly to the console:

pawn Код:
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "Hi there, %s!", pName);
printf(string);
Hey, I know you, you're Tom Collins
That I am. Now, don't post that here, PM me if you want to talk to me.
Reply
#5

Works only in FS
pawn Код:
public OnRconCommand(cmd[])
{
    if(!strcmp(cmd,"admins",true,6)) {
        new Nick[24],bool:Online;
        print("Admins OnLine:");
        for(new i,g=GetMaxPlayers(); i < g; i++) if(IsPlayerConnected(i) && IsPlayerAdmin(i))
        {
            GetPlayerName(i,Nick,24);
            printf("%s (ID: %d)",Nick,i);
            Online=true;
        }
        if(!Online) print("* No Admins OnLine");
        return 1;
    }
    return 0;
}
Reply
#6

rofl you all don't understand.

those [part] messages in the console. i Meant the Client RCON Console. Not the server console.
Reply
#7

This should work.


Код:
public OnRconCommand(cmd[])
{
	if(!strcmp(cmd,"admins",true,6)) 
	{
	new Nick[24]; new count;
	SendRconCommand("echo Admins OnLine:");
	for(new i,g=GetMaxPlayers(); i < g; i++) 
	if(IsPlayerConnected(i) && IsPlayerAdmin(i))
	{
		GetPlayerName(i,Nick,24);
		SendRconCommand("echo %s (ID: %d)",Nick,i);
		count++;
	}
	if(count==0) SendRconCommand("echo No Admins Online");
	return 1;
	}
	return 0;
}
Reply
#8

Is anyone actuallly LISTENING i want to print to the Console (rcon.exe) not the freaking server console, i do not want to count the admins and print them. Does anyone here understand what i am talking about?
Reply
#9

Well, it's kinda hard because you don't tell us what you want...
Reply
#10

You're not explaining clearly enough - rcon.exe: what's that? If you want to send a message to the console use the print function.

Quote:
Originally Posted by Sky4D
If you want to send a message without strings directly to the console:

[...]

If you want to send a message with strings directly to the console:

[...]
A string is not a function paramerter. Simply put, a string is a word. Instead of formatting a string and using the print function, you can simply use printf with the values representing the format. For example:

Код:
printf("The value of players is %d.", players);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)