OnRconCommand
#1

Hello! I'm trying to write commands in onrconcommand in any way, but every single command I wrote won't be called.

I was trying even commands from other topics on this forum, like:

Код:
public OnRconCommand(cmd[])
{
    if(!strcmp(cmd, "msg", false, 3))
    {//           length of "msg" ^ 
        new
            msg[128],
            user;
        if(sscanf(cmd[3], "us[128]", user, msg))
        {//           ^ length of "msg"
            print("SYNTAX: msg [user] [message]");
            return 1;
        }
        if(user != INVALID_PLAYER_ID)
        {
            SendClientMessage(user, -1, msg);
        }
        else
        {
            print("ERROR: player is not connected.");
        }
        return 1;
    }
    if(!strcmp(cmd, "restart", false, 7))
    {//           length of "restart" ^
        new
            time;
        if(sscanf(cmd[7], "d", time))
        {//           ^ length of "restart"
            print("SYNTAX: restart [time]");
            return 1;
        }
        printf("SERVER: server will restart in %d seconds.", time);
        SetTimer("Rcon_Restart", time * 1000, false);
        return 1;
    }
    return 1;
}
But they won't be called too. I haven't got any filterscripts loaded. What could be the problem?

Regards.
Reply
#2

Quote:
Originally Posted by IgrexolonO
Посмотреть сообщение
What could be the problem?
Quote:
Originally Posted by IgrexolonO
Посмотреть сообщение
I haven't got any filterscripts loaded.
OnRconCommand - Read the important note

Just put that into a filterscript, compile it and load it when the server starts

pawn Код:
forward OnRconCommand(cmd[]); public OnRconCommand(cmd[]) return false;
Reply
#3

Lol. Thank you.

Regards.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)