Jump to content

onPlayerJoin, require help


GamingTim

Recommended Posts

Alright i'm totally new to coding but i know "some" basics. I'm not sure on how to set a player to an admin team if he's an admin when he joins. I created a team on the default MTA admin panel but when I reconnect it doesn't set the player which was added as an admin to the admin team. what code should I add? or which ones should i use?

Link to comment
local team = createTeam("Admin",255,255,255) 
function setTeam(_, acc) 
    if isObjectInACLGroup("user."..getAccountName(acc), aclGetGroup("Admin")) then 
        setPlayerTeam(source, team) 
    end 
end 
addEventHandler("onPlayerLogin",root, setTeam) 

Link to comment
local team = createTeam("Admin",255,255,255) 
function setTeam(_, acc) 
    if isObjectInACLGroup("user."..getAccountName(acc), aclGetGroup("Admin")) then 
        setPlayerTeam(source, team) 
    end 
end 
addEventHandler("onPlayerLogin",root, setTeam) 

Thanks alot mate!

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