Dazsh Posted June 16, 2015 Posted June 16, 2015 Hello, I want to make only admins visible on radar and map, what functions should I use?
Walid Posted June 16, 2015 Posted June 16, 2015 All what you need is isObjectInACLGroup() createBlipAttachedTo() -- Events onResourceStart onPlayerLogin Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
Blaawee Posted June 16, 2015 Posted June 16, 2015 local blips = { }; addEventHandler( 'onResourceStart', resourceRoot, function( ) for _, player in ipairs( getElementsByType ( 'player' ) ) do for _, aclGroup in ipairs ( { 'Admin', 'Moderator', 'SuperModerator', 'Console' } ) do if isObjectInACLGroup ( "user." ..getAccountName( getPlayerAccount( player ) ) , aclGetGroup ( aclGroup ) ) then if isElement ( blips[ player ] ) then destroyElement ( blips[ player ] ); end blips[ player ] = createBlipAttachedTo( player, 21, 1, 255, 255, 255, 150, nil, root ); end end end end ); addEventHandler( 'onPlayerLogin', root, function() for _, aclGroup in ipairs ( { 'Admin', 'Moderator', 'SuperModerator', 'Console' } ) do if isObjectInACLGroup ( "user." ..getAccountName( getPlayerAccount( source ) ) , aclGetGroup ( aclGroup ) ) then if isElement ( blips[ source ] ) then destroyElement ( blips[ source ] ); end blips[ source ] = createBlipAttachedTo( source, 21, 1, 255, 255, 255, 150, nil, root ); end end end ); addEventHandler ( 'onPlayerLogout', root, function( ) if isElement ( blips[ source ] ) then destroyElement ( blips[ source ] ); end blips[ source ] = nil; end ); addEventHandler ( 'onPlayerQuit', root, function( ) if isElement ( blips[ source ] ) then destroyElement ( blips[ source ] ); end blips[ source ] = nil 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