PDA

View Full Version : Changing flags on commands (not cvars)


cyt0plas
10-18-2007, 00:32
I'm trying to (temporarily) change a command so that it is not considered a "cheat" command.

Looking through the SDK, I see a reference to RegServerCmd, which has flags. Unfortunately, there doesn't seem to be a function along the lines of "SetConVarFlags()" with which I could change it.

Is there a way in SourceMod to set flags on a CMD?

BAILOPAN
10-18-2007, 00:39
There isn't -- that sounds like a valid feature request.

cyt0plas
10-18-2007, 17:10
There isn't -- that sounds like a valid feature request.
Ok, thank you. I'm going to take a stab at doing it myself; if I can't get it to work, I'll make a feature request.

Basically, the reason I want this is that I have a few cvars that will really affect gameplay in TF2. To keep things fair, I'm going to call mp_forcerespawnplayers (a "cheat" command) when they change, as well as having notify on the cvar and a message printed to users.

To do this, of course, I have to be able to call the "cheat" command, and I don't like setting sv_cheats to 1 to do it (even if I temporarily turn off notify on it).

On a side note, the sourcepawn compiler works very well on linux (even if the usage printout shows the wrong command name :) ). I've got a subversion post-commit hook that automatically exports SVN to a directory, and compiles the script. It makes development significantly easier than trying to use the web-based compiler.

BAILOPAN
10-18-2007, 17:14
That is good to hear :)

What do you mean it shows the wrong command name?

cyt0plas
10-22-2007, 17:02
What do you mean it shows the wrong command name?


I used the GNU Makefile; it defaults to "spcomp" as the compiler name. Running it, I get:

SourcePawn Compiler 1.0.0.800
Copyright (c) 1997-2006, ITB CompuPhase, (C)2004-2007 AlliedModders, LLC

Usage: pawncc <filename> [filename...] [options] It looks like it's using an (old) hard-coded usage statement, rather than using argv[0].