Toffbrown Posted August 17, 2013 Share Posted August 17, 2013 is it possible to show a players acl group in the scoreboard say like if the player was in Army it would say army in the tab scoreboard? if so what functions to use? cheers! Link to comment
denny199 Posted August 17, 2013 Share Posted August 17, 2013 Yes, here it is: addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function() call(getResourceFromName("scoreboard"),"addScoreboardColumn","ACL") end ) addEventHandler ( "onPlayerJoin", root, function() setElementData(source,"ACL","None") end) addEventHandler ( "onPlayerLogin", root, function( _, acc) if isObjectInACLGroup ( "user." ..acc, aclGetGroup ( "Army" ) ) then setElementData(source,"ACL","Army") elseif isObjectInACLGroup ( "user." ..acc, aclGetGroup ( "Admin" ) ) then setElementData(source,"ACL","Admin") end end) Link to comment
Toffbrown Posted August 17, 2013 Author Share Posted August 17, 2013 when one person is in army and they reconnect just says "None" Link to comment
Castillo Posted August 17, 2013 Share Posted August 17, 2013 Yes, here it is: addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function() call(getResourceFromName("scoreboard"),"addScoreboardColumn","ACL") end ) addEventHandler ( "onPlayerJoin", root, function() setElementData(source,"ACL","None") end) addEventHandler ( "onPlayerLogin", root, function( _, acc) if isObjectInACLGroup ( "user." ..acc, aclGetGroup ( "Army" ) ) then setElementData(source,"ACL","Army") elseif isObjectInACLGroup ( "user." ..acc, aclGetGroup ( "Admin" ) ) then setElementData(source,"ACL","Admin") end end) "acc" is an account element there, so it'll always return false. This should work: addEventHandler ( "onResourceStart", resourceRoot, function ( ) call ( getResourceFromName ( "scoreboard" ), "addScoreboardColumn", "ACL" ) end ) addEventHandler ( "onPlayerJoin", root, function ( ) setElementData ( source, "ACL", "None" ) end ) addEventHandler ( "onPlayerLogin", root, function ( _, acc ) local accountName = getAccountName ( acc ) if isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Army" ) ) then setElementData ( source, "ACL", "Army" ) elseif isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) then setElementData ( source, "ACL", "Admin" ) end end ) Link to comment
denny199 Posted August 17, 2013 Share Posted August 17, 2013 Ah sh*t, I forgot to add that:P Link to comment
Toffbrown Posted August 18, 2013 Author Share Posted August 18, 2013 Thanks so much works like a charm! 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