Jump to content

Ajuda num script


Recommended Posts

Eu preciso de uma ajuda, eu queria saber, como eu posso verificar nestá função abaixo, se o player está na Acl de " Staff ". Ao invés de " account:staff "

OBS: ( Está na parte do cliente. )

 

button = function()
	if visible == false then
		visible = true 
		addEventHandler("onClientRender",root,render)
		for i ,v in ipairs(getElementsByType("player")) do
			local name = getPlayerName(v)
			local staff = v:getData("account:staff")
			local avatar = v:getData("account:avatar") or 0
			local ID = v:getData("ID") or 'N/A'
			if staff then 
				table.insert(players,{name = name, staff = staff , ID = ID , avatars = avatar})
			end
		end
		for i ,v in ipairs(getElementsByType("player")) do
			local name = getPlayerName(v)
			local staff = v:getData("account:staff")
			local ID = v:getData("ID") or 'N/A'
			local avatar = v:getData("account:avatar") or 0
			if not staff then 
				table.insert(players,{name = name, staff = staff , ID = ID , avatars = avatar})
			end
		end
	else 
		visible = false
		removeEventHandler("onClientRender",root,render)
		players = {}
	end
end
bindKey ("TAB","both",button)

 

Edited by Bullyn
Link to comment
-- Seu Client

manager = function()
	if visible == false then
		visible = true 
		addEventHandler("onClientRender",root,render)
		for i ,v in ipairs(getElementsByType("player")) do
			local name = getPlayerName(v)
			local staff = v:getData("account:staff")
			local avatar = v:getData("account:avatar") or 0
			local ID = v:getData("ID") or 'N/A'
			if staff then 
				table.insert(players,{name = name, staff = staff , ID = ID , avatars = avatar})
			end
		end
		for i ,v in ipairs(getElementsByType("player")) do
			local name = getPlayerName(v)
			local staff = v:getData("account:staff")
			local ID = v:getData("ID") or 'N/A'
			local avatar = v:getData("account:avatar") or 0
			if not staff then 
				table.insert(players,{name = name, staff = staff , ID = ID , avatars = avatar})
			end
		end
	else 
		visible = false
		removeEventHandler("onClientRender",root,render)
		players = {}
	end
end
addEvent("PassarPainel", true)
addEventHandler("PassarPainel", getRootElement(), manager)

bindKey("tab", "both", 
	function ()
		triggerServerEvent(localPlayer, "PassarPainel2", localPlayer)
  	end
)

-- Seu Server

addEvent("PassarPainel2", true)
addEventHandler("PassarPainel2", getRootElement(), 
	function (player)
		if ( isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("ACLQUEVOCEQUER")) ) then
			triggerClientEvent(player, "PassarPainel", player)
      	end
	end
)

Tente assim caso não de, me avise, fiz sem testar no mta

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...