Jump to content

I fail...


Recommended Posts

Hi.

I'm trying to make an admin "hud". It's basically some labels, which display down the screen, so you know your account name, admin level and nickname. I can't seem to get it working though. No errors are displayed. I checked both, server window and debugscript. It's a simple thing, thought I can't do it... Help? :3

Client code

function createGUI(acc, atype, pname) 
  
accname = guiCreateLabel(11,745,96,18,string(acc),false) 
  
admtype = guiCreateLabel(135,745,96,18,string(atype),false) 
  
nick = guiCreateLabel(280,745,96,18,string(pname),false) 
  
end 
addEvent("infosend", true) 
addEventHandler("infosend", root, createGUI) 

Server code

function check() 
  
acc = getAccountName(source) 
  
    if isObjectInACLGroup("user."..acc, ACLGetGroup("admin"))   then 
         
        atype = "admin" 
        pname = getPlayerName(source) 
        triggerClientEvent("infosend", root, acc, atype, pname) 
         
        else 
     
    end 
  
end 
  

Note: I only wrote 1 acl group yet, for the testing to be easier. I made this script quickly(2 minutes) because I was on a rush.

Link to comment
function check() 
    local acc = getPlayerAccount(source) 
    local accName = getAccountName(acc) 
  
    if isObjectInACLGroup("user."..acc, aclGetGroup("admin"))   then 
        
        atype = "admin" 
        pname = getPlayerName(source) 
        triggerClientEvent(source, "infosend", source, accName, atype, pname) 
    end 
end 

Link to comment
  • Other Languages Moderators

it's 'aclGetGroup' not 'ACLGetGroup'

function check() 
    local acc = getPlayerAccount(source) 
    local accName = getAccountName(acc) 
  
    if isObjectInACLGroup("user."..acc, aclGetGroup("admin")) then 
        
        atype = "admin" 
        pname = getPlayerName(source) 
        triggerClientEvent(source, "infosend", source, accName, atype, pname) 
    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...