OnRconCommand
#1

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?
Reply
#2

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?
Reply
#3

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)