Jump to content

Why this else not work?


Admigo

Recommended Posts

Posted

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

Posted

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 

Posted
and i think you need timer
setTimer 

he doesn't need squat..

This is obviously not his full script and he already handles this IF, because he says it's working fine except for the else part which I believe I have fixed

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