Raised This Month: $32 Target: $400
 8% 

[CSGO] SetCommandFlags & ~FCVAR_CHEAT not working


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Austin
Senior Member
Join Date: Oct 2005
Old 09-15-2021 , 02:29   [CSGO] SetCommandFlags & ~FCVAR_CHEAT not working
Reply With Quote #1

I have the following plugin to remove the cheat requirement from certain commands.
This works in L4D2 for L4D2 commands, but not in CSGO.
?

PHP Code:
public OnMapStart()
{
    
FixCommand("noclip");
    
FixCommand("give");

    
FixCommand("bot_kick");
    
FixCommand("bot_stop");
    
FixCommand("bot_kill");

    
FixCommand("bot_quota");
    
FixCommand("bot_join_team");
    
FixCommand("mp_humanteam");
}

public 
FixCommand(String:cmd[50])
{
    new 
OrigFlags;
    
OrigFlags GetCommandFlags(cmd);
    
SetCommandFlags(cmdOrigFlags & ~FCVAR_CHEAT);


Last edited by Austin; 09-15-2021 at 02:30.
Austin is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 09-15-2021 , 15:04   Re: [CSGO] SetCommandFlags & ~FCVAR_CHEAT not working
Reply With Quote #2

Just keep in mind.

There are console commands.
There are also, console variables aka cvars, convars.

Commands mostly, execute immediately some code, and some accepts arguments.

Console Variables are settings for server, server read those values on specific event/action/time.

You can try use sm_cvar command for cvars which not work without sv_cheats 1

*edit
Another thing you need keep in mind.

You use commands or cvars either server side (srcds) OR client side (hl2.exe).

- Client in server need use remote control (rcon) to use commands or cvars on server. Or plugin commands sm_rcon, sm_cvar.
- You can't change client command cheat flag from server. Only server own commands.

You could just create plugin which work like those originals.

Last edited by Bacardi; 09-15-2021 at 15:12.
Bacardi 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 22:12.


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