AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Solved need help with Environment Items ( csgo) (https://forums.alliedmods.net/showthread.php?t=339040)

raj kaul 08-11-2022 04:46

need help with Environment Items ( csgo)
 
So I want to use ent_create drone gun command, for this we need to do sv_cheats 1 issue is i want to do this only for admins but when we do cheats 1 other players can also use all cheats commands
Is there any way I can use this without doing sv cheats 1 or anything?

I tried multiple sv_cheats 1 admin plugins but those are not working for ent_create drone gun this command

Grey83 08-11-2022 09:05

Re: need help with Environment Items ( csgo)
 
PHP Code:

static const char CMD[] = "ent_create";
static 
int FLAGS;

public 
void OnPluginStart()
{
    
FLAGS GetCommandFlags(CMD);
    
SetCommandFlags(CMD, (FLAGS & ~FCVAR_CHEAT));
}

public 
void OnPluginEnd()
{
    
SetCommandFlags(CMDFLAGS);


But this plugin will allow to use ent_create with any arguments for any player.

Grey83 08-11-2022 09:08

Re: need help with Environment Items ( csgo)
 
Perhaps this will help to ban the command to players without admin rights, but you need to check.
PHP Code:

static const char CMD[] = "ent_create";
static 
int FLAGS;

public 
void OnPluginStart()
{
    
FLAGS GetCommandFlags(CMD);
    
SetCommandFlags(CMD, ( & ~FCVAR_CHEAT));

    
AddCommandListener(Cmd_DroneGunCMD);
}

public 
Action Cmd_DroneGun(int client, const char[] commandint argc)
{
    return 
client && IsClientInGame(client) && GetUserFlagBits(client) ? Plugin_Continue Plugin_Handled;
}

public 
void OnPluginEnd()
{
    
SetCommandFlags(CMDFLAGS);



raj kaul 08-11-2022 19:13

Re: need help with Environment Items ( csgo)
 
thank you grey :)


All times are GMT -4. The time now is 16:09.

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