View Single Post
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