Raised This Month: $ Target: $400
 0% 

sv_cheats 1 only admin for CSGO


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
supreeda
Senior Member
Join Date: Jul 2015
Old 08-13-2015 , 14:30   sv_cheats 1 only admin for CSGO
Reply With Quote #1

ty.
supreeda is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-13-2015 , 15:07   Re: sv_cheats 1 only admin for CSGO
Reply With Quote #2

https://forums.alliedmods.net/showth...16#post2043116

Here's version where you leave sv_cheats 1 on server, but public players and admins who not have access
to "sm_sv_cheats_enable", which hold flag "z"
are forced to use sv_cheats 0 when they enter on server.
__________________
Do not Private Message @me
Bacardi is offline
supreeda
Senior Member
Join Date: Jul 2015
Old 08-13-2015 , 16:34   Re: sv_cheats 1 only admin for CSGO
Reply With Quote #3

Quote:
Originally Posted by Bacardi View Post
https://forums.alliedmods.net/showth...16#post2043116

Here's version where you leave sv_cheats 1 on server, but public players and admins who not have access
to "sm_sv_cheats_enable", which hold flag "z"
are forced to use sv_cheats 0 when they enter on server.
Ty
supreeda is offline
supreeda
Senior Member
Join Date: Jul 2015
Old 08-13-2015 , 16:35   Re: sv_cheats 1 only admin for CSGO
Reply With Quote #4

i set sv_cheats 1 on or can use on sv_cheats 0 ?
supreeda is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-13-2015 , 16:47   Re: sv_cheats 1 only admin for CSGO
Reply With Quote #5

leave sv_cheats 1 on server

*edit
you can also into middle of game switch sv_cheats between 0/1 and it still work, but work on sv_cheats 1 mode.
__________________
Do not Private Message @me

Last edited by Bacardi; 08-13-2015 at 16:49.
Bacardi is offline
supreeda
Senior Member
Join Date: Jul 2015
Old 08-13-2015 , 16:50   Re: sv_cheats 1 only admin for CSGO
Reply With Quote #6

Quote:
Originally Posted by Bacardi View Post
leave sv_cheats 1 on server

*edit
you can also into middle of game switch sv_cheats between 0/1 and it still work
i compiled it on 1.7.2 it not error to use

but i can't type sm_sv_cheats_enable
it say Unknow command how ?
supreeda is offline
supreeda
Senior Member
Join Date: Jul 2015
Old 08-13-2015 , 18:18   Re: sv_cheats 1 only admin for CSGO
Reply With Quote #7

@Fix pls
1. it can use only sv_cheats 1
2. if i change sv_cheats 1 myfriend can use all command too
3. plugin no eror no bug but enable on sv_cheats 1
supreeda is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 08-13-2015 , 18:23   Re: sv_cheats 1 only admin for CSGO
Reply With Quote #8

no, it's not actually command, it's one way give access to admins and override to use different flags than "z".
add in admin_overrides.cfg inside {block}
"sm_sv_cheats_enable" "b"
then admins who have b flag get it work.
They should see message in they own in-game console.

Tell again if you didn't get it. I go sleep
__________________
Do not Private Message @me
Bacardi is offline
supreeda
Senior Member
Join Date: Jul 2015
Old 08-13-2015 , 18:35   Re: sv_cheats 1 only admin for CSGO
Reply With Quote #9

Quote:
Originally Posted by Bacardi View Post
no, it's not actually command, it's one way give access to admins and override to use different flags than "z".
add in admin_overrides.cfg inside {block}
"sm_sv_cheats_enable" "b"
then admins who have b flag get it work.
They should see message in they own in-game console.

Tell again if you didn't get it. I go sleep
I DONT KNOW T_T

This my Overrides but it can't use
Quote:
Overrides
{
/**
* By default, commands are registered with three pieces of information:
* 1)Command Name (for example, "csdm_enable")
* 2)Command Group Name (for example, "CSDM")
* 3)Command Level (for example, "changemap")
*
* You can override the default flags assigned to individual commands or command groups in this way.
* To override a group, use the "@" character before the name. Example:
* Examples:
* "@CSDM" "b" // Override the CSDM group to 'b' flag
* "csdm_enable" "bgi" // Override the csdm_enable command to 'bgi' flags
*
* Note that for overrides, order is important. In the above example, csdm_enable overwrites
* any setting that csdm_enable previously had.
*
* You can make a command completely public by using an empty flag string.
*/
"sm_sv_cheats_enable" "a"
}

I set my acc to flags a but it not work

[it can type in console : NOCLIP]
in sv_cheats 0 ?

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

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");
    }

__________________
Do not Private Message @me

Last edited by Bacardi; 08-14-2015 at 03:04.
Bacardi 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 13:05.


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