SA-MP Forums Archive
SendRconCommand - 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)
+--- Thread: SendRconCommand (/showthread.php?tid=640882)



SendRconCommand - Develerux - 08.09.2017

Hi, how to get return message from rcon command?
Example:
I create loadfs command with SendRconCommand and how to send client message if fs not exist?
"example.amx load failed" Maybe, reworded text and other color.
Replace default text to custom text.


Re: SendRconCommand - 10MIN - 08.09.2017

It is not possible... But YSF's fork by kurta999 has a function for this:
Код:
native LoadFilterScript(const scriptname[]); // difference between "rcon loadfs": Return -> True if success, false if not
So the command will be like:
PHP код:
CMD:loadfs(playerid,params[])
{
  if(
params[0] == '\0')  return SendClientMessage(playerid,-1,"This command needs an argument");
  
SendClientMessage(playerid,-1, (LoadFilterScript(params) ? ( "Filterscript loaded" ) : ("Filterscript load failed"));
  return 
1;

[/php]


Re: SendRconCommand - Spmn - 08.09.2017

Or if you wanna stay away from YSF, use CallRemoteFunction from within OnFilterScriptInit. If the function isn't called, you can assume that the FS hasn't got loaded.