Results 1 to 6 of 6

Thread: /rcon commands with CodeCallback_PlayerCommand(args)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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

  2. #2
    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.

  3. #3
    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.

  4. #4
    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
  •