Jump to content

playerblips - duvida


Recommended Posts

36 minutes ago, Talon_BR said:

é de rp ai queria por pros jogadores aparecer no F11 so pra staff 

 

Não testei, mas pode funcionar

local blip  = {}

addEventHandler('onResourceStart', resourceRoot,
function ()
local player = nil
     for i=1, #getElementsByType("player") do
	     player = getElementsByType("player")[i] 
		 local x,y,z = getElementPosition(player)
		 blip[player] = createBlipAttachedTo ( player, 0)
		 if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(player)), aclGetGroup ("Moderator")) or isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(player)), aclGetGroup ("SuperModerator"))
     	 or isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(player)), aclGetGroup ("Admin")) or isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(player)), aclGetGroup ("Console")) then
			 setElementVisibleTo (blip[player], player, true )
		 else
		     setElementVisibleTo (blip[player], player, false )
		 end
	 end
end)

addEventHandler('onPlayerQuit', root,
function ()
     if blip[source] then
	     destroyElement(blip[source])
	 end
end)

addEventHandler('onPlayerLogin', root,
function ()
     local x,y,z = getElementPosition(source)
	 blip[source] = createBlipAttachedTo (source, 0)
	 setElementVisibleTo (blip[source], root, false )
     if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)), aclGetGroup ("Moderator")) or isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)), aclGetGroup ("SuperModerator"))
     or isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)), aclGetGroup ("Admin")) or isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)), aclGetGroup ("Console")) then
		 local blips = nil
         for i=1, #getElementsByType("blip", resourceRoot) do
	         blips = getElementsByType("blip", resourceRoot)[i] 
			 setElementVisibleTo (blips, source, true )
		 end
	 end
end)

 

Edited by Mature
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...