Jump to content

Preciso de ajuda nesse script pfv !


Recommended Posts

Preciso de ajuda nesse scritp, deixando bem claro que nao entendo a linguagem, mas não tenho condições de pagar alguem pra fazer isso..
Por isso que pesso ajuda de vocês humildemente...

È um script policial de revistar, ta tudo funcionando perfeitamente, mas unico problema que eu estou tendo, é que quando eu revisto alguem, não aparece a arma que a pessoa esta portando entende? vou deixar aqui o Serve.lua



 

------------ Variaveis

Comando = "policial"
ACL = "Policial"

-------------------------------- Funções Iniciais
function AbrirPainel(source, comando, id)
if(id) then
local playerID = tonumber(id)
if(playerID) then
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup(ACL)) then
if getElementData(source, "TS:Abordando") then return end
local Jogador = getPlayerID(playerID)
if not Jogador then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffNão foi possivel encontrar o jogador !", "info") return end
--if Jogador == source then return end
local cx, cy, cz = getElementPosition ( Jogador )
local px, py, pz = getElementPosition ( source )
local distancia    = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end
triggerClientEvent(source, "TS:AbrirPolicial", source)
setElementData(source, "TS:Abordando", Jogador)
toggleAllControls ( source, false )
end
end
end
end
addCommandHandler(Comando, AbrirPainel)

function FecharPolicial (source)
toggleAllControls (source, true )
end
addEvent("TS:FecharPolicial", true)
addEventHandler("TS:FecharPolicial", root, FecharPolicial)

function Algemar (source)
local Jogador = getElementData(source, "TS:Abordando")
if Jogador then
if getElementData(Jogador, "TS:Algemado") == false then
local cx, cy, cz = getElementPosition ( Jogador )
local px, py, pz = getElementPosition ( source )
local distancia    = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end
toggleAllControls (Jogador, false )
setElementData(Jogador, "TS:Algemado", true)
setElementFrozen(Jogador, true)
triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffVocê foi algemado!", "info")
setPedAnimation( Jogador, "GRAVEYARD", "mrnM_loop", -1, true, false, false, false)
else
local cx, cy, cz = getElementPosition ( Jogador )
local px, py, pz = getElementPosition ( source )
local distancia    = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end
setPedAnimation(Jogador, nil)
toggleAllControls (Jogador, true )
setElementData(Jogador, "TS:Algemado", false)
setElementFrozen(Jogador, false)
triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffVocê foi desalgemado!", "info")
end
end
end
addEvent("TS:Algemar", true)
addEventHandler("TS:Algemar", root, Algemar)

function Revistar (source)
local Jogador = getElementData(source, "TS:Abordando")
if Jogador then
setPedAnimation( source, "POLICE", "plc_drgbst_01", 3100, true, false, false, false)
triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO Policial está te revistando!", "info")
if getPlayerWantedLevel(Jogador) >= 1 then
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador está pedido!",source,255,0,0,true)
else
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não está pedido!",source,255,0,0,true)
end
if getElementData(Jogador,"Habilitacoes:Carros") == true then
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Tem Habilitação para Carros!",source,255,0,0,true)
else
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Não tem Habilitação de Carros",source,255,0,0,true)
end
if getElementData(Jogador,"Habilitacoes:Motos") == true then
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Tem Habilitação para Motos!",source,255,0,0,true)
else
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Não tem Habilitação de Motos!",source,255,0,0,true)
end
if getElementData(Jogador,"Habilitacoes:Caminhoes") == true then
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Tem Habilitação para Caminhões!",source,255,0,0,true)
else
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Não tem Habilitação de Caminhão!",source,255,0,0,true)
end
if getElementData(Jogador,"Habilitacoes:Carretas") == true then
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Tem Habilitação para Carretas!",source,255,0,0,true)
else
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Não tem Habilitação de Carretas!",source,255,0,0,true)
end
if getElementData(Jogador,"Habilitacoes:Helicopteros") == true then
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Tem Habilitação para Helicopteros!",source,255,0,0,true)
else
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Não tem Habilitação de Helicopteros!",source,255,0,0,true)
end
local Quantidade = getElementData(source, "TS:"..Droga_Selecionada.."") or 0
for slot = 0, 12 do
local Armas = getPedWeapon (Jogador, slot)
local Municao = getPedTotalAmmo (Jogador, slot)  
if Armas > 0 then
if Municao > 0 then
weapon_nome = getWeaponNameFromID (Armas)
outputChatBox ("* "..weapon_nome.." #3a3a3a»#25e014 "..Municao.." Bala(s)!", source,255,255,255,true)
end
end
end
end
end
addEvent("TS:Revistar", true)
addEventHandler("TS:Revistar", root, Revistar)

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

function ColocarNaViatura (source)
local Jogador = getElementData(source, "TS:Abordando")
if Jogador then
local cx, cy, cz = getElementPosition ( Jogador )
local px, py, pz = getElementPosition ( source )
local distancia    = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end
local viatura = VeiculoPolicial[source]
if VeiculoPolicial[source] then
triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial te colocou na viatura !", "info")
attachElements (Jogador, viatura, 0.2, -1.5, 0, 0,0,90)
setPedAnimation(Jogador, "ped", "CAR_dead_LHS", false, false)
local RotVX, RotVY, RotVZ = getElementRotation(viatura)
setElementRotation(Jogador, RotVX, RotVY, RotVZ + 65)
end
end
end
addEvent ( "TS:ColocarNaViatura", true )
addEventHandler ( "TS:ColocarNaViatura", root, ColocarNaViatura)

