#Paper Posted October 8, 2010 Posted October 8, 2010 How to make the freeroam gui usable only for admins?
Timic Posted October 8, 2010 Posted October 8, 2010 Just do like this: (its from admin system) _aclrights = {} function hasPermissionTo ( object ) if ( _aclrights[object] ) then return true end return false end addEvent ( "aPermissions", true ) addEventHandler ( "aPermissions", getLocalPlayer(), function ( table ) for id, right in ipairs ( table ) do _aclrights[right] = true if ( aAdminForm ) then guiSetEnabled ( _guiprotected[right], true ) end end end ) addEventHandler ( "onAdminInitialize", _root, function() if ( #_guiprotected == 0 ) then triggerServerEvent ( "aPermissions", getLocalPlayer() ) end end ) If im right run on client-side!
#Paper Posted October 9, 2010 Author Posted October 9, 2010 Just do like this: (its from admin system) _aclrights = {} function hasPermissionTo ( object ) if ( _aclrights[object] ) then return true end return false end addEvent ( "aPermissions", true ) addEventHandler ( "aPermissions", getLocalPlayer(), function ( table ) for id, right in ipairs ( table ) do _aclrights[right] = true if ( aAdminForm ) then guiSetEnabled ( _guiprotected[right], true ) end end end ) addEventHandler ( "onAdminInitialize", _root, function() if ( #_guiprotected == 0 ) then triggerServerEvent ( "aPermissions", getLocalPlayer() ) end end ) If im right run on client-side! in what script i should add thi part? If i add this code the freeroam gui be usable only for admins?
dzek (varez) Posted October 9, 2010 Posted October 9, 2010 this is general advice i think (and not complete) - you still need to understand lua to make this like you want
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