How can I make commands for a class only

Example I need this to
SUPERVIP(A VIP CLASS I MADE) Is just so I can learn, I don’t really need this CODE


local Frame = vgui.Create( "DFrame" )
Frame:SetTitle( "Test panel" )
Frame:SetSize( 300, 300 )
Frame:Center()
Frame:MakePopup()
Frame.Paint = function( self, w, h ) -- 'function Frame:Paint( w, h )' works too
	draw.RoundedBox( 0, 0, 0, w, h, Color( 231, 76, 60, 150 ) ) -- Draw a red box instead of the frame
end

local Button = vgui.Create( "DButton", Frame )
Button:SetText( "Click me I'm pretty!" )
Button:SetTextColor( Color( 255, 255, 255 ) )
Button:SetPos( 100, 100 )
Button:SetSize( 100, 30 )
Button.Paint = function( self, w, h )
	draw.RoundedBox( 0, 0, 0, w, h, Color( 41, 128, 185, 250 ) ) -- Draw a blue button
end
Button.DoClick = function()
	print( "I was clicked!" )
end

[lua]
local Frame = vgui.Create( “DFrame” )
Frame:SetTitle( “Test panel” )
Frame:SetSize( 300, 300 )
Frame:Center()
Frame:MakePopup()
Frame.Paint = function( self, w, h ) – ‘function Frame:Paint( w, h )’ works too
draw.RoundedBox( 0, 0, 0, w, h, Color( 231, 76, 60, 150 ) ) – Draw a red box instead of the frame
end

if (LocalPlayer():Team() == TEAM_SUPERVIP) then – Change this to work with your team

local Button = vgui.Create( "DButton", Frame )
Button:SetText( "Click me I'm pretty!" )
Button:SetTextColor( Color( 255, 255, 255 ) )
Button:SetPos( 100, 100 )
Button:SetSize( 100, 30 )
Button.Paint = function( self, w, h )
	draw.RoundedBox( 0, 0, 0, w, h, Color( 41, 128, 185, 250 ) ) -- Draw a blue button
end
Button.DoClick = function()
	print( "I was clicked!" )
end

end
[/lua]

I assumed you were using it for DarkRP, if SuperVIP is a usergroup, just change the if statement. If the button sends something to the server, make sure to check if the player has permission to click the button also.

Its a usergroup, how do I change?
Like this is a job isnt it?

[lua]
if (LocalPlayer():IsUserGroup( “SUPERVIP”)) then – Change this to work with your usergroup

end
[/lua]

Thank you Ç)

If I am making like this server side
include(“autorun/svrhoppercfg.lua”)

hook.Add( “PlayerSay”, “ServerHopperCMD”, function( ply, text )

if ( text == '!servers' ) then

            ply:ConCommand('OpenSvrHpr')

            return ""

    end

end)

How can I make SuperVip only?
If this is going to call a clientside?

Exact same way as stated above, however all this is doing is making a chat command restricted to SuperVIPs, it won’t disallow the calling of that command.

How would someone call it?

By typing OpenSvrHpr into their console.

Okay got it