Raised This Month: $ Target: $400
 0% 

sv_cheats 1 only admin for CSGO


Post New Thread Reply   
 
Thread Tools Display Modes
supreeda
Senior Member
Join Date: Jul 2015
Old 08-14-2015 , 05:46   Re: sv_cheats 1 only admin for CSGO
Reply With Quote #11

Quote:
Originally Posted by Bacardi View Post
ok, you are rigth. Cheat commands not follow player cvar sv_cheats, only server.
Then try this, which work backwards.
Leave server sv_cheats 0 and admins which have access to "sm_sv_cheats_enable" get sv_cheats 1

*edit
Notice, now cheat command like noclip will not work even admin have sv_cheats 1, but console variable like r_drawothermodels 2 works.

PHP Code:
new Handle:cvar_sv_cheats;
new 
bool:bool_sv_cheats;

public 
OnPluginStart()
{
    
cvar_sv_cheats FindConVar("sv_cheats");
    if(
cvar_sv_cheats == INVALID_HANDLE)
    {
        
SetFailState("Cvar sv_cheats not exist!");
    }
    
HookConVarChange(cvar_sv_cheatsconvarchanged);
    
convarchanged(INVALID_HANDLENULL_STRINGNULL_STRING);
}

public 
convarchanged(Handle:cvar, const String:oldValue[], const String:newValue[])
{
    
bool_sv_cheats GetConVarBool(cvar_sv_cheats);
    
CreateTimer(0.1delayed_TIMER_FLAG_NO_MAPCHANGE);
}

public 
Action:delayed(Handle:timer)
{
    for(new 
1<= MaxClientsi++)
    {
        if(
IsClientInGame(i))
        {
            
OnClientPostAdminCheck(i);
        }
    }
}

public 
OnClientPostAdminCheck(client)
{
    if(
bool_sv_cheats || IsFakeClient(client))
        return;

    if(
CheckCommandAccess(client"sm_sv_cheats_enable"ADMFLAG_ROOT) && SendConVarValue(clientcvar_sv_cheats"1"))
    {
        
PrintToConsole(client"\n\n\n      sm_sv_cheats_enable = ACCESS GRANTED!\n     sv_cheats enabled!!\n\n\n");
    }


Work Fine
Finally

But it only r_drawothermodels ?

Last edited by supreeda; 08-14-2015 at 05:49.
supreeda is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-14-2015 , 05:59   Re: sv_cheats 1 only admin for CSGO
Reply With Quote #12

Quote:
Originally Posted by supreeda View Post
Work Fine
Finally

But it only r_drawothermodels ?
all kinds client cvars and commands which you find when you type in your game console
findflags CHEAT

but not all cheat commands work, like example noclip
__________________
Do not Private Message @me

Last edited by Bacardi; 08-14-2015 at 06:00.
Bacardi is offline
silas1337
New Member
Join Date: Nov 2015
Old 11-29-2015 , 17:04   Re: sv_cheats 1 only admin for CSGO
Reply With Quote #13

I'm a noob, in what folder should i put this script?
silas1337 is offline
supreeda
Senior Member
Join Date: Jul 2015
Old 11-30-2015 , 06:09   Re: sv_cheats 1 only admin for CSGO
Reply With Quote #14

Quote:
Originally Posted by silas1337 View Post
I'm a noob, in what folder should i put this script?
Just learn Frist step how to compile code !

addons/Script/
Include #Filename
supreeda is offline
silas1337
New Member
Join Date: Nov 2015
Old 11-30-2015 , 08:50   Re: sv_cheats 1 only admin for CSGO
Reply With Quote #15

Quote:
Originally Posted by supreeda View Post
Just learn Frist step how to compile code !

addons/Script/
Include #Filename
I don't understand what the filename should be
silas1337 is offline
supreeda
Senior Member
Join Date: Jul 2015
Old 12-01-2015 , 10:41   Re: sv_cheats 1 only admin for CSGO
Reply With Quote #16

Quote:
Originally Posted by silas1337 View Post
I don't understand what the filename should be
see first it have include or not if not you can compile by Sourcemod

here http://www.sourcemod.net/compiler.php

if it have include you will download include file that want and download last version sourcemod
addons/script/compile.exe/

insert include on folder include
supreeda is offline
TropieR
Junior Member
Join Date: May 2015
Old 02-01-2016 , 15:49   Re: sv_cheats 1 only admin for CSGO
Reply With Quote #17

Quote:
Originally Posted by supreeda View Post
see first it have include or not if not you can compile by Sourcemod

here http://www.sourcemod.net/compiler.php

if it have include you will download include file that want and download last version sourcemod
addons/script/compile.exe/

insert include on folder include
. Can you make clear steps? Like 1.Learn to compile code 2... Etc
TropieR 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 23:27.


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