Jump to content

Ajuda - ACL para Script


Recommended Posts

Pessoal um amigo meu criou um script de policial e agora eu queria deixar esse script só para o Grupo de ACL 'PoliciaComandos' alguém me pode dizer como posso faze-lo?

(Já criei esse grupo de ACL)

Edited by Renazz
Link to comment
addCommandHandler ("comando", function (thePlayer, cmd)
	if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount (thePlayer)), aclGetGroup ("PoliciaComandos")) then -- Se o jogador estiver na acl 'PoliciaComandos', então:
			-- Seu código --
	else -- Senão:
		outputChatBox ("Você não é um policial.", thePlayer, 250, 50, 50) -- Informa que o jogador não é um policial.
	end
end)

 

Edited by Jonas^
  • Thanks 1
Link to comment

No caso ficaria assim :

function desalgemarComando(player, commandName, playerid)
	if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount (thePlayer)), aclGetGroup ("PoliciaComandos")) then ---- ACL

	if not (playerid) then return end
	
	local alvo = exports["[PRS]ID_System"]:getPlayerID(tonumber(playerid)) -- aqui eu deixei pra buscar por nome, pois to sem sistema de id, no caso coloque aqui a função de buscar jogador por id se tiver
	if not (alvo) then
		return player:outputChat("[AVISO] jogador ID ' "..tostring(playerid).." ' não encontrado!.", 100, 100, 255, true)
	end
	
	local algemado = alvo:getData("Algemado")
	if not (algemado) then
		return player:outputChat("[AVISO] jogador ID ' "..tostring(playerid).." ' não está algemado", 100, 100, 255, true)
	end
	
	deixarAlgemado(alvo, nil)
	alvo:setData("Algemado", nil)
	setPedAnimation(alvo)
	player:outputChat("[AVISO] Você desalgemou o jogador ID ' "..tostring(playerid).." '!.", 100, 100, 255, true)
	alvo:outputChat("[AVISO] Policial ' "..player.name.." ' desalgemou você!.", 100, 100, 255, true)
end
addCommandHandler("desalgemar", desalgemarComando)

function prenderComando(player, commandName, playerid)
	
end

 

Link to comment
  • Other Languages Moderators

Não.

Troque thePlayer por player, pois é o parâmetro de função que vc está usando.

function desalgemarComando(player, commandName, playerid)
	if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount (player)), aclGetGroup ("PoliciaComandos")) then -- ACL
		if not (playerid) then return end
		local alvo = exports["[PRS]ID_System"]:getPlayerID(tonumber(playerid)) -- aqui eu deixei pra buscar por nome, pois to sem sistema de id, no caso coloque aqui a função de buscar jogador por id se tiver
		if not (alvo) then
			return player:outputChat("[AVISO] jogador ID ' "..tostring(playerid).." ' não encontrado!.", 100, 100, 255, true)
		end
		local algemado = alvo:getData("Algemado")
		if not (algemado) then
			return player:outputChat("[AVISO] jogador ID ' "..tostring(playerid).." ' não está algemado", 100, 100, 255, true)
		end
		deixarAlgemado(alvo, nil)
		alvo:setData("Algemado", nil)
		setPedAnimation(alvo)
		player:outputChat("[AVISO] Você desalgemou o jogador ID ' "..tostring(playerid).." '!.", 100, 100, 255, true)
		alvo:outputChat("[AVISO] Policial ' "..player.name.." ' desalgemou você!.", 100, 100, 255, true)
	end
end
addCommandHandler("desalgemar", desalgemarComando)

 

  • Thanks 1
Link to comment
  • Moderators

Irei remover o código. Mas tenha em mente que o código postado deve permanecer no tópico a menos que tenha um motivo para a remoção.

Faça o que o Lord Henry disse da próxima vez que for postar um código que não queira compartilhar publicamente ?.

Edited by DNL291
Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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