Jump to content

admin group


golanu21

Recommended Posts

bindKey(Key,"down", 
function () 
            guiSetVisible(fereastra,not guiGetVisible(fereastra)) 
            showCursor(guiGetVisible(fereastra)) 
     if ( guiGetVisible(fereastra) == true ) then 
             guiLabelSetColor(GUIEditor.label[5],math.random(0, 255), math.random(0, 255), math.random(0, 255)) 
    end 
end) 

how i make this to work for Admin in acl ?

Link to comment

like this ?>

bindKey(Key,"down", 
function (thePlayer) 
    local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
            guiSetVisible(fereastra,not guiGetVisible(fereastra)) 
            showCursor(guiGetVisible(fereastra)) 
            return 
            end 
     if ( guiGetVisible(fereastra) == true ) then 
             guiLabelSetColor(GUIEditor.label[5],math.random(0, 255), math.random(0, 255), math.random(0, 255)) 
end 
end) 
  

Link to comment
like this ?>
bindKey(Key,"down", 
function (thePlayer) 
    local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
            guiSetVisible(fereastra,not guiGetVisible(fereastra)) 
            showCursor(guiGetVisible(fereastra)) 
            return 
            end 
     if ( guiGetVisible(fereastra) == true ) then 
             guiLabelSetColor(GUIEditor.label[5],math.random(0, 255), math.random(0, 255), math.random(0, 255)) 
end 
end) 
  

Try it and post if It works or not.

Link to comment
---ClientSide 
addEvent('GUI', true) 
addEventHandler('GUI', root, 
    bindKey(Key,"down", 
function () 
            guiSetVisible(fereastra,not guiGetVisible(fereastra)) 
            showCursor(guiGetVisible(fereastra)) 
     if ( guiGetVisible(fereastra) == true ) then 
             guiLabelSetColor(GUIEditor.label[5],math.random(0, 255), math.random(0, 255), math.random(0, 255)) 
    end 
     end 
     )) 
      
---ServerSide  
   addEventHandler('onResourceStart', resourceRoot, 
   function ( ) 
       if isObjectInACLGroup('user.'..getAccountName(getPlayerAccount(source)),aclGetGroup('admin')) then 
       triggerClientEvent(source, 'GUI', source) 
       else 
       outputChatBox('Your Not Admin', source, 255, 0, 0) 
   end 
end 
) 

i write it fast it should work .

Link to comment
[22:23:07] WARNING: Gamemode\vehicles\server.lua:17: Bad argument @ 'getPlayerAccount' [Expected element at argument 1, got resource-data] 
[22:23:07] WARNING: Gamemode\vehicles\server.lua:17: Bad argument @ 'getAccountName' [Expected account at argument 1, got boolean] 
[22:23:07] ERROR: Gamemode\vehicles\server.lua:18: attempt to concatenate local 'accName' (a boolean value) 

Link to comment

---ServerSide

----ServerSide 
addEventHandler('onResourceStart', resourceRoot, 
function(thePlayer) 
    local accName = getAccountName ( getPlayerAccount ( thePlayer ) )  
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then  
     triggerClientEvent(thePlayer, 'GUI', thePlayer ) 
 end 
end 
) 

Link to comment
[22:29:32] WARNING: Gamemode\vehicles\server.lua:4: Bad argument @ 'getPlayerAccount' [Expected element at argument 1, got resource-data] 
[22:29:32] WARNING: Gamemode\vehicles\server.lua:4: Bad argument @ 'getAccountName' [Expected account at argument 1, got boolean] 
[22:29:32] ERROR: Gamemode\vehicles\server.lua:5: attempt to concatenate local 'accName' (a boolean value) 

Link to comment

-- Client --

xShowPanelFunction_ = function () 
            guiSetVisible(fereastra,not guiGetVisible(fereastra)); 
            showCursor(guiGetVisible(fereastra)); 
                 if ( guiGetVisible(fereastra) == true ) then 
             guiLabelSetColor(GUIEditor.label[5],math.random(0, 255), math.random(0, 255), math.random(0, 255)) 
    end 
end 
bindKey(Key,"down",xShowPanelFunction_); 
addEventHandler("Show",root,xShowPanelFunction_); 
addEvent("Show",true); 

-- Server --

