Create a Rcon Console Command
#1

Hey scripters!

How do you create a command that you can type into your rcon console and /rcon [Command] in-game.

I tried this:
Код:
public OnRconCommand(cmd[])
{
	if(strcmp(cmd, "Rstart", true) == 0)
	{
		RestartFunc();
	}
	return 1;
}
But that doesn't work..

Would apreciate help!
Reply
#2

To add command in-game, you can look at the filterscript 'Rcon addon.' That has many commands based in that format. But for the consol, I'm not sure if it's possible, but might be.
Reply
#3

are you sure you didn't mean Restart instead Rstart as command
Reply
#4

He has it spelt correctly, although that isn't a native SA:MP function.

Have you tried using
pawn Код:
SendRconCommand("gmx");
Instead of your custom function?
Reply
#5

Swift and contactor this is has nothing to do with his question... he asked if he can add a rcon command that can be sent from the console, and what he gave was just an example of what he tried.

and the answer to your question is no... but maybe it's possible to develop a plug-in that does that... I have no idea though

The public "OnRConCommand" is called when a existing rcon command has been used.... cmd[] parameter has the command in it.
Reply
#6

Okay , thank you OmeRinG!
Reply
#7

Quote:
Originally Posted by OmeRinG
Swift and contactor this is has nothing to do with his question... he asked if he can add a rcon command that can be sent from the console, and what he gave was just an example of what he tried.

and the answer to your question is no... but maybe it's possible to develop a plug-in that does that... I have no idea though

The public "OnRConCommand" is called when a existing rcon command has been used.... cmd[] parameter has the command in it.
actually it is, he also said "I tried this.. but it doesn't work"
they look like 2 questions. "how to add an rcon command" + "how to make this command work"
ofcourse this isn't a good reply for the first question as I just quickly read it
Reply


Forum Jump:


Users browsing this thread: