View Single Post
Author Message
EHG
Senior Member
Join Date: May 2009
Location: 127.0.0.1
Old 09-30-2009 , 11:02   Cheat commands that require sv_cheats 1
Reply With Quote #1

Description
This plugin will allow admins with root access (feel free to edit the admin flag required) to use any command that requires sv_cheats including those commands that still don't work after removing their cheat flag.
What this plugin does is quietly setting sv_cheats to 1, running the command, and then setting it back to 0 without ever sending sv_cheat activity to the client.
However if a cheat command works by removing its cheat flag then that it is recommended to do so instead of using this.

A nice plugin that removes the cheat flag for admins: http://forums.alliedmods.net/showthread.php?t=81101

Certain commands like thirdperson will still not work using this method because they don't require server side cheats but instead require client side sv_cheats.
For commands like thirdperson you can use the following plugin to send sv_cheats 1 to a client without altering server side sv_cheats:
http://forums.alliedmods.net/showthread.php?t=92289


Make a file called sm_cheat_cvars.cfg in your server's cfg folder. In L4D2 whenever sv_cheats is modified all cvars are reset. So if you have any custom values that you don't want to be reset after using this command then list them in that file. It is executed after running the command.
note: you may have to use sm_cvar <cvar> for certain cvars, just like you would in server.cfg

Something to keep in mind
Changing the sv_cheats cvar resets cvars like sb_stop and sb_all_bot_team. Just something to keep in mind, it can mess with scripts that rely on certain cvars not being reset.
A good example is the L4D2 Score/Team manager that relies on sb_all_bot_team being set to 1. Or my Round Start Bot Stop script relies on sb_stop being changed at certain times.
Keep in mind that using this may have unwanted effects on scripts like that.

Commands
sm_cheat <command>

Example
sm_cheat ent_setname !picker sentry1


Change log
1.2
Added a config to be executed after each usage of the command
1.1 Altered code to allow usage for any command requiring sv_cheats
1.0 First release
Attached Files
File Type: sp Get Plugin or Get Source (sm_cheat.sp - 8013 views - 1.2 KB)

Last edited by EHG; 05-12-2010 at 14:30. Reason: Update
EHG is offline