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


Messages In This Thread
OnRconCommand - by IgrexolonO - 02.06.2013, 07:49
AW: OnRconCommand - by Nero_3D - 02.06.2013, 09:47
Re: AW: OnRconCommand - by IgrexolonO - 02.06.2013, 16:04

Forum Jump:


Users browsing this thread: 3 Guest(s)