Jump to content

ACL Group Admin will be moven to staff team when login?


Jullul7000

Recommended Posts

local staff = createTeam("Staff", 255, 255, 255) 
  
function onLogin(thePlayer) 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
setPlayerTeam(thePlayer, staff) 
end 
end 
addEventHandler("onPlayerLogin", getRootElement(), onLogin) 
  

Something like this, i can't test it atm as i'm not on my PC. If it doesn't work, tell me what debugscript says.

Link to comment
  • Moderators

or

function onLogin(thePlayer) 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
    if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
        setPlayerTeam(thePlayer, getTeamFromName ('Staff')) 
    end 
end 
addEventHandler("onPlayerLogin", getRootElement(), onLogin) 

Link to comment

^^ You both wrong, onPlayerLogin doesn't have player parameter.

local staff = createTeam("Staff", 255, 255, 255) 
  
addEventHandler("onPlayerLogin", root, 
function(_, acc) 
    local accName = getAccountName(acc) 
    if isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) then 
        setPlayerTeam(source, staff) 
    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...