Toffbrown Posted August 17, 2013 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!
denny199 Posted August 17, 2013 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)
Toffbrown Posted August 17, 2013 Author Posted August 17, 2013 when one person is in army and they reconnect just says "None"
Castillo Posted August 17, 2013 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 )
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