CheckAdminFunction_ = function (  ) 
    if isObjectInACLGroup ("user."..getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Admin" ) ) then 
    triggerClientEvent("Show",source); 
    end 
end 
addEventHandler("onPlayerLogin",root,CheckAdminFunction_); 

logout and login again .

Link to comment
-- Client --

xShowPanelFunction_ = function () 
            guiSetVisible(fereastra,not guiGetVisible(fereastra)); 
            showCursor(guiGetVisible(fereastra)); 
                 if ( guiGetVisible(fereastra) == true ) then 
             guiLabelSetColor(GUIEditor.label[5],math.random(0, 255), math.random(0, 255), math.random(0, 255)) 
    end 
end 
bindKey(Key,"down",xShowPanelFunction_); 
addEventHandler("Show",root,xShowPanelFunction_); 
addEvent("Show",true); 

-- Server --

CheckAdminFunction_ = function (  ) 
    if isObjectInACLGroup ("user."..getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Admin" ) ) then 
    triggerClientEvent("Show",source); 
    end 
end 
addEventHandler("onPlayerLogin",root,CheckAdminFunction_); 

logout and login again .

work for Everyone WTF???

Link to comment
You Have A resource that dont let the Account work Correct post full code .

it's a big script but i can put that

GUIEditor = { 
    label = {}, 
} 
fereastra = guiCreateWindow(773, 239, 607, 576, "Admin Panel", false) 
guiWindowSetSizable(fereastra, false) 
  
Close = guiCreateButton(415, 475, 183, 92, "Close", false, fereastra) 
guiSetProperty(Close, "NormalTextColour", "FFAAAAAA") 
pos = guiCreateGridList(9, 357, 239, 210, false, fereastra) 
poscol = guiGridListAddColumn(pos, "Posibilites", 0.9) 
kick = guiCreateGridList(10, 145, 238, 211, false, fereastra) 
guiGridListAddColumn(kick, "Kick Player", 0.9) 
kickbtn = guiCreateButton(248, 145, 124, 59, "Kick Him", false, fereastra) 
guiSetProperty(kick, "NormalTextColour", "FFAAAAAA") 
set = guiCreateButton(250, 427, 134, 59, "set", false, fereastra) 
guiSetProperty(set, "NormalTextColour", "FFAAAAAA") 
ban = guiCreateButton(248, 298, 124, 58, "Ban Him", false, fereastra) 
guiSetProperty(ban, "NormalTextColour", "FFAAAAAA") 
freeze = guiCreateButton(248, 204, 124, 94, "Freeze Him", false, fereastra) 
guiSetProperty(freeze, "NormalTextColour", "FFAAAAAA") 
vehicles = guiCreateGridList(379, 145, 219, 208, false, fereastra) 
guiGridListAddColumn(vehicles, "Vehicles", 0.9) 
giveveh = guiCreateButton(426, 356, 144, 55, "Give", false, fereastra) 
guiSetProperty(giveveh, "NormalTextColour", "FFAAAAAA") 
GUIEditor.label[1] = guiCreateLabel(9, 21, 36, 15, "Name:", false, fereastra) 
GUIEditor.label[2] = guiCreateLabel(10, 42, 39, 15, "Health:", false, fereastra) 
GUIEditor.label[3] = guiCreateLabel(10, 62, 44, 15, "Armour:", false, fereastra) 
GUIEditor.label[5] = guiCreateLabel(248, 50, 326, 57, "Admin Panel", false, fereastra) 
guiSetFont(GUIEditor.label[5], "sa-header") 
guiLabelSetColor(GUIEditor.label[5], 0, 0, 0) 
numele = guiCreateLabel(46, 21, 120, 15, "", false, fereastra) 
viata = guiCreateLabel(49, 42, 117, 15, "", false, fereastra) 
armura = guiCreateLabel(59, 62, 114, 15, "", false, fereastra) 
  
  
guiSetVisible(fereastra, false ) 
  
  
-- Script -- 
  
--close button 
addEventHandler("onClientGUIClick",Close, 
function () 
    guiSetVisible(fereastra, false ) 
    showCursor(false) 
end 
) 
--start window 
  
xShowPanelFunction_ = function () 
            guiSetVisible(fereastra,not guiGetVisible(fereastra)); 
            showCursor(guiGetVisible(fereastra)); 
                 if ( guiGetVisible(fereastra) == true ) then 
             guiLabelSetColor(GUIEditor.label[5],math.random(0, 255), math.random(0, 255), math.random(0, 255)) 
    end 
end 
bindKey(Key,"down",xShowPanelFunction_); 
addEventHandler("Show",root,xShowPanelFunction_); 
addEvent("Show",true); 
  

Link to comment

-- Server --

addEventHandler( 'onPlayerLogin', root, function( _, acc ) 
    if isObjectInACLGroup( 'user.'..getAccountName( acc ), aclGetGroup( "Admin" ) ) then 
        setElementData( source, 'OpenPanel', true) 
    else 
        setElementData( source, 'OpenPanel', nil)    
    end 
end 
) 
  
addEventHandler( 'onPlayerJoin', root, function() 
    setElementData( source, 'OpenPanel', nil) 
end ) 

-- Client --

bindKey(Key,"down", 
function () 
      if getElementData( localPlayer, 'OpenPanel') ~= nil then  
            guiSetVisible(fereastra,not guiGetVisible(fereastra)); 
            showCursor(guiGetVisible(fereastra)); 
                 if ( guiGetVisible(fereastra) == true ) then 
             guiLabelSetColor(GUIEditor.label[5],math.random(0, 255), math.random(0, 255), math.random(0, 255)) 
             end 
       end 
end 
) 
  
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...