Jump to content

Automatic Team join ?


Spyke25

Recommended Posts

Hi guys, my server had this function : Join the server > Login as admin > Join the team > Quit the game > Join the game > Login as admin > Will join the team automatically.

But now, i haven't that anymore, i dont know why, someone know how to enable this function again ? Thanks. :)

Link to comment
  
-- Create a team when the resource starts 
local adminTeam = createTeam("Admin", 255, 0, 0) 
function setTeamOnLogin() 
-- Get the account name of the player who logged in 
     local account = getAccountName(getPlayerAccount(source)) 
-- Check if the player who logged in is an admin 
     if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then 
-- If they are, set their team to admin 
        setPlayerTeam(source, adminTeam) 
    else 
-- If they aren't admin then end(or implement what you would like to happen if they aren't an admin. ) 
    end 
end 
addEventHandler("onPlayerLogin", getRootElement(), setTeamOnLogin) 
  

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...