function RemoverNaViatura (source)
local Jogador = getElementData( source,"TS:Abordando")
if Jogador then
local cx, cy, cz = getElementPosition ( Jogador )
local px, py, pz = getElementPosition ( source )
local distancia    = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end
local viatura = VeiculoPolicial[source]
if VeiculoPolicial[source] then
triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial te removeu da viatura !", "info")
detachElements (Jogador, viatura)
setPedAnimation(Jogador,nil)
local PosX, PosY, PosZ = getElementPosition(Jogador)
setElementPosition(Jogador, PosX, PosY, PosZ + 2)
end
end
end
addEvent ( "TS:RemoverNaViatura", true )
addEventHandler ( "TS:RemoverNaViatura", root, RemoverNaViatura)

function ApreenderArmas (source)
local Jogador = getElementData( source,"TS:Abordando")
if Jogador then
local cx, cy, cz = getElementPosition ( Jogador )
local px, py, pz = getElementPosition ( source )
local distancia    = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end
triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial removeu todas as suas armas!", "info")
takeAllWeapons(Jogador)
end
end
addEvent ( "TS:ApreenderArmas", true )
addEventHandler ( "TS:ApreenderArmas", root, ApreenderArmas)

function ApreenderPorte (source)
local Jogador = getElementData( source,"TS:Abordando")
if Jogador then
local cx, cy, cz = getElementPosition ( Jogador )
local px, py, pz = getElementPosition ( source )
local distancia    = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end
if getElementData(Jogador, "TS:PorteDeArmas") == "Sim" then
triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial revogou seu porte de armas!", "info") 
setElementData(Jogador, "TS:PorteDeArmas", nil)
end
end
end
addEvent ( "TS:ApreenderPorte", true )
addEventHandler ( "TS:ApreenderPorte", root, ApreenderPorte)


function ApreenderDrogas (source)
local Jogador = getElementData( source,"TS:Abordando")
if Jogador then
local cx, cy, cz = getElementPosition ( Jogador )
local px, py, pz = getElementPosition ( source )
local distancia    = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end
triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial apreendeu suas drogas!", "info") 
setElementData(Jogador, "TS:Maconha", 0)
setElementData(Jogador, "TS:Cocaina", 0)
setElementData(Jogador, "TS:Heroina", 0)
setElementData(Jogador, "TS:Crack", 0)
setElementData(Jogador, "TS:LSD", 0)
end
end
addEvent ( "TS:ApreenderDrogas", true )
addEventHandler ( "TS:ApreenderDrogas", root, ApreenderDrogas)

function AlterarFicha (source, Quantidade)
local Jogador = getElementData( source, "TS:Abordando")
if Jogador then
local cx, cy, cz = getElementPosition ( Jogador )
local px, py, pz = getElementPosition ( source )
local distancia    = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end
setPlayerWantedLevel(Jogador, Quantidade)
triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial alterou a sua ficha criminal!", "info") 
end
end
addEvent ( "TS:AlterarFicha", true )
addEventHandler ( "TS:AlterarFicha", root, AlterarFicha)

--------------------- Não Meche

function getPlayerID(id)
    v = false
    for i, player in ipairs (getElementsByType("player")) do
        if getElementData(player, "ID") == id then
            v = player
            break
        end
    end
    return v
end

 

Por favor, ficarei muito agradecido, sou novo aqui na comunidade, se eu tiver postando em lugar errado, pode remover sem problema, desculpem qualquer coisa !

Link to post

Uma Dica Quando for Mandar uma Dúvida Apenas Pegue a Parte Que Está dando Problemas, Que Agr Seria o Revistar.

3 hours ago, losheard said:

Preciso de ajuda nesse scritp, deixando bem claro que nao entendo a linguagem, mas não tenho condições de pagar alguem pra fazer isso..
Por isso que pesso ajuda de vocês humildemente...

È um script policial de revistar, ta tudo funcionando perfeitamente, mas unico problema que eu estou tendo, é que quando eu revisto alguem, não aparece a arma que a pessoa esta portando entende? vou deixar aqui o Serve.lua



 



------------ Variaveis

Comando = "policial"
ACL = "Policial"

-------------------------------- Funções Iniciais
function AbrirPainel(source, comando, id)
if(id) then
local playerID = tonumber(id)
if(playerID) then
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup(ACL)) then
if getElementData(source, "TS:Abordando") then return end
local Jogador = getPlayerID(playerID)
if not Jogador then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffNão foi possivel encontrar o jogador !", "info") return end
--if Jogador == source then return end
local cx, cy, cz = getElementPosition ( Jogador )
local px, py, pz = getElementPosition ( source )
local distancia    = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end
triggerClientEvent(source, "TS:AbrirPolicial", source)
setElementData(source, "TS:Abordando", Jogador)
toggleAllControls ( source, false )
end
end
end
end
addCommandHandler(Comando, AbrirPainel)

function FecharPolicial (source)
toggleAllControls (source, true )
end
addEvent("TS:FecharPolicial", true)
addEventHandler("TS:FecharPolicial", root, FecharPolicial)

