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

[CSGO] sv_cheats 1 only for Sourcemod Admins


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kongzted
Junior Member
Join Date: Dec 2015
Location: Denmark
Old 12-28-2015 , 13:26   [CSGO] sv_cheats 1 only for Sourcemod Admins
Reply With Quote #1

Hello guys!

I was wondering if it's possible to make a plugin that only allows Sourcemod Admins to use sv_cheats's functions? Such as cl_drawothermodels 2 and so on?

(I know it's silly, but i would like to know) :p

Regartz
Kongzted
__________________
Hello Peeps!
kongzted is offline
Send a message via Skype™ to kongzted
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 12-28-2015 , 13:34   Re: [CSGO] sv_cheats 1 only for Sourcemod Admins
Reply With Quote #2

Yes it is. A quick solution would be to create a command (for exemple !cheats [cl_drawothermodels 2]) and force the server to do sv_cheats 1 -> your command -> sv_cheats 0. BUT during this time (extremly low) anybody would be able to perform thos commands as well.
__________________
Want to check my plugins ?
Arkarr is offline
kongzted
Junior Member
Join Date: Dec 2015
Location: Denmark
Old 12-28-2015 , 13:49   Re: [CSGO] sv_cheats 1 only for Sourcemod Admins
Reply With Quote #3

But how?
__________________
Hello Peeps!
kongzted is offline
Send a message via Skype™ to kongzted
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 12-28-2015 , 13:56   Re: [CSGO] sv_cheats 1 only for Sourcemod Admins
Reply With Quote #4

Quote:
Originally Posted by kongzted View Post
But how?
Like this ?

EDIT:
PHP Code:
#include <sourcemod>
#include <sdktools>

#define PLUGIN_AUTHOR "Arkarr"
#define PLUGIN_VERSION "1.00"

Handle CVAR_SvCheats;

public 
Plugin myinfo 
{
    
name "[ANY] SV_CHEATS hack",
    
author PLUGIN_AUTHOR,
    
description "Allow you to use commands wich would normal require having sv_cheats set to 1",
    
version PLUGIN_VERSION,
    
url "http://www.sourcemod.net"
};

public 
void OnPluginStart()
{
    
RegAdminCmd("sm_cheat"CMD_ByPassSVCHeatsADMFLAG_CHEATS"Allow you to use a sv_cheats command");
    
    
CVAR_SvCheats FindConVar("sv_cheats");
}

public 
Action CMD_ByPassSVCHeats(clientargs)
{
    if(
args 1)
    {
        
ReplyToCommand(client"[SM] Usage sm_cheats [command]");
        return 
Plugin_Continue;    
    }
    
    
char command[45];
    
    
GetCmdArg(1commandsizeof(command));
    
    
SetConVarInt(CVAR_SvCheats1truefalse);
    
ServerCommand(command);
    
SetConVarInt(CVAR_SvCheats0truefalse);
    
    
ReplyToCommand(client"[SM] You executed '%s'"command);
    
    return 
Plugin_Handled;    

__________________
Want to check my plugins ?

Last edited by Arkarr; 12-28-2015 at 14:03.
Arkarr is offline
kongzted
Junior Member
Join Date: Dec 2015
Location: Denmark
Old 12-28-2015 , 14:07   Re: [CSGO] sv_cheats 1 only for Sourcemod Admins
Reply With Quote #5

Okay.. I'm pretty new to sourcemod plugins, so could you describe how to do it?
__________________
Hello Peeps!
kongzted is offline
Send a message via Skype™ to kongzted
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 12-28-2015 , 14:52   Re: [CSGO] sv_cheats 1 only for Sourcemod Admins
Reply With Quote #6

Quote:
Originally Posted by kongzted View Post
Okay.. I'm pretty new to sourcemod plugins, so could you describe how to do it?
Compille the code, put it in the plugins folder, reload the map and type !cheat in the chat. That's it !
__________________
Want to check my plugins ?
Arkarr 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 07:32.


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