Results 1 to 6 of 6

Thread: /rcon commands with CodeCallback_PlayerCommand(args)

  1. #1
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts

    /rcon commands with CodeCallback_PlayerCommand(args)

    Hi all,

    Is it possible to read the /rcon commands with CodeCallback_PlayerCommand(args)? In the callback, you add the identifier, but it doesnt register the rcon commands.

  2. #2
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    Most likely, you can control the team that produced directly on the server, but if they are produced with rcon-tool?

  3. #3
    Private
    Join Date
    Nov 2014
    Posts
    25
    Thanks
    9
    Thanked 3 Times in 2 Posts
    wait so you've tried
    PHP Code:
    if (args[0] == "rcon")
        {
            
    arguments "";
            for(
    3args.sizei++)
                
    arguments += args[i];
            
    logPrint("[RCON] ["+self.name+"] used rcon command ["+args[1]+"] with args ["+arguments+"]");
        } 
    because when I try this it works but the only problem is the arguments passed doesnt show up

  4. #4
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by Kemi View Post
    wait so you've tried
    PHP Code:
    if (args[0] == "rcon")
        {
            
    arguments "";
            for(
    3args.sizei++)
                
    arguments += args[i];
            
    logPrint("[RCON] ["+self.name+"] used rcon command ["+args[1]+"] with args ["+arguments+"]");
        } 
    because when I try this it works but the only problem is the arguments passed doesnt show up
    You can't read rcon commands with CodeCallback_PlayerCommand.
    But you can set the command as a cvar and read the value in cod like the admin functions in AWE and other mods.

    Edit: i could make a new function for this.

  5. #5
    Private First Class php's Avatar
    Join Date
    Nov 2012
    Posts
    142
    Thanks
    28
    Thanked 116 Times in 59 Posts
    Quote Originally Posted by Mitch View Post
    You can't read rcon commands with CodeCallback_PlayerCommand.
    But you can set the command as a cvar and read the value in cod like the admin functions in AWE and other mods.

    Edit: i could make a new function for this.
    If you're going to do that, why not just instead hook rcon (since it doesn't work for who don't know because it's not a cmd it's a connectionless packet) and then add the rcon to the PlayerCmd callback. I don't see why you would want do this though.

  6. #6
    Private
    Join Date
    Nov 2014
    Posts
    25
    Thanks
    9
    Thanked 3 Times in 2 Posts
    I thought if you had a cvar the same name as a command, you couldn't use the command?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •