Jump to content

Error Panel ACL


Wananazo

Recommended Posts

This is my third post, the truth is that I like it because I am learning functions and I have a question with this script I still do not know how to handle the acl but I have a doubt with this since I remove the acl permission from a user and it still comes out the panel when as I understand it should not come out anymore

 


 
Grupo = { "Policial" } 

function isPlayerOnGroup2 ( thePlayer )
    local account = getPlayerAccount ( thePlayer )
    local inGroup = false
    for _, group in ipairs ( Grupo ) do
        if isObjectInACLGroup ( "user.".. getAccountName ( account ), aclGetGroup ( group ) ) then
            inGroup = true
            break
        end
    end
    return inGroup
end
 
 
function ClickJogdor ( Player )
  if isPlayerOnGroup2 ( source ) then
  	local account = getPlayerAccount (Player)
    if isGuestAccount (account) then msgFeniX(source, "Esse Jogador está deslogado !", "error") return end
   local cx, cy, cz = getElementPosition ( Player )
    local px, py, pz = getElementPosition ( source )
     local distance	= getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
     if ( distance <= 1.7 ) then
  -- if Player == source then return end
      triggerClientEvent (source , "FeniX_AbrirDX" , source)
	  setElementData(source, "FeniXMTA_Suspeito" , Player)
	 
	  end
    end
end
addEvent ( "FeniX_ClickJogdor", true )
addEventHandler ( "FeniX_ClickJogdor", root, ClickJogdor)  

--[[                               
                                   ################################################
                                   #                    Bindkey                   #                                                                
                                   ################################################
--]]

function onPlayerCommand(command)
    if getElementData(source,"FeniX_Preso") then
        cancelEvent()
    end
end
addEventHandler("onPlayerCommand",getRootElement(),onPlayerCommand)

--[[                               
                                   ################################################
                                   #                    Parte Multa               #                                                                
                                   ################################################
--]]

function setarMulta( Valor_Multa , Motivo_Multa )
    local Abordado = getElementData( source,"FeniXMTA_Suspeito")
    local cx, cy, cz = getElementPosition ( Abordado )
    local px, py, pz = getElementPosition ( source )
    local distance	= getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
    if ( distance >= 1.8 ) then
	msgFeniX(source, "Chegue Mais Perto Do Jogador vai efetuar esta função !", "error")
	elseif ( distance <= 1.7) then	
	takePlayerMoney(Abordado, tonumber(Valor_Multa))
	givePlayerMoney(source, tonumber(Valor_Multa))
	outputChatBox ( "#FF0000✘ #ffffffINFO #FF0000✘➺ #ffffffVocê foi Multado pelo PM: "..getPlayerName(source).." #ffffff, Motivo: #FF0000"..Motivo_Multa.." #ffffff, Valor: #FF0000"..Valor_Multa.." #ffffff!" , Abordado , 255,255,255, true)
	end
end
addEvent("FeniX_SetarMulta", true)
addEventHandler("FeniX_SetarMulta", root, setarMulta)

addEvent("FeniX_Aviso_2",true)
addEventHandler("FeniX_Aviso_2",root,
	function ()
	msgFeniX(source, "Informe o Valor da Multa !", "error")
	end
)

addEvent("FeniX_Aviso_1",true)
addEventHandler("FeniX_Aviso_1",root,
	function ()
	msgFeniX(source, "Informe o Motivo da Multa !", "error")
	end
)

--[[                               
                                   ################################################
                                   #                   Função CNH                 #                                                                
                                   ################################################
--]]

function cnHPlayer ()
 local Abordado = getElementData( source,"FeniXMTA_Suspeito")
    local cx, cy, cz = getElementPosition ( Abordado )
    local px, py, pz = getElementPosition ( source )
    local distance	= getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
    if ( distance >= 1.8 ) then
	msgFeniX(source, "Chegue Mais Perto Do Jogador vai efetuar esta função !", "error")
	elseif ( distance <= 1.7) then
  if getElementData(Abordado, "Habilitacoes:Motos") == true then
  outputChatBox("#FF0000✘ #ffffffINFO #FF0000✘➺ #ffffffCategoria Moto ( #00FF00✔ #ffffff)", source ,  255, 255, 255, true)
  else
  outputChatBox("#FF0000✘ #ffffffINFO #FF0000✘➺ #ffffffCategoria Moto ( #FF0000x #ffffff)", source ,  255, 255, 255, true)
  end
  
  if getElementData(Abordado, "Habilitacoes:Carros") == true then
  outputChatBox("#FF0000✘ #ffffffINFO #FF0000✘➺ #ffffffCategoria Carro ( #00FF00✔ #ffffff)", source ,  255, 255, 255, true)
  else
  outputChatBox("#FF0000✘ #ffffffINFO #FF0000✘➺ #ffffffCategoria Carro ( #FF0000x #ffffff)", source ,  255, 255, 255, true)
  end
  
  if getElementData(Abordado, "Habilitacoes:Caminhoes") == true then
  outputChatBox("#FF0000✘ #ffffffINFO #FF0000✘➺ #ffffffCategoria Caminhão ( #00FF00✔ #ffffff)", source ,  255, 255, 255, true)
  else
  outputChatBox("#FF0000✘ #ffffffINFO #FF0000✘➺ #ffffffCategoria Caminhão ( #FF0000x #ffffff)", source ,  255, 255, 255, true)
  end
  
  if getElementData(Abordado, "Habilitacoes:Onibus") == true then
  outputChatBox("#FF0000✘ #ffffffINFO #FF0000✘➺ #ffffffCategoria Ônibus ( #00FF00✔ #ffffff)", source ,  255, 255, 255, true)
  else
  outputChatBox("#FF0000✘ #ffffffINFO #FF0000✘➺ #ffffffCategoria Ônibus ( #FF0000x #ffffff)", source ,  255, 255, 255, true)
  end
  
  if getElementData(Abordado, "Habilitacoes:Carretas") == true then
  outputChatBox("#FF0000✘ #ffffffINFO #FF0000✘➺ #ffffffCategoria Carreta ( #00FF00✔ #ffffff)", source ,  255, 255, 255, true)
  else
  outputChatBox("#FF0000✘ #ffffffINFO #FF0000✘➺ #ffffffCategoria Carreta ( #FF0000x #ffffff)", source ,  255, 255, 255, true)
    end
  
  if getElementData(Abordado, "Habilitacoes:Barcos") == true then
  outputChatBox("#FF0000✘ #ffffffINFO #FF0000✘➺ #ffffffCategoria Barco ( #00FF00✔ #ffffff)", source ,  255, 255, 255, true)
  else
  outputChatBox("#FF0000✘ #ffffffINFO #FF0000✘➺ #ffffffCategoria Barco ( #FF0000x #ffffff)", source ,  255, 255, 255, true)
    end

  if getElementData(Abordado, "Habilitacoes:Helicopteros") == true then
  outputChatBox("#FF0000✘ #ffffffINFO #FF0000✘➺ #ffffffCategoria Helicóptero ( #00FF00✔ #ffffff)", source ,  255, 255, 255, true)
  else
  outputChatBox("#FF0000✘ #ffffffINFO #FF0000✘➺ #ffffffCategoria Helicóptero ( #FF0000x #ffffff)", source ,  255, 255, 255, true)
    end

  if getElementData(Abordado, "Habilitacoes:Avioes") == true then
  outputChatBox("#FF0000✘ #ffffffINFO #FF0000✘➺ #ffffffCategoria Avião ( #00FF00✔ #ffffff)", source ,  255, 255, 255, true)
  else
  outputChatBox("#FF0000✘ #ffffffINFO #FF0000✘➺ #ffffffCategoria Avião ( #FF0000x #ffffff)", source ,  255, 255, 255, true)
    end	
  end
end
addEvent ( "FeniX_CNH", true )
addEventHandler ( "FeniX_CNH", root, cnHPlayer) 

--[[                               
                                   ################################################
                                   #                    Identidade                #                                                                
                                   ################################################
--]]

cmd0 = "verificar"
cmd2 = "recusar"
cmd3 = "mostrar"

function BuscarIDVTR (source, cmd, pname)
  if isPlayerOnGroup2 ( source ) then
		local vehicle = getPedOccupiedVehicle (source)
		local cliente = getPlayerFromPartialName(pname)
		if isElement(cliente) then
	if cliente == source then msgFeniX(source, "Você não Pode Verificar sua Propria Ficha!", "error") return end
		if getElementData ( cliente, "FeniX:Buscar" ) == "Sim" then
			if isElement(vehicle) then
        		if (getElementType(vehicle) == "vehicle" ) then			
					if (getVehicleType(vehicle) == "Automobile") or (getVehicleType(vehicle) == "Bike") then
				  		local id = getElementModel ( vehicle )
                  		if id == 433 or id == 579 or id == 427 or id == 490 or id == 528 or id == 523 or id == 470 or id == 596 or id == 598 or id == 599 or id == 597 or id == 432 or id == 601 then
						local Nome = getElementData ( cliente, "FeniX_RG_Nome" ) or "N/C"
                        setElementData ( source, "PM_FeniX_RG_Nome", Nome )
						local data = getElementData ( cliente, "FeniX_RG_DataNascimento" ) or "N/C"
                        setElementData ( source, "PM_FeniX_RG_DataNascimento", data )
						local sexo = getElementData ( cliente, "FeniX_RG_Sexo" ) or "N/C"
                        setElementData ( source, "PM_FeniX_RG_Sexo", sexo )
						local localOrigem = getElementData ( cliente, "FeniX_RG_LocalOrigem" ) or "N/C"
                        setElementData ( source, "PM_FeniX_RG_LocalOrigem", localOrigem )
						local Porte = getElementData ( cliente, "TS:PorteDeArmas" )
                        setElementData ( source, "PM_FeniX_RG_Porte", Porte )
						local money = getPlayerMoney(cliente)
						setElementData ( source, "PM_FeniX_RG_Money", money )
						setElementData ( source, "FeniX_SolicitarFicha", "Sim" )
						end
         			end
      			end
   			else
	  		   msgFeniX(source, "Entre Dentro da Viatura para Poder Utilizar esse Comando!", "error")
   		    end
		else
		    msgFeniX(source, "Você não pode puxar uma Ficha sem a Identidade do Jogador!", "error")
		end
	end
end
end
addCommandHandler ( cmd0, BuscarIDVTR )
 
canceltimer={}
function fix() 
    local Abordado = getElementData( source,"FeniXMTA_Suspeito")
	   if isPlayerOnGroup2 ( source ) then
			local policial = getElementData(Abordado,"cliente:policial")
			    if isElement(policial) then 
				msgFeniX(source, "O Jogador "..getPlayerName(Abordado).." #ffffffJa Esta Sendo Atendido Por um Policial!", "error") 
				else
					setElementData(Abordado,"cliente:policial",source)
					msgFeniX(source, "Você Solicitou a Identidade do Jogador "..getPlayerName(Abordado), "warning")
					msgFeniX(Abordado, "O Policial "..getPlayerName(source).." #ffffffPediu sua Identidade, Digite /Mostrar ou /Recusar.", "warning")
					canceltimer[Abordado] = setTimer(cancelfix,15000,1,Abordado)
					end
			end
end
addEvent ( "FeniX_Identidade", true )
addEventHandler ( "FeniX_Identidade", root, fix) 

function recusar(source)
	local policial = getElementData(source,"cliente:policial")
	if isElement(policial) then
	    msgFeniX(policial, "O Jogador "..getPlayerName(source).." #ffffffSe Recusou a Mostrar a Identidade, +1 Nivel de Procurado!", "error")
		msgFeniX(source, "Você se Recusou a Entregar a Identidade, e Agora esta Procurado!", "warning")
		Procurado = getPlayerWantedLevel ( source )
		setPlayerWantedLevel ( source, Procurado+1 )
	end
	setElementData(source,"cliente:policial",nil)	
	if isTimer(canceltimer[source]) then
		killTimer(canceltimer[source])
	end
end
addCommandHandler(cmd2,recusar)

function aceitar(source)
	local policial = getElementData(source,"cliente:policial")
	if isElement(policial) then
		msgFeniX(policial, "O Jogador "..getPlayerName(source).." #ffffffLhe mostrou a Identidade, Verifique Dentro da Viatura /Verificar Nick. (Você tem 60 Segundos)", "success")
		msgFeniX(source, "Você mostrou sua identidade ao Policial "..getPlayerName(policial).." #ffffff( ele tem tem 60 Segundos pra verificar na viatura!)", "success")
		local cx,cy,cz = getElementPosition(policial)
		local x,y,z = getElementPosition(source)
		local dist = getDistanceBetweenPoints3D(x,y,z,cx,cy,cz)
		if dist <= 7 then	
			setElementData ( source, "FeniX:Buscar", "Sim" )
			setTimer ( function() setElementData ( source, "FeniX:Buscar", "Não" ) end, 60000, 1 )
		else
		    msgFeniX(source, "O Policial Esta Muito Longe!", "error")
			msgFeniX(policial, "Você Esta Muito Longe do Jogador Abordado!", "error")
		end
	end
	setElementData(source,"cliente:policial",nil)	
	if isTimer(canceltimer[source]) then
		killTimer(canceltimer[source])
	end
end
addCommandHandler(cmd3,aceitar)

function cancelfix(source)
	local policial = getElementData(source,"cliente:policial")
	if isElement(policial) then
		msgFeniX(policial, "O Jogador "..getPlayerName(source).." #ffffffDemorou Para Mostrar ou Recusar a Identidade, +1 Nivel de Procurado!", "error")
	end
	msgFeniX(source, "Você Demorou Demais Para Mostrar ou Recusar o Reparo e Agora esta Procurado!", "error")
	setElementData(source,"cliente:policial",nil)	
	Procurado = getPlayerWantedLevel ( source )
	setPlayerWantedLevel ( source, Procurado+1 )
end

function getPlayerFromPartialName(name)
    local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil
    if name then
        for _, player in ipairs(getElementsByType("player")) do
            local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower()
            if name_:find(name, 1, true) then
                return player
            end
        end
    end
end

--[[                               
                                   ################################################
                                   #                      Prender                 #                                                                
                                   ################################################
--]]

viatura = {}
function salvacarro (vei, assento, vitima)
	viatura[source] = vei
end
addEventHandler ('onPlayerVehicleEnter', root, salvacarro)

function prender ()
 local Abordado = getElementData( source,"FeniXMTA_Suspeito")
   local cx, cy, cz = getElementPosition ( Abordado )
   local px, py, pz = getElementPosition ( source )
  local distance    = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
  if ( distance >= 1.8 ) then
  msgFeniX(source, "Chegue Mais Perto Do Jogador vai efetuar esta função !", "error")
  elseif ( distance <= 1.7) then
    local vtr = viatura[source]
       if viatura[source]  then
  attachElements (Abordado, vtr, 0.2, -1.5, 0, 0,0,90)
  vrx, vry, vrz = getElementRotation(vtr)
 setElementRotation(Abordado, vrx, vry, vrz+83)
  setElementData(Abordado,"algemado",nil)
    setPedAnimation(Abordado)
    setElementFrozen(Abordado,false)
    triggerClientEvent("algemaRemove", Abordado)
    setElementData ( Abordado, "Algemar_Desalgemar", false )
    setPedAnimation(Abordado, "ped", "CAR_dead_LHS", false, false)
    setElementData ( source, "Algemar_Desalgemar", false )
	setElementData ( Abordado, "FeniX_Preso", true )
	setElementData ( Abordado, "FeniXMTA_Preso", true )
      else
  msgFeniX(source, "Entre no carro e saia para executar esta função !", "error")
 end
  end
end
addEvent ( "FeniX_Prender", true )
addEventHandler ( "FeniX_Prender", root, prender)


--[[                               
                                   ################################################
                                   #                     Revistar                 #                                                                
                                   ################################################
--]]

function verEstrelas ()
local Abordado = getElementData( source,"FeniXMTA_Suspeito")
   local cx, cy, cz = getElementPosition ( Abordado )
   local px, py, pz = getElementPosition ( source )
  local distance	= getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
  if ( distance >= 1.8 ) then
  msgFeniX(source, "Chegue Mais Perto Do Jogador vai efetuar esta função !", "error")
  elseif ( distance <= 1.7) then
  local estrelas_player   =   getPlayerWantedLevel ( Abordado )
  if estrelas_player > 0 then
  outputChatBox("#FF0000✘ #ffffffINFO #FF0000✘➺ #ffffffEstrela(s): #00ff00"..estrelas_player.."!", source, 255, 255, 255, true)
  else
  end
  outputChatBox("#FF0000✘ #ffffffINFO #FF0000✘➺ #ffffffSem nível de #FF0000procurado!", source, 255, 255, 255, true)
		end
end	
addEvent ( "FeniX_Revistar", true )
addEventHandler ( "FeniX_Revistar", root, verEstrelas)

function verArmas ()
 local Abordado = getElementData( source,"FeniXMTA_Suspeito")
   local cx, cy, cz = getElementPosition ( Abordado )
   local px, py, pz = getElementPosition ( source )
  local distance	= getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
  if ( distance >= 1.8 ) then
  msgFeniX(source, "Chegue Mais Perto Do Jogador vai efetuar esta função !", "error")
  elseif ( distance <= 1.7) then
  for slot = 0, 12 do
  local Armas = getPedWeapon ( Abordado, slot )
  local Municao = getPedTotalAmmo ( Abordado, slot ) 
  if Armas > 0 then 
  if Municao > 0 then
  setPedAnimation( source, "POLICE", "plc_drgbst_01", 3100, true, false, false, false)
  weapon_nome = getWeaponNameFromID ( Armas )
  outputChatBox ("#FF0000✘ #ffffffINFO #FF0000✘➺ #ffffff"..weapon_nome.." com "..Municao.." Bala(s) !", source, 255, 255, 255, true )
  end
  else
  setPedAnimation( source, "POLICE", "plc_drgbst_01", 3100, true, false, false, false)
  end
	end
   end
end
addEvent ( "FeniX_Revistar", true )
addEventHandler ( "FeniX_Revistar", root, verArmas)

--[[                               
                                   ################################################
                                   #                 Algemar/Desalgemar           #                                                                
                                   ################################################
--]]

function algemarDesalgemar ()
 local Abordado = getElementData( source,"FeniXMTA_Suspeito")
   local cx, cy, cz = getElementPosition ( Abordado )
   local px, py, pz = getElementPosition ( source )
  local distance	= getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
   local dataAlgemado = getElementData(Abordado, "algemado")
  if ( distance >= 1.8 ) then
  msgFeniX(source, "Chegue Mais Perto Do Jogador vai efetuar esta função !", "error")
  elseif ( distance <= 1.7) then
  	setElementData(Abordado,"algemado",true)
	triggerClientEvent("algemaAdd", Abordado)
	setElementFrozen(Abordado, true)
	setPedAnimation(Abordado, "GANG", "prtial_gngtlkA", false, false)
	if (not dataAlgemado) then
	setElementData ( source, "Algemar_Desalgemar", true )
	else
	setElementData(Abordado,"algemado",nil)
	setPedAnimation(Abordado)
	setElementFrozen(Abordado,false)
	triggerClientEvent("algemaRemove", Abordado)
	setElementData ( source, "Algemar_Desalgemar", false )
	end
   end
end
addEvent ( "FeniX_AlgemarDesalgemar", true )
addEventHandler ( "FeniX_AlgemarDesalgemar", root, algemarDesalgemar)

function algemadoQuit()
	triggerClientEvent("algemaRemove", source)
	setElementData ( source, "Algemar_Desalgemar", false )
end
addEventHandler("onPlayerQuit", root, algemadoQuit)

--[[                               
                                   ################################################
                                   #                  Apreender Armas             #                                                                
                                   ################################################
--]]

function apreenderArmas ()
 local Abordado = getElementData( source,"FeniXMTA_Suspeito")
    local cx, cy, cz = getElementPosition ( Abordado )
   local px, py, pz = getElementPosition ( source )
  local distance	= getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
  if ( distance >= 1.8 ) then
  msgFeniX(source, "Chegue Mais Perto Do Jogador vai efetuar esta função !", "error")
  elseif ( distance <= 1.7) then 
    for slot = 0, 12 do  
  local Armas = getPedWeapon ( Abordado , slot )
    if Armas > 0 then 
  takeAllWeapons ( Abordado )
  outputChatBox ("#FF0000✘ #ffffffINFO #FF0000✘➺ #ffffffTodas as Armas do Jogador "..getPlayerName(Abordado).." #FFFFFFfoi recolhida !", source, 255, 255, 255, true )
    end
  end
   end
end
addEvent ( "FeniX_ApreenderArmas", true )
addEventHandler ( "FeniX_ApreenderArmas", root, apreenderArmas)

--[[                               
                                   ################################################
                                   #                     DxMensagem               #                                                                
                                   ################################################
--]]

function msgFeniX(source, text, type)
	exports.dxmessages:outputDx(source, text, type)
end

 

Edited by Wananazo
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...