OnRconCommand - 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: OnRconCommand (
/showthread.php?tid=637589)
OnRconCommand -
Omirrow - 17.07.2017
Hey, why custom functions in OnRconCommand doesn't work at all? Even the default example given in Wiki SA:MP?
https://sampwiki.blast.hk/wiki/OnRconCommand
pawn Код:
public OnRconCommand(cmd[])
{
if(!strcmp(cmd, "hello", true))
{
SendClientMessageToAll(0xFFFFFFAA, "Hello World!");
print("You said hello to the world."); // This will appear to the player who typed the rcon command in the chat in white
return 1;
}
return 0;
}
This will print Player X sent rcon command on the console but won't send any message to players, why?
Re: OnRconCommand -
Omirrow - 17.07.2017
Nevermind, I fixed it.
I didn't read "You will need to include this callback in a loaded filterscript for it to work in the gamemode!" this.
But why should I include this in another filterscript, for example I don't use any filterscripts and I need to create a new filterscript JUST to use this callback?
Re: OnRconCommand -
Paulice - 17.07.2017
Yes, you do. I guess it's due to the fact that it processes the callback in filterscripts before the one in the gamemode, and if you return 1 in the callback that's in the filterscript the one in the gamemode will not be called afterwards. That's just how Kalcor made it I guess.