Jump to content

Move on team if team is nil.


Bzz335

Recommended Posts

Hello,need help.

  
 addEventHandler("onPlayerLogin",getRootElement(), 
 function(player) 
 local tp = getPlayerTeam(source) 
 accountName = getAccountName(getPlayerAccount(source)) 
 if tp~=nil and ( isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "Admin" ) )) then 
 setPlayerTeam(source,staff) 
 setPlayerSkin(source,217) 
outputChatBox("Welcome to the Staff team!",source,153,255,153) 
outputDebugString ( "Staff: " .. getPlayerName(source) .. " joined the Staff Team.",3,255,215,153) 
 end 
 end 
 ) 

So,if tp(team) is nil(He isnt in team) and player in ACL group "Admin" then...

Please,help.

Link to comment
addEventHandler ( "onPlayerLogin",getRootElement(), 
    function ( _, account ) 
        local tp = getPlayerTeam ( source ) 
        local accountName = getAccountName ( account ) 
        if ( not tp and isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) ) then 
            setPlayerTeam ( source, staff ) 
            setElementModel ( source, 217 ) 
            outputChatBox ( "Welcome to the Staff team!", source, 153, 255, 153 ) 
            outputDebugString ( "Staff: ".. getPlayerName ( source ) .." joined the Staff Team.", 3, 255, 215, 153 ) 
        end 
    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...