function Algemar (source)
local Jogador = getElementData(source, "TS:Abordando")
if Jogador then
if getElementData(Jogador, "TS:Algemado") == false then
local cx, cy, cz = getElementPosition ( Jogador )
local px, py, pz = getElementPosition ( source )
local distancia    = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end
toggleAllControls (Jogador, false )
setElementData(Jogador, "TS:Algemado", true)
setElementFrozen(Jogador, true)
triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffVocê foi algemado!", "info")
setPedAnimation( Jogador, "GRAVEYARD", "mrnM_loop", -1, true, false, false, false)
else
local cx, cy, cz = getElementPosition ( Jogador )
local px, py, pz = getElementPosition ( source )
local distancia    = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end
setPedAnimation(Jogador, nil)
toggleAllControls (Jogador, true )
setElementData(Jogador, "TS:Algemado", false)
setElementFrozen(Jogador, false)
triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffVocê foi desalgemado!", "info")
end
end
end
addEvent("TS:Algemar", true)
addEventHandler("TS:Algemar", root, Algemar)

function Revistar (source)
local Jogador = getElementData(source, "TS:Abordando")
if Jogador then
setPedAnimation( source, "POLICE", "plc_drgbst_01", 3100, true, false, false, false)
triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO Policial está te revistando!", "info")
if getPlayerWantedLevel(Jogador) >= 1 then
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador está pedido!",source,255,0,0,true)
else
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não está pedido!",source,255,0,0,true)
end
if getElementData(Jogador,"Habilitacoes:Carros") == true then
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Tem Habilitação para Carros!",source,255,0,0,true)
else
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Não tem Habilitação de Carros",source,255,0,0,true)
end
if getElementData(Jogador,"Habilitacoes:Motos") == true then
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Tem Habilitação para Motos!",source,255,0,0,true)
else
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Não tem Habilitação de Motos!",source,255,0,0,true)
end
if getElementData(Jogador,"Habilitacoes:Caminhoes") == true then
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Tem Habilitação para Caminhões!",source,255,0,0,true)
else
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Não tem Habilitação de Caminhão!",source,255,0,0,true)
end
if getElementData(Jogador,"Habilitacoes:Carretas") == true then
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Tem Habilitação para Carretas!",source,255,0,0,true)
else
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Não tem Habilitação de Carretas!",source,255,0,0,true)
end
if getElementData(Jogador,"Habilitacoes:Helicopteros") == true then
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Tem Habilitação para Helicopteros!",source,255,0,0,true)
else
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Não tem Habilitação de Helicopteros!",source,255,0,0,true)
end
local Quantidade = getElementData(source, "TS:"..Droga_Selecionada.."") or 0
for slot = 0, 12 do
local Armas = getPedWeapon (Jogador, slot)
local Municao = getPedTotalAmmo (Jogador, slot)  
if Armas > 0 then
if Municao > 0 then
weapon_nome = getWeaponNameFromID (Armas)
outputChatBox ("* "..weapon_nome.." #3a3a3a»#25e014 "..Municao.." Bala(s)!", source,255,255,255,true)
end
end
end
end
end
addEvent("TS:Revistar", true)
addEventHandler("TS:Revistar", root, Revistar)

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

function ColocarNaViatura (source)
local Jogador = getElementData(source, "TS:Abordando")
if Jogador then
local cx, cy, cz = getElementPosition ( Jogador )
local px, py, pz = getElementPosition ( source )
local distancia    = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end
local viatura = VeiculoPolicial[source]
if VeiculoPolicial[source] then
triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial te colocou na viatura !", "info")
attachElements (Jogador, viatura, 0.2, -1.5, 0, 0,0,90)
setPedAnimation(Jogador, "ped", "CAR_dead_LHS", false, false)
local RotVX, RotVY, RotVZ = getElementRotation(viatura)
setElementRotation(Jogador, RotVX, RotVY, RotVZ + 65)
end
end
end
addEvent ( "TS:ColocarNaViatura", true )
addEventHandler ( "TS:ColocarNaViatura", root, ColocarNaViatura)

function RemoverNaViatura (source)
local Jogador = getElementData( source,"TS:Abordando")
if Jogador then
local cx, cy, cz = getElementPosition ( Jogador )
local px, py, pz = getElementPosition ( source )
local distancia    = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end
local viatura = VeiculoPolicial[source]
if VeiculoPolicial[source] then
triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial te removeu da viatura !", "info")
detachElements (Jogador, viatura)
setPedAnimation(Jogador,nil)
local PosX, PosY, PosZ = getElementPosition(Jogador)
setElementPosition(Jogador, PosX, PosY, PosZ + 2)
end
end
end
addEvent ( "TS:RemoverNaViatura", true )
addEventHandler ( "TS:RemoverNaViatura", root, RemoverNaViatura)

function ApreenderArmas (source)
local Jogador = getElementData( source,"TS:Abordando")
if Jogador then
local cx, cy, cz = getElementPosition ( Jogador )
local px, py, pz = getElementPosition ( source )
local distancia    = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end
triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial removeu todas as suas armas!", "info")
takeAllWeapons(Jogador)
end
end
addEvent ( "TS:ApreenderArmas", true )
addEventHandler ( "TS:ApreenderArmas", root, ApreenderArmas)

function ApreenderPorte (source)
local Jogador = getElementData( source,"TS:Abordando")
if Jogador then
local cx, cy, cz = getElementPosition ( Jogador )
local px, py, pz = getElementPosition ( source )
local distancia    = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end
if getElementData(Jogador, "TS:PorteDeArmas") == "Sim" then
triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial revogou seu porte de armas!", "info") 
setElementData(Jogador, "TS:PorteDeArmas", nil)
end
end
end
addEvent ( "TS:ApreenderPorte", true )
addEventHandler ( "TS:ApreenderPorte", root, ApreenderPorte)


