Posts: 49
Threads: 14
Joined: Jan 2017
Reputation:
0
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.
Posts: 325
Threads: 5
Joined: Jun 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]
Posts: 513
Threads: 4
Joined: Jun 2015
Reputation:
0
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.