Raised This Month: $51 Target: $400
 12% 

Removing cheat flags from all commands for admins.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dragonshadow
BANNED
Join Date: Jun 2008
Old 05-12-2009 , 19:45   Removing cheat flags from all commands for admins.
Reply With Quote #1

Ok so after looking at l4d build enabler its like I would have to create a public action (the adminonly part anyway) for every single command.
Is there a way to just take the cheat flag off (for admins) of everything?
I tried taking it off of "boom" and "fire" and making them use the same action for adminonly, but that didn't work. (They still say need sv_cheats 1)

PHP Code:
 RegConsoleCmd("boom"Command_cheats)
 
RegConsoleCmd("fire"Command_cheats
PHP Code:
 SetCommandFlags("boom",GetCommandFlags("boom")^FCVAR_CHEAT)
 
SetCommandFlags("fire",GetCommandFlags("fire")^FCVAR_CHEAT
PHP Code:
public Action:Command_cheats(clientargs)
{
 if (
onlyadmins)
 {
 if (!
clientadminstate[client])
 {
 return 
Plugin_Handled
 
}
 }
 return 
Plugin_Continue

I wish it was as simple as

PHP Code:
RegConsoleCmd("*"Command_cheats)
SetCommandFlags("*",GetCommandFlags("*")^FCVAR_CHEAT
to take the cheat flag off of everything.

Last edited by Dragonshadow; 05-12-2009 at 21:43.
Dragonshadow is offline
paegus
Senior Member
Join Date: Nov 2004
Location: Extreme low earth orbit
Old 05-13-2009 , 08:20   Re: Removing cheat flags from all commands for admins.
Reply With Quote #2

disable cheats:

Code:
SetCommandFlags("boom",GetCommandFlags("boom") ~& FCVAR_CHEAT) SetCommandFlags("fire",GetCommandFlags("fire") ~& FCVAR_CHEAT)

restore cheats say 0.1 seconds afterward:

Code:
SetCommandFlags("boom",GetCommandFlags("boom")|FCVAR_CHEAT) SetCommandFlags("fire",GetCommandFlags("fire")|FCVAR_CHEAT)

and i'd
Code:
RegAdminCmd("sm_boom", ...)
etc so it automatically limits it to admins and you don't need to check once inside.
__________________
Live and learn or die and teach by example.
Plugins Mine | Hidden:SourceMod
paegus is offline
wgooch
Member
Join Date: Dec 2008
Old 05-13-2009 , 23:14   Re: Removing cheat flags from all commands for admins.
Reply With Quote #3

Does removing the cheat flag from boom and fire even work? Last I checked it was like ghost and respawn. It doesn't appear to have any flags at all, seems like it's hard coded into sv_cheats
wgooch is offline
paegus
Senior Member
Join Date: Nov 2004
Location: Extreme low earth orbit
Old 05-14-2009 , 02:50   Re: Removing cheat flags from all commands for admins.
Reply With Quote #4

i've had a similar problem with bot_add for certain mods. the previous version of sourcemod allowed me to add/remove flags from that command but now i just have to toggle sv_cheats.

though i suppose that in itself provides an alternate solution. when an admin runs sm_boom/fire then just silently toggle sv_cheats 0, run the command and then silently re-enable cheats.
__________________
Live and learn or die and teach by example.
Plugins Mine | Hidden:SourceMod
paegus is offline
wgooch
Member
Join Date: Dec 2008
Old 05-14-2009 , 12:07   Re: Removing cheat flags from all commands for admins.
Reply With Quote #5

That's the current solution I'm using, it has downsides though, all cheat vars such as z_common_limit will reset to the default and you wont get survival medals if you use it once during the round.
wgooch is offline
Dragonshadow
BANNED
Join Date: Jun 2008
Old 05-14-2009 , 17:15   Re: Removing cheat flags from all commands for admins.
Reply With Quote #6

Mmm that won't work, as soon as cheats are on it doesn't save the survival medals

Also kind've offtopic, but does anyone know how to modify the hunter's walk speed independently from common zombie speed?
Dragonshadow is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:38.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode