1. This forum is ARCHIVED! Visit the new Cloud Sixteen forums, codename Eden, at https://eden.cloudsixteen.com. These forums will remain archived for a few months before being closed down, so try to encourage plugin developers to begin moving their content across to the new forums.
Dismiss Notice
Hi Guest, you need a Steam account to register and post on these forums. Login with Steam at the top of the forums to get started!
Dismiss Notice
Hi Guest, do you want to buy HL2RP or another Clockwork schema? Visit the Cloud Sixteen Store to get started!

[HL2RP]Editing Admins Possibilities

Discussion in 'Discussion' started by Jokky, Jul 13, 2013.

  1. Where i can edit possibilities of an admin?
     
  2. Possibilities? As in?
     
  3. Yep.
     
  4. Luberjack

    Luberjack pandafish alias

    I think he means like editing admin permissions. Ex. making operators able to static props, admins able to /charsetmodel etc.
     
  5. Excactly. Allow to use noclip and etc
     
  6. Faoeoa

    Faoeoa Bored as shit, will do simple devving.

    If you look in the HL2RP files for commands, there MIGHT be an access flag like o, a, s etc.

    I'm assuming o = operator, a = admin and s = superadmin.
    The flag is the lowest rank that can use it, if there is no flag, everyone can use it, if it's o, all administrators + operator can use it and so on.

    For example:

    Code:
    --[[
    	? 2013 CloudSixteen.com do not share, re-distribute or modify
    	without permission of its author ([email protected]).
    --]]
    
    local COMMAND = Clockwork.command:New("CharSetCustomClass");
    COMMAND.tip = "Set a character's custom class.";
    COMMAND.text = "<string Name> <string Class>";
    COMMAND.access = "o";
    COMMAND.arguments = 2;
    
    -- Called when the command has been run.
    function COMMAND:OnRun(player, arguments)
    	local target = Clockwork.player:FindByID( arguments[1] )
    	
    	if (target) then
    		target:SetCharacterData( "customclass", arguments[2] );
    		
    		Clockwork.player:NotifyAll(player:Name().." set "..target:Name().."'s custom class to "..arguments[2]..".");
    	else
    		Clockwork.player:Notify(player, arguments[1].." is not a valid character!");
    	end;
    end;
    
    COMMAND:Register();
    The line COMMAND.access = "o"; can be changed to "a" to make it admin+, rather than operator+


    Code:
    --[[
    	? 2013 CloudSixteen.com do not share, re-distribute or modify
    	without permission of its author ([email protected]).
    --]]
    
    local COMMAND = Clockwork.command:New("CharSetCustomClass");
    COMMAND.tip = "Set a character's custom class.";
    COMMAND.text = "<string Name> <string Class>";
    COMMAND.access = "a";
    COMMAND.arguments = 2;
    
    -- Called when the command has been run.
    function COMMAND:OnRun(player, arguments)
    	local target = Clockwork.player:FindByID( arguments[1] )
    	
    	if (target) then
    		target:SetCharacterData( "customclass", arguments[2] );
    		
    		Clockwork.player:NotifyAll(player:Name().." set "..target:Name().."'s custom class to "..arguments[2]..".");
    	else
    		Clockwork.player:Notify(player, arguments[1].." is not a valid character!");
    	end;
    end;
    
    COMMAND:Register();
     
  7. How can i enable noclip for admin?(a)
     
  8. Faoeoa

    Faoeoa Bored as shit, will do simple devving.

    I'm not sure, actually, I know one or two servers allow SAs to noclip but doesn't have observer, so i'm not entirely sure.
     
  9. Code:
    --[[
    	? 2013 CloudSixteen.com do not share, re-distribute or modify
    	without permission of its author ([email protected]).
    --]]
    
    local COMMAND = Clockwork.command:New("Observer");
    COMMAND.tip = "Enter or exit observer mode.";
    COMMAND.flags = CMD_DEFAULT;
    COMMAND.access = "o";
    
    -- Called when the command has been run.
    function COMMAND:OnRun(player, arguments)
    	if (player:Alive() and !player:IsRagdolled() and !player.cwObserverReset) then
    		if (player:GetMoveType(player) == MOVETYPE_NOCLIP) then
    			cwObserverMode:MakePlayerExitObserverMode(player);
    		else
    			cwObserverMode:MakePlayerEnterObserverMode(player);
    		end;
    	end;
    end;
    
    COMMAND:Register();
    garrysmod\gamemodes\clockwork\plugins\observermode\plugin\commands\sh_observer.lua

    To change the acces,
    change
    Code:
    COMMAND.access = "o";
    into either
    Code:
    COMMAND.access = "a";
    or
    Code:
    COMMAND.access = "s";
    Thanks to Datzy for noticing it's "s" and not "sa".
     
  10. Datzy

    Datzy Guest

    fixed

    "s" and "a" are separate flags lol
     
  11. Thanks for noticing, edited the original post, too.
     

Previous Readers (Total: 0)