Jump to content

How to get this to work?


Admigo

Recommended Posts

Heey all,

I made this:

addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart  ) --we attach the function to this resource's root element 
  
  function setteam(player) 
     local account = getPlayerAccount(player) 
      if not account or isGuestAccount(account) then 
      setPlayerTeam ( player,  teamPlayers   )   
       return end 
    local accName = getAccountName ( account) 
    if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Admin" ) ) then 
            
            setPlayerTeam ( player, teamAdmin) 
         
         else if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "VIP!" ) ) then 
            
            setPlayerTeam ( player, teamVIP) 
         else       
             setPlayerTeam ( player,  teamPlayers   )   
    end 
end 
  

But its not working,how can i get it to work?

Thanks Admigo

Link to comment
function setteam(player) 
     local account = getPlayerAccount(player) 
      if not account or isGuestAccount(account) then 
      setPlayerTeam ( player,  teamPlayers   )   
       return end 
    local accName = getAccountName ( account) 
    if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Admin" ) ) then 
            
            setPlayerTeam ( player, teamAdmin) 
         else if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "VIP!" ) ) then      
             setPlayerTeam ( player,  teamVIP   )   
     else       
             setPlayerTeam ( player,  teamPlayers   )   
    end 
end 
  

Error:end expected to close function at line 1429 near eof

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