Raised This Month: $51 Target: $400
 12% 

Admin Flag N (Cheats Flag) Issue


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Blackglade
Senior Member
Join Date: Jul 2012
Location: NYC
Old 05-22-2017 , 18:54   Admin Flag N (Cheats Flag) Issue
Reply With Quote #1

A little bit confused here... looking on here:

https://wiki.alliedmods.net/Adding_Admins_(SourceMod)

it says that the admin flag n allows the player to set the sv_cheats command. How can you do this without having the rcon or change cvar command? Assuming the only flags the admin has is abcdefgjkrn
Blackglade is offline
hamilton5
Veteran Member
Join Date: Oct 2012
Location: USA
Old 05-22-2017 , 23:23   Re: Admin Flag N (Cheats Flag) Issue
Reply With Quote #2

why would you allow a player to control cheating and not allow simple cvar changes or rcon access?
hamilton5 is offline
Bobakanoosh
Senior Member
Join Date: Sep 2015
Location: United States
Old 05-22-2017 , 23:24   Re: Admin Flag N (Cheats Flag) Issue
Reply With Quote #3

You could make a command that runs sv_cheats as the server:

Code:
bool g_bEnabled;

public OnPluginStart() {

	RegAdminCmd("sm_enablecheats", Command_EnableCheats, ADMFLAG_CHANGEMAP, "Sets sv_cheats to 1"); 
	
}

public Action Command_EnableCheats(int client, int args) {

	if(MaxClients < client < 2)
		return Plugin_Handled;

	if(g_bEnabled) {
	
		ServerCommand("sv_cheats 0");
		PrintToChat(client, "You've disabled sv_cheats.");
                g_bEnabled = false;
	
	} else {
	
		ServerCommand("sv_cheats 1");
		PrintToChat(client, "You've enabled sv_cheats.");
                g_bEnabled = true;
	
	}
		
	return Plugin_Handled;

}
Just change the ADMFLAG_ to any of these: https://sm.alliedmods.net/new-api/admin/AdminFlag depending on who you want to have access.

https://sm.alliedmods.net/new-api/console/ServerCommand

Last edited by Bobakanoosh; 05-22-2017 at 23:26. Reason: Didn't change g_bEnabled
Bobakanoosh is offline
Blackglade
Senior Member
Join Date: Jul 2012
Location: NYC
Old 05-23-2017 , 20:29   Re: Admin Flag N (Cheats Flag) Issue
Reply With Quote #4

I'm just a little confused by what the n flag exactly does since admins can change sv_cheats without even having it...
Blackglade is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 05-23-2017 , 21:17   Re: Admin Flag N (Cheats Flag) Issue
Reply With Quote #5

sm_cvar and sm_resetcvar check for the flag.
Fyren 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 21:55.


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