Jump to content

[help] Check If player is in Clan and Add back on login


Recommended Posts

function check(source)
       local recipient = getPlayerFromName(source)
       local accName = getAccountName ( getPlayerAccount ( recipient ) ) -- get his account name
       local r,g,b
       if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Forever" ) ) then
       setPlayerTeam ( recipient, FO )    
       r, g, b = getTeamColor ( FO )
       setPlayerNametagColor ( recipient, r, g, b )
    end
end
addEventHandler ( "onPlayerLogin", getRootElement(), check )

 

 

================================================================

i made a lil script to add clans but it seems that when u reconnect or login again , u are removed from player, the clan members are added into an ACL group marked Forever , i made this piece of code, to add player back into team if the player is in the acl group on login. but it doesnt work.

I am not really good at this but , i dont know how to get player from server side :( , can someone pls explain to me what is wrong in this piece of code and also tell me how to get player from server side :) 

thanks :) 

Link to comment
function check ()
       local r,g,b
       if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Forever")) then
       setPlayerTeam(source, getTeamFromName("FO"))    
       r, g, b = getTeamColor(getTeamFromName("FO"))
       setPlayerNametagColor(source, r, g, b)
    end
end
addEventHandler("onPlayerLogin", getRootElement(), check)

 

  • Like 1
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...