SA-MP Forums Archive
What is the CMD/Function that Sends a Command to teh Rcon? - 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: What is the CMD/Function that Sends a Command to teh Rcon? (/showthread.php?tid=68534)



What is the CMD/Function that Sends a Command to teh Rcon? - Castle - 11.03.2009

What is the CMD/Function that Sends a Command to teh Rcon?
I want to set that when my script loads/GameMode
It will send a Command to the Rcon to reload a Filterscript?


Re: What is the CMD/Function that Sends a Command to teh Rcon? - MenaceX^ - 11.03.2009

pawn Код:
public SendRconCommand(cmd[])
  return 1;



Re: What is the CMD/Function that Sends a Command to teh Rcon? - Castle - 11.03.2009

Quote:
Originally Posted by MenaceX^
pawn Код:
public SendRconCommand(cmd[])
  return 1;
I think i need to do:
pawn Код:
forward FS();

public FS()
{
    SendRconCommand("reloadfs FS");
    return 1;
}



Re: What is the CMD/Function that Sends a Command to teh Rcon? - MenaceX^ - 11.03.2009

Quote:
Originally Posted by ssǝן‾ʎ
SendRconCommand is not public and doesn't return 1 all the time, I'm not entirely sure what you're trying to show with that format.
It was just an example. And it is a public.


Re: What is the CMD/Function that Sends a Command to teh Rcon? - MenaceX^ - 11.03.2009

Oh sorry I was wrong with 'OnRconCommand'
Yes Jack. You should do it like you said.

Example of a command with SendRconCommand.
pawn Код:
if(!strcmp(cmd,"/banip",true))
{
  cmd=strtok(cmdtext,idx);
  if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /banip [player's IP] get it someone's IP by /ip.");
  format(string,sizeof(string),"banip %s",cmd);
  SendRconCommand(string);
  return SendRconCommand("reloadbans");
}