PDA

View Full Version : /rcon commands with CodeCallback_PlayerCommand(args)



Ni3ls
3rd October 2015, 19:20
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.

maxdamage99
4th October 2015, 12:55
Most likely, you can control the team that produced directly on the server, but if they are produced with rcon-tool?

Kemi
28th November 2015, 04:29
wait so you've tried


if (args[0] == "rcon")
{
arguments = "";
for(i = 3; i < args.size; i++)
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

Mitch
28th November 2015, 07:07
wait so you've tried


if (args[0] == "rcon")
{
arguments = "";
for(i = 3; i < args.size; i++)
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.

php
28th November 2015, 11:40
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.

Kemi
2nd December 2015, 05:04
I thought if you had a cvar the same name as a command, you couldn't use the command?