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! I DON'T HAVE HATERS, I JUST HAVE FANS IN DENIAL
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) Sometimes I dream about cheese
Toffbrown Posted August 17, 2013 Author Posted August 17, 2013 when one person is in army and they reconnect just says "None" I DON'T HAVE HATERS, I JUST HAVE FANS IN DENIAL
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 ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
denny199 Posted August 17, 2013 Posted August 17, 2013 Ah sh*t, I forgot to add that:P Sometimes I dream about cheese
Toffbrown Posted August 18, 2013 Author Posted August 18, 2013 Thanks so much works like a charm! I DON'T HAVE HATERS, I JUST HAVE FANS IN DENIAL
Castillo Posted August 18, 2013 Posted August 18, 2013 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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