function ApreenderDrogas (source)
local Jogador = getElementData( source,"TS:Abordando")
if Jogador then
local cx, cy, cz = getElementPosition ( Jogador )
local px, py, pz = getElementPosition ( source )
local distancia    = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end
triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial apreendeu suas drogas!", "info") 
setElementData(Jogador, "TS:Maconha", 0)
setElementData(Jogador, "TS:Cocaina", 0)
setElementData(Jogador, "TS:Heroina", 0)
setElementData(Jogador, "TS:Crack", 0)
setElementData(Jogador, "TS:LSD", 0)
end
end
addEvent ( "TS:ApreenderDrogas", true )
addEventHandler ( "TS:ApreenderDrogas", root, ApreenderDrogas)

function AlterarFicha (source, Quantidade)
local Jogador = getElementData( source, "TS:Abordando")
if Jogador then
local cx, cy, cz = getElementPosition ( Jogador )
local px, py, pz = getElementPosition ( source )
local distancia    = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz )
if distancia >= 2 then triggerClientEvent(source, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffChegue mais perto do jogador !", "info") return end
setPlayerWantedLevel(Jogador, Quantidade)
triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial alterou a sua ficha criminal!", "info") 
end
end
addEvent ( "TS:AlterarFicha", true )
addEventHandler ( "TS:AlterarFicha", root, AlterarFicha)

--------------------- Não Meche

function getPlayerID(id)
    v = false
    for i, player in ipairs (getElementsByType("player")) do
        if getElementData(player, "ID") == id then
            v = player
            break
        end
    end
    return v
end

 

Por favor, ficarei muito agradecido, sou novo aqui na comunidade, se eu tiver postando em lugar errado, pode remover sem problema, desculpem qualquer coisa !

Consegue mandar a parte do client-side na hora de revistar, pq não vi nenhum erro especifico no server

local CNHS = {
    {"Habilitacoes:Carros","Carros"},
    {"Habilitacoes:Motos","Motos"},
    {"Habilitacoes:Caminhoes","Caminhoes"},
    {"Habilitacoes:Carretas","Carretas"},
    {"Habilitacoes:Helicopteros","Helicopteros"},
}

function Revistar (source)
    local Jogador = getElementData(source, "TS:Abordando")
    if Jogador then
        setPedAnimation( source, "POLICE", "plc_drgbst_01", 3100, true, false, false, false)
        triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO Policial está te revistando!", "info")
        if getPlayerWantedLevel(Jogador) >= 1 then
            outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador Está Procurado!",source,255,0,0,true)
        else
            outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador Não Está Procurado",source,255,0,0,true)
        end
        for i, v in ipairs(CNHS) do
            if getElementData(Jogador,v[1]) == true then
                outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Tem Habilitação para "..v[2].."!",source,255,0,0,true)
            else
                outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff Não tem Habilitação de "..v[2].."",source,255,0,0,true)
            end
        end
        for i = 0, 12 do
            local arma = getPedWeapon(Jogador,i)
            local muni = getPedTotalAmmo(Jogador,i)
            if arma >= 1 and muni >= 1 then
                local weaponName = getWeaponNameFromID(arma)
                outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O Jogador tem uma "..weaponName.." com "..muni.." Munições !",source,255,255,255,true)
            end
        end
    end
end
addEvent("TS:Revistar", true)
addEventHandler("TS:Revistar", root, Revistar)

Tente isso com um pouco mais de otimização no script :)

Edited by LucasST
Link to post

Perdão, mandei todo porque realmente nao sei qual parte esta errado, irei mandar o Client.lua, vou mandar todo, porque eu realmente nao sei onde esta incorreto.. Espero que me compreenda e possa me ajudar, estou precisando muito :'(

 


local screenW, screenH = guiGetScreenSize()
local x, y = (screenW/1366), (screenH/768)


local dxfont0_icons = dxCreateFont("font/icons.ttf", x*12)
local dxfont1_icons = dxCreateFont("font/icons.ttf", x*9)
local dxfont2_icons = dxCreateFont("font/icons.ttf", x*10)

local AlterarFicha = createElement("TS:AlterarFicha")


painel = false
painel2 = false
painel3 = false
painel4 = false



--[[
         ><><><><><><><><><><><><><><><><><><><><
         ><          Painel Inicial            ><
         ><><><><><><><><><><><><><><><><><><><><
--]]
	
