Raised This Month: $275 Target: $400
 68% 

Admin Cheats


Post New Thread Reply   
 
Thread Tools Display Modes
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 11-29-2008 , 21:50   Re: Admin Cheats
Reply With Quote #11

L4D seems very finicky with stripping the cheat flag from commands. I was fooling with it earlier tonight, and on one map, I could strip the cheat flag from the "give" command, but not the "z_spawn" command, and on the next, I could strip it from the "z_spawn" command, but not the "give" command (this was in-between server restarts, so it wasn't something where the flag was already stripped).
bl4nk is offline
msleeper
Veteran Member
Join Date: May 2008
Location: Atlanta, Jawjuh
Old 12-04-2008 , 23:26   Re: Admin Cheats
Reply With Quote #12

Admittedly I haven't looked at the plugin's source, but perhaps the cheat flag needs to be stripped right before being ran for it to work in L4D?
__________________
msleeper is offline
Antithasys
Moderator
Join Date: Apr 2008
Old 12-06-2008 , 01:17   Re: Admin Cheats
Reply With Quote #13

Quote:
Originally Posted by bl4nk View Post
L4D seems very finicky with stripping the cheat flag from commands. I was fooling with it earlier tonight, and on one map, I could strip the cheat flag from the "give" command, but not the "z_spawn" command, and on the next, I could strip it from the "z_spawn" command, but not the "give" command (this was in-between server restarts, so it wasn't something where the flag was already stripped).
I tried to implement this code with a single command for a simple plugin as well. It seemd that it only worked about half the time and I was unsure why. I would have to say as well that l4d seems very pickly about what command can be run when.
Antithasys is offline
recon0
Veteran Member
Join Date: Sep 2007
Location: US
Old 12-06-2008 , 06:26   Re: Admin Cheats
Reply With Quote #14

The concept of this plugin seems to me fundamentally wrong to me.

Cheating admins? That's just wrong. Really wrong.
__________________
recon0 is offline
Shiraishi
New Member
Join Date: Dec 2008
Old 12-07-2008 , 00:19   Re: Admin Cheats
Reply With Quote #15

The reason why it doesn't work for all the cvars is because it only focuses on cvars that are "commands" is there a way to change that though?
Shiraishi is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 12-07-2008 , 00:31   Re: Admin Cheats
Reply With Quote #16

For the record, cvars and commands are not the same thing. A command is something that directly runs a function. A cvar is a console variable, which only does something when it's value is queried. They're two very different things, and functions that alter flags and such for one of them, will most likely not work for the other.
bl4nk is offline
Shiraishi
New Member
Join Date: Dec 2008
Old 12-07-2008 , 17:14   Re: Admin Cheats
Reply With Quote #17

Haha i know, but i'm just wondering if sv_cheats could be omitted, what i think is that for that to happen =\ you may need to strip each cvar thats considered a cheat.... and i think that will take ages =.=;; but i'm trying to see if the title "cheats" for those cvars could be omitted so they could run normally o-o;
Shiraishi is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 12-07-2008 , 21:52   Re: Admin Cheats
Reply With Quote #18

Quote:
Originally Posted by Shiraishi View Post
Haha i know, but i'm just wondering if sv_cheats could be omitted, what i think is that for that to happen =\ you may need to strip each cvar thats considered a cheat.... and i think that will take ages =.=;; but i'm trying to see if the title "cheats" for those cvars could be omitted so they could run normally o-o;
It's possible (and fairly trivial) to remove the cheat flag from cvars. The same code in this plugin that removes it from commands can be applied to cvars directly. The problem with this is there is no *simple* way of only allowing admins to execute them. The best way around this would be a whitelist of cvars to remove the cheat flag from. At the moment I don't have the ability to write/test this plugin, so it's not something I can do.

@L4D issues: I'll give this a test when I get back to my real computer. I'm not sure that "give all" is valid though, try something like "give smg"

@bl4nk: I suspect that L4D might be doing something stupid, like having some commands explicitly check for sv_cheats, rather then relying on FCVAR_CHEAT to do the checking for them. This is definitely something that I can see being done, but that doesn't explain why it only works sometimes.
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 12-08-2008 , 10:19   Re: Admin Cheats
Reply With Quote #19

Quote:
Originally Posted by devicenull View Post
@bl4nk: I suspect that L4D might be doing something stupid, like having some commands explicitly check for sv_cheats, rather then relying on FCVAR_CHEAT to do the checking for them. This is definitely something that I can see being done, but that doesn't explain why it only works sometimes.
I thought that as well, so I implemented a check to see if the plugin could even find the cvar/cmd, and it was failing to do so.
bl4nk is offline
Shiraishi
New Member
Join Date: Dec 2008
Old 12-09-2008 , 03:28   Re: Admin Cheats
Reply With Quote #20

The plugin currently restricts any user other than the admin and console from using any cheats at all, this also includes cvars. Too bad I'm not that great with editing plugins, but i was wondering if you could try to apply the cheat flag removal to the cvars just like you did with the commands. The fact that you created a cvar (sm_admin_cheats_level) I think was enough to restrict it to the admin/console.
Shiraishi is offline
Reply


Thread Tools
Display Modes

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 07:55.


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