SA-MP Forums Archive
Create a Rcon Console Command - 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: Create a Rcon Console Command (/showthread.php?tid=82440)



Create a Rcon Console Command - Jonte92 - 18.06.2009

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!


Re: Create a Rcon Console Command - Grim_ - 18.06.2009

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.


Re: Create a Rcon Console Command - Joske_Vermeulen - 18.06.2009

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


Re: Create a Rcon Console Command - Grim_ - 18.06.2009

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?


Re: Create a Rcon Console Command - OmeRinG - 18.06.2009

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.


Re: Create a Rcon Console Command - Jonte92 - 18.06.2009

Okay , thank you OmeRinG!


Re: Create a Rcon Console Command - Joske_Vermeulen - 18.06.2009

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