function PainelFicha ()
local Jogador = getElementData(localPlayer, "TS:Abordando")
        exports["Ad-Blur"]:dxDrawBluredRectangle(screenW * 0.3272, screenH * 0.2734, screenW * 0.2914, screenH * 0.1979, tocolor(255, 255, 255, 230))	
        dxDrawRectangle(screenW * 0.3272, screenH * 0.2734, screenW * 0.2914, screenH * 0.1980, tocolor(0, 0, 0, 160), false)
        dxDrawRectangle(screenW * 0.3272, screenH * 0.2734, screenW * 0.2914, screenH * 0.0400, tocolor(0, 0, 0, 180), false)
        dxDrawLine(screenW * 0.3272, screenH * 0.3177, screenW * 0.6186, screenH * 0.3177, tocolor(0, 60, 160, 255), 2, true)
        dxDrawText("Ficha Criminal", screenW * 0.4341, screenH * 0.2786, screenW * 0.5212, screenH * 0.3047, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
        dxDrawText("Pressione enter para alterar e backspace para voltar", screenW * 0.3580, screenH * 0.3255, screenW * 0.6040, screenH * 0.3490, tocolor(255, 255, 255, 255), 1.00, dxfont2_icons, "left", "top", false, false, false, false, false)
        dxDrawText("Ficha atual do jogador : "..getPlayerWantedLevel(Jogador), screenW * 0.3346, screenH * 0.3568, screenW * 0.4473, screenH * 0.3802, tocolor(255, 255, 255, 255), 1.00, dxfont2_icons, "left", "top", false, false, false, false, false)
		dxDrawEditBox("Quantidade Estrelas", screenW * 0.4034, screenH * 0.4036, screenW * 0.1442, screenH * 0.0443, false, 1, AlterarFicha)
      end

function PainelDrogas ()
local Jogador = getElementData(localPlayer, "TS:Abordando")
local Maconha = getElementData(Jogador, "TS:Maconha") or 0
local Cocaina = getElementData(Jogador, "TS:Cocaina") or 0
local Heroina = getElementData(Jogador, "TS:Heroina") or 0
local Crack = getElementData(Jogador, "TS:Crack") or 0
local LSD = getElementData(Jogador, "TS:LSD") or 0
exports["Ad-Blur"]:dxDrawBluredRectangle(screenW * 0.3258, screenH * 0.0208, screenW * 0.3492, screenH * 0.2096, tocolor(255, 255, 255, 230))	
dxDrawRectangle(screenW * 0.3258, screenH * 0.0208, screenW * 0.3492, screenH * 0.2096, tocolor(0, 0, 0, 155), false)
        dxDrawRectangle(screenW * 0.3258, screenH * 0.0208, screenW * 0.3492, screenH * 0.0534, tocolor(0, 0, 0, 155), false)
        dxDrawLine(screenW * 0.3258, screenH * 0.0742, screenW * 0.6750, screenH * 0.0742, tocolor(255, 0, 0, 255), 3, false)
        dxDrawText("Advanced ", screenW * 0.4495, screenH * 0.0299, screenW * 0.5512, screenH * 0.0573, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
        dxDrawText("Maconha : "..Maconha, screenW * 0.3367, screenH * 0.0872, screenW * 0.4107, screenH * 0.1185, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
        dxDrawText("Cocaina : "..Cocaina, screenW * 0.4422, screenH * 0.0872, screenW * 0.5161, screenH * 0.1185, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, true, false, false)
        dxDrawText("Heroina : "..Heroina, screenW * 0.5447, screenH * 0.0872, screenW * 0.6186, screenH * 0.1185, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, true, false, false)
        dxDrawText("Crack : "..Crack, screenW * 0.3367, screenH * 0.1315, screenW * 0.4107, screenH * 0.1628, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
        dxDrawText("LSD : "..LSD, screenW * 0.4422, screenH * 0.1315, screenW * 0.5161, screenH * 0.1628, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
        dxDrawText("Pressione enter para apreender e backspace para voltar", screenW * 0.3441, screenH * 0.1966, screenW * 0.6552, screenH * 0.2227, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
    end
	
function PainelDados ()
local Jogador = getElementData(localPlayer, "TS:Abordando")

local AirNew_Scripter_NomeCompleto = getElementData ( localPlayer, "AirNew_RG_NomeCompleto" ) or "Erro Desconhecido, Contate um Administrador (03)"
local AirNew_Scripter_DataDeNascimento = getElementData ( localPlayer, "AirNew_RG_DataDeNascimento" ) or "Erro Desconhecido, Contate um Administrador (04)"
local PorteArmas = getElementData(Jogador, "TS:PorteDeArmas") or "Não"
local RegistroGeral = getElementData(Jogador, "ID") or "Error"

        exports["Ad-Blur"]:dxDrawBluredRectangle(screenW * 0.3272, screenH * 0.2734, screenW * 0.2914, screenH * 0.3464, tocolor(255, 255, 255, 230))	
        dxDrawRectangle(screenW * 0.3272, screenH * 0.2734, screenW * 0.2914, screenH * 0.3464, tocolor(0, 0, 0, 180), false)
        dxDrawRectangle(screenW * 0.3272, screenH * 0.2734, screenW * 0.2914, screenH * 0.0443, tocolor(0, 0, 0, 205), false)
        dxDrawLine(screenW * 0.3272, screenH * 0.3177, screenW * 0.6186, screenH * 0.3177, tocolor(244, 0, 0, 254), 3, true)
        dxDrawText("Dados pessoais", screenW * 0.4341, screenH * 0.2786, screenW * 0.5212, screenH * 0.3047, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
        dxDrawText("Qualquer informação vazada será cobrada de você !", screenW * 0.3529, screenH * 0.3255, screenW * 0.5981, screenH * 0.3503, tocolor(255, 255, 255, 255), 1.00, dxfont2_icons, "left", "top", false, false, false, false, false)
        dxDrawText("Nome Completo : "..AirNew_Scripter_NomeCompleto, screenW * 0.3346, screenH * 0.3659, screenW * 0.4378, screenH * 0.3958, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, true, false)
        dxDrawText("Data De Nascimento : "..AirNew_Scripter_DataDeNascimento, screenW * 0.3346, screenH * 0.4089, screenW * 0.5256, screenH * 0.4336, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, true, false)
        dxDrawText("Apelido : "..getPlayerName(Jogador), screenW * 0.3346, screenH * 0.4466, screenW * 0.5015, screenH * 0.4714, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, true, false)
        dxDrawText("Porte De Armas : "..PorteArmas, screenW * 0.3346, screenH * 0.4844, screenW * 0.5015, screenH * 0.5091, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, true, false)
        dxDrawText("CPF : "..RegistroGeral, screenW * 0.3346, screenH * 0.5221, screenW * 0.5015, screenH * 0.5469, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, true, false)
        dxDrawText("Para voltar pressione backspace", screenW * 0.3734, screenH * 0.5898, screenW * 0.5783, screenH * 0.6146, tocolor(255, 255, 255, 255), 1.00, dxfont2_icons, "left", "top", false, false, false, true, false)
end

function PainelPolicial ()
local ParteSelecionada = getElementData(localPlayer, "TS:PartePainel") or 1
local Jogador = getElementData(localPlayer, "TS:Abordando")
        exports["Ad-Blur"]:dxDrawBluredRectangle(screenW * 0.0139, screenH * 0.2500, screenW * 0.2042, screenH * 0.4453, tocolor(255, 255, 255, 230))	
        dxDrawRectangle(screenW * 0.0139, screenH * 0.2500, screenW * 0.2042, screenH * 0.4453, tocolor(0, 0, 0, 100), false)
        dxDrawRectangle(screenW * 0.0139, screenH * 0.2500, screenW * 0.2042, screenH * 0.0443, tocolor(0, 0, 0, 185), false)
        dxDrawLine(screenW * 0.0139, screenH * 0.2943, screenW * 0.2182, screenH * 0.2943, tocolor(244, 0, 0, 254), 3, true)
        dxDrawText("Sistema Policial", screenW * 0.0732, screenH * 0.2552, screenW * 0.1603, screenH * 0.2813, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
        if ParteSelecionada == 1 then
		dxDrawRectangle(screenW * 0.0139, screenH * 0.2969, screenW * 0.2042, screenH * 0.0443, tocolor(255, 0, 0, 255), false)
        if getElementData(Jogador, "TS:Algemado") == true then
		dxDrawText("Desalgemar",  screenW * 0.0849, screenH * 0.3047, screenW * 0.1515, screenH * 0.3359, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
        else
		dxDrawText("Algemar", screenW * 0.0937, screenH * 0.3047, screenW * 0.1406, screenH * 0.3281, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
		end
		else
		dxDrawRectangle(screenW * 0.0139, screenH * 0.2969, screenW * 0.2042, screenH * 0.0443, tocolor(0, 0, 0, 100), false)
        if getElementData(Jogador, "TS:Algemado") == true then
		dxDrawText("Desalgemar",  screenW * 0.0849, screenH * 0.3047, screenW * 0.1515, screenH * 0.3359, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
        else
		dxDrawText("Algemar", screenW * 0.0937, screenH * 0.3047, screenW * 0.1406, screenH * 0.3281, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
		end
        end
		if ParteSelecionada == 2 then
		dxDrawRectangle(screenW * 0.0139, screenH * 0.3411, screenW * 0.2042, screenH * 0.0443, tocolor(255, 0, 0, 255), false)
        dxDrawText("Revistar", screenW * 0.0922, screenH * 0.3490, screenW * 0.1391, screenH * 0.3724, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
		else
		dxDrawRectangle(screenW * 0.0139, screenH * 0.3411, screenW * 0.2042, screenH * 0.0443, tocolor(0, 0, 0, 185), false)
        dxDrawText("Revistar", screenW * 0.0922, screenH * 0.3490, screenW * 0.1391, screenH * 0.3724, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
        end
		if ParteSelecionada == 3 then
		dxDrawRectangle(screenW * 0.0139, screenH * 0.3854, screenW * 0.2042, screenH * 0.0443, tocolor(255, 0, 0, 255), false)
        dxDrawText("Dados Pessoais", screenW * 0.0710, screenH * 0.3906, screenW * 0.1625, screenH * 0.4193, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
        else
		dxDrawRectangle(screenW * 0.0139, screenH * 0.3854, screenW * 0.2042, screenH * 0.0443, tocolor(0, 0, 0, 100), false)
        dxDrawText("Dados Pessoais", screenW * 0.0710, screenH * 0.3906, screenW * 0.1625, screenH * 0.4193, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
        end
		if ParteSelecionada == 4 then
		dxDrawRectangle(screenW * 0.0139, screenH * 0.4297, screenW * 0.2042, screenH * 0.0443, tocolor(255, 0, 0, 255), false)
        dxDrawText("Ficha Criminal", screenW * 0.0783, screenH * 0.4349, screenW * 0.1589, screenH * 0.4635, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
		else
		dxDrawRectangle(screenW * 0.0139, screenH * 0.4297, screenW * 0.2042, screenH * 0.0443, tocolor(0, 0, 0, 185), false)
        dxDrawText("Ficha Criminal", screenW * 0.0783, screenH * 0.4349, screenW * 0.1589, screenH * 0.4635, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
        end
		
		if ParteSelecionada == 5 then
		dxDrawRectangle(screenW * 0.0139, screenH * 0.4740, screenW * 0.2042, screenH * 0.0443, tocolor(255, 0, 0, 255), false)
        dxDrawText("Colocar na viatura", screenW * 0.0652, screenH * 0.4792, screenW * 0.1662, screenH * 0.5078, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
 		else
		dxDrawRectangle(screenW * 0.0139, screenH * 0.4740, screenW * 0.2042, screenH * 0.0443, tocolor(0, 0, 0, 100), false)
        dxDrawText("Colocar na viatura", screenW * 0.0652, screenH * 0.4792, screenW * 0.1662, screenH * 0.5078, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
        end
		if ParteSelecionada == 6 then
		dxDrawRectangle(screenW * 0.0139, screenH * 0.5182, screenW * 0.2042, screenH * 0.0443, tocolor(255, 0, 0, 255), false)
        dxDrawText("Remover da viatura", screenW * 0.0615, screenH * 0.5247, screenW * 0.1698, screenH * 0.5547, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
 		else
		dxDrawRectangle(screenW * 0.0139, screenH * 0.5182, screenW * 0.2042, screenH * 0.0443, tocolor(0, 0, 0, 185), false)
        dxDrawText("Remover da viatura", screenW * 0.0615, screenH * 0.5247, screenW * 0.1698, screenH * 0.5547, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
        end
		if ParteSelecionada == 7 then
		dxDrawRectangle(screenW * 0.0139, screenH * 0.5625, screenW * 0.2042, screenH * 0.0443, tocolor(255, 0, 0, 255), false)
        dxDrawText("Apreender Armas", screenW * 0.0688, screenH * 0.5677, screenW * 0.1662, screenH * 0.5938, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
		else
		dxDrawRectangle(screenW * 0.0139, screenH * 0.5625, screenW * 0.2042, screenH * 0.0443, tocolor(0, 0, 0, 100), false)
        dxDrawText("Apreender Armas", screenW * 0.0688, screenH * 0.5677, screenW * 0.1662, screenH * 0.5938, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
        end
		if ParteSelecionada == 8 then
		dxDrawRectangle(screenW * 0.0139, screenH * 0.6068, screenW * 0.2042, screenH * 0.0443, tocolor(255, 0, 0, 255), false)
        dxDrawText("Revogar Porte", screenW * 0.0761, screenH * 0.6120, screenW * 0.1552, screenH * 0.6380, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
		else
		dxDrawRectangle(screenW * 0.0139, screenH * 0.6068, screenW * 0.2042, screenH * 0.0443, tocolor(0, 0, 0, 185), false)
        dxDrawText("Revogar Porte", screenW * 0.0761, screenH * 0.6120, screenW * 0.1552, screenH * 0.6380, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
        end
		if ParteSelecionada == 9 then
        dxDrawRectangle(screenW * 0.0139, screenH * 0.6511, screenW * 0.2042, screenH * 0.0443, tocolor(255, 0, 0, 255), false)
        dxDrawText("Verificar Drogas", screenW * 0.0666, screenH * 0.6549, screenW * 0.1574, screenH * 0.6849, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
        else
        dxDrawRectangle(screenW * 0.0139, screenH * 0.6511, screenW * 0.2042, screenH * 0.0443, tocolor(0, 0, 0, 100), false)
        dxDrawText("Verificar Drogas", screenW * 0.0666, screenH * 0.6549, screenW * 0.1574, screenH * 0.6849, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false)
        end
		dxDrawText("↑ - ↓  - Mover | Enter - Selecionar | Backspace - Voltar", screenW * 0.0139, screenH * 0.6952, screenW * 0.2445, screenH * 0.6771, tocolor(255, 255, 255, 255), 1.00, dxfont1_icons, "left", "top", false, false, false, false, false)
		end

--[[
         ><><><><><><><><><><><><><><><><><><><><
         ><      Configurações N Altere        ><
         ><><><><><><><><><><><><><><><><><><><><
--]]

function convertTime(ms) 
    local min = math.floor ( ms/60000 ) 
    local sec = math.floor( (ms/1000)%60 ) 
    return min, sec 
end

function AbrirPolicial ()
if painel == false then
  addEventHandler ( "onClientRender", root, PainelPolicial )
  painel = true
  playSoundFrontEnd ( 43 )
  setElementData(localPlayer, "TS:PartePainel", 0)
  else
  removeEventHandler ( "onClientRender", root, PainelPolicial )
  painel = false
  playSoundFrontEnd ( 43 )
end
end
addEvent ("TS:AbrirPolicial", true)
addEventHandler ("TS:AbrirPolicial", getRootElement(), AbrirPolicial)

function AbrirDados ()
if painel2 == false then
  addEventHandler ( "onClientRender", root, PainelDados )
  painel2 = true
  playSoundFrontEnd ( 43 )
  setElementData(localPlayer, "TS:PartePainel", 3)
  setElementData(localPlayer, "TS:AbaPainel", "Dados")
  else
  setElementData(localPlayer, "TS:AbaPainel", nil)
  removeEventHandler ( "onClientRender", root, PainelDados )
  painel2 = false
  playSoundFrontEnd ( 43 )
end
end

function AbrirDrogas ()
    if painel4 == false then
      addEventHandler ( "onClientRender", root, PainelDrogas )
      painel4 = true
      playSoundFrontEnd ( 43 )
      setElementData(localPlayer, "TS:PartePainel", 9)
      setElementData(localPlayer, "TS:AbaPainel", "Drogas")
      else
      setElementData(localPlayer, "TS:AbaPainel", nil)
      removeEventHandler ( "onClientRender", root, PainelDrogas )
      painel4 = false
      playSoundFrontEnd ( 43 )
    end
    end

function AbrirFicha ()
if painel3 == false then
  addEventHandler ( "onClientRender", root, PainelFicha )
  painel3 = true
  playSoundFrontEnd ( 43 )
  setElementData(localPlayer, "TS:PartePainel", 4)
  setElementData(localPlayer, "TS:AbaPainel", "Ficha")
  setElementData(AlterarFicha, "state", true)
  else
  setElementData(AlterarFicha, "state", false)
  setElementData(localPlayer, "TS:AbaPainel", nil)
  removeEventHandler ( "onClientRender", root, PainelFicha )
  painel3 = false
  playSoundFrontEnd ( 43 )
end
end

function MudarAba (button, press)
local Aba = getElementData(localPlayer, "TS:PartePainel") or 0
 if painel == true then
 if press then
  if getElementData(localPlayer, "TS:AbaPainel") == "Dados" or getElementData(localPlayer, "TS:AbaPainel") == "Ficha" then return end
   if button == "arrow_d" then
   if Aba == 0 then
    setElementData(localPlayer, "TS:PartePainel", 1)
    playSoundFrontEnd ( 43 )
	elseif Aba == 1 then
	setElementData(localPlayer, "TS:PartePainel", 2)
    playSoundFrontEnd ( 43 )
	elseif Aba == 2 then
	setElementData(localPlayer, "TS:PartePainel", 3)
    playSoundFrontEnd ( 43 )
	elseif Aba == 3 then
	setElementData(localPlayer, "TS:PartePainel", 4)
    playSoundFrontEnd ( 43 )
	elseif Aba == 4 then
	setElementData(localPlayer, "TS:PartePainel", 5)
    playSoundFrontEnd ( 43 )
	elseif Aba == 5 then
	setElementData(localPlayer, "TS:PartePainel", 6)
    playSoundFrontEnd ( 43 )
	elseif Aba == 6 then
	setElementData(localPlayer, "TS:PartePainel", 7)
    playSoundFrontEnd ( 43 )
	elseif Aba == 7 then
	setElementData(localPlayer, "TS:PartePainel", 8)
    playSoundFrontEnd ( 43 )
	elseif Aba == 8 then
	setElementData(localPlayer, "TS:PartePainel", 9)
    playSoundFrontEnd ( 43 )
	elseif Aba == 9 then
    setElementData(localPlayer, "TS:PartePainel", 1)
    playSoundFrontEnd ( 43 )
    end
	elseif button == "arrow_u" then
	if Aba == 9 then
    setElementData(localPlayer, "TS:PartePainel", 8)
    playSoundFrontEnd ( 43 )
    elseif Aba == 8 then
    setElementData(localPlayer, "TS:PartePainel", 7)
    playSoundFrontEnd ( 43 )
	elseif Aba == 7 then
    setElementData(localPlayer, "TS:PartePainel", 6)
    playSoundFrontEnd ( 43 )
	elseif Aba == 6 then
    setElementData(localPlayer, "TS:PartePainel", 5)
    playSoundFrontEnd ( 43 )
	elseif Aba == 5 then
    setElementData(localPlayer, "TS:PartePainel", 4)
    playSoundFrontEnd ( 43 )
	elseif Aba == 4 then
    setElementData(localPlayer, "TS:PartePainel", 3)
    playSoundFrontEnd ( 43 )
	elseif Aba == 3 then
    setElementData(localPlayer, "TS:PartePainel", 2)
    playSoundFrontEnd ( 43 )
	elseif Aba == 2 then
    setElementData(localPlayer, "TS:PartePainel", 1)
    playSoundFrontEnd ( 43 )
	elseif Aba == 1 then
    setElementData(localPlayer, "TS:PartePainel", 9)
    playSoundFrontEnd ( 43 )
	end
  end
  end
  end
 end
addEventHandler ("onClientKey", root, MudarAba )

function ExecutarFuncao (_,state)
 if painel == true then
  if state == "down" then
  if getElementData(localPlayer, "TS:AbaPainel") == "Ficha" then
  local getMudarFicha = tonumber(getElementData(AlterarFicha, "text"))
  if type(getMudarFicha) == "number" then
  triggerServerEvent( 'TS:AlterarFicha', getLocalPlayer(), localPlayer, getMudarFicha)
  end
  end
  if getElementData(localPlayer, "TS:AbaPainel") == "Drogas" then
    triggerServerEvent( 'TS:ApreenderDrogas', getLocalPlayer(), localPlayer)
    end
  local Aba = getElementData(localPlayer, "TS:PartePainel") or 0
  if Aba == 1 then
  triggerServerEvent( 'TS:Algemar', getLocalPlayer(), localPlayer)
  elseif Aba == 2 then
  triggerServerEvent( 'TS:Revistar', getLocalPlayer(), localPlayer)
  elseif Aba == 3 then
  AbrirDados ()
  elseif Aba == 4 then
  AbrirFicha ()
  elseif Aba == 5 then
  triggerServerEvent( 'TS:ColocarNaViatura', getLocalPlayer(), localPlayer)
  elseif Aba == 6 then
  triggerServerEvent( 'TS:RemoverNaViatura', getLocalPlayer(), localPlayer)
  elseif Aba == 7 then
   triggerServerEvent( 'TS:ApreenderArmas', getLocalPlayer(), localPlayer)
  elseif Aba == 8 then
   triggerServerEvent( 'TS:ApreenderPorte', getLocalPlayer(), localPlayer)
elseif Aba == 9 then
    AbrirDrogas()
  end
  end
 end
 end
bindKey("enter", "down", ExecutarFuncao)

function FecharPainel (_,state)
 if painel == true then
  if state == "down" then
  if getElementData(localPlayer, "TS:AbaPainel") == "Dados" then
  AbrirDados ()
  elseif getElementData(localPlayer, "TS:AbaPainel") == "Ficha" then
  AbrirFicha ()
  elseif getElementData(localPlayer, "TS:AbaPainel") == "Drogas" then
    AbrirDrogas()
  else
  triggerServerEvent( 'TS:FecharPolicial', getLocalPlayer(), localPlayer)
   AbrirPolicial()
   setElementData(localPlayer, "TS:Abordando", nil)
  end
  end
 end
 end
bindKey("backspace", "down", FecharPainel)

function isCursorOnElement ( x, y, w, h )
local mx, my = getCursorPosition ()
 local fullx, fully = guiGetScreenSize ()
  cursorx, cursory = mx*fullx, my*fully
   if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then
    return true
   else
  return false
 end
end

 

Link to post

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