Jump to content

Why this else not work?


Admigo

Recommended Posts

Heey all,

I made a code for scoreboard if player login in he sets to a team in scoreboard.

My clan Works(END) but vip dont work.

Code:

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 

No Errors.

Why its not working?

Thanks Admigo

Link to comment

Should have errors.. You got 2 ifs and 1 end instead of 2..

LUA has this 'elseif' feature which you can use.. so do this

  
    if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Admin" ) ) then 
                
                setPlayerTeam ( player, teamAdmin) 
        
             elseif isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "VIP!" ) ) then     
                 setPlayerTeam ( player,  teamVIP   )   
         else       
                 setPlayerTeam ( player,  teamPlayers   )   
        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...