View Single Post
Austin
Senior Member
Join Date: Oct 2005
Old 05-04-2023 , 03:29   Re: [CSGO] Enable sv_cheats 1 but only for certain players?
Reply With Quote #10

Quote:
Originally Posted by Maxximou5 View Post
bot_stop is an rcon command or listen server command, not a player command. You would need to use rcon bot_stop to be able to use it.

If you want to test sv_cheats is working, just join with the code I provided and try the command in console - thirdperson

If you are unable to go thirdperson, most likely you have a plugin that is blocking.
I found a work around for now but still would like to get this working.

I think the problem is I don't understand what this
SendConVarValue() is supposed to do.

I am thinking it enables the ability for the specified player to use any server command that needs to have
sv_cheats 1

The code as shown doesn't work that way.

And I don't understand the answer since I am not sure of what you mean by "player commands"

For what I know there are only two types of csgo commands
1) Commands for the server
You can enter them right at the server console
or
you can enter them from rcon
There is no difference using rcon.
It is exactly like you issued the server command at the server console.

2) The only other csgo commands I know of are client commands
These are entered at the game's player's console.

What are "player commands"?
What do you mean by 2rd person?

For now I have an OK workaround where I enable sv_cheats 1 only when I am on the server.

Thanks to everyone for the replies.

PHP Code:
#pragma newdecls required
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>

public void OnPluginStart()
{
    
HookEvent("player_connect_full"Event_PlayerConnectFull);
    
HookEvent("player_disconnect",        Event_PlayerDisconnect);

    
PrintToServer("ABS_CSGO_Cheats Loaded");
    
PrintToChatAll("ABS_CSGO_Cheats Loaded");
}

public 
void Event_PlayerConnectFull(Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid"));
    
CheckForAustinclienttrue);
}

public 
Action Event_PlayerDisconnect(Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid"));
    
CheckForAustinclientfalse);
}

public 
void CheckForAustin(int clientbool connecting)
{
    
char steamId[64];
    if (
<= client <= MaxClients)
    {
        
GetClientAuthId(clientAuthId_Steam2steamId128);
        
// Austin - Server Owner
        
if (strcmp(steamId"STEAM_1:0:1234567890")    == 0)
            if (
connecting)
                
ServerCommand("sv_cheats 1");
            else
                
ServerCommand("sv_cheats 0");
    }
}

public 
void OnPluginEnd()
{
    
ServerCommand("sv_cheats 0");


Last edited by Austin; 05-04-2023 at 03:46.
Austin is offline