AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [CSGO] SetCommandFlags & ~FCVAR_CHEAT not working (https://forums.alliedmods.net/showthread.php?t=334314)

Austin 09-15-2021 02:29

[CSGO] SetCommandFlags & ~FCVAR_CHEAT not working
 
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);



Bacardi 09-15-2021 15:04

Re: [CSGO] SetCommandFlags & ~FCVAR_CHEAT not working
 
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.


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

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