Spyke25 Posted October 14, 2011 Share Posted October 14, 2011 Hi guys, my server had this function : Join the server > Login as admin > Join the team > Quit the game > Join the game > Login as admin > Will join the team automatically. But now, i haven't that anymore, i dont know why, someone know how to enable this function again ? Thanks. Link to comment
Spyke25 Posted October 14, 2011 Author Share Posted October 14, 2011 I don't have that, i just had this function, but i don't know how i got it. So, i asked if someone can say me how to enable it ( by an resource, script, command .. ? ) Link to comment
Cadu12 Posted October 14, 2011 Share Posted October 14, 2011 https://wiki.multitheftauto.com/wiki/Scr ... troduction Link to comment
Spyke25 Posted October 14, 2011 Author Share Posted October 14, 2011 LOL, i asked here cause i'm not so good with lua, expecially with this kind of script ( i think hard to make ) Link to comment
BriGhtx3 Posted October 14, 2011 Share Posted October 14, 2011 function joinHandler() setPlayerTeam (source, YOURTEAM) end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) Link to comment
Spyke25 Posted October 14, 2011 Author Share Posted October 14, 2011 I will try that, thanks. Link to comment
BriGhtx3 Posted October 14, 2011 Share Posted October 14, 2011 I think it should work Link to comment
Slayer Posted October 15, 2011 Share Posted October 15, 2011 -- Create a team when the resource starts local adminTeam = createTeam("Admin", 255, 0, 0) function setTeamOnLogin() -- Get the account name of the player who logged in local account = getAccountName(getPlayerAccount(source)) -- Check if the player who logged in is an admin if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then -- If they are, set their team to admin setPlayerTeam(source, adminTeam) else -- If they aren't admin then end(or implement what you would like to happen if they aren't an admin. ) end end addEventHandler("onPlayerLogin", getRootElement(), setTeamOnLogin) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now