Jump to content

Painel Policial


Recommended Posts

Posted

Ola boa tarde sou novo na area de script estou enfrentando problemas com o painel policial alguem pode me ajudar a resolver quando eu revisto uma pessoa apenas aparece a cnh e não as armas que a pessoa tem vou colar o script logo a baixo

 

--[[
===========================================================
# Minha página: https://www.facebook.com/TioSteinScripter/#
#      ╔════╗╔══╗╔═══╗     ╔═══╗╔════╗╔═══╗╔══╗╔═╗─╔╗     #
#      ║╔╗╔╗║╚╣─╝║╔═╗║     ║╔═╗║║╔╗╔╗║║╔══╝╚╣─╝║║╚╗║║     #
#      ╚╝║║╚╝─║║─║║─║║     ║╚══╗╚╝║║╚╝║╚══╗─║║─║╔╗╚╝║     #
#      ──║║───║║─║║─║║     ╚══╗║──║║──║╔══╝─║║─║║╚╗║║     #
#      ──║║──╔╣─╗║╚═╝║     ║╚═╝║──║║──║╚══╗╔╣─╗║║─║║║     #
#      ──╚╝──╚══╝╚═══╝     ╚═══╝──╚╝──╚═══╝╚══╝╚╝─╚═╝     #
===========================================================
--]]

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

Comando = "p"
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,"DNL:Categoria(A)") == true then
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação A!",source,255,0,0,true)
else
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação A!",source,255,0,0,true)
end
if getElementData(Jogador,"DNL:Categoria(B)") == true then
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação B!",source,255,0,0,true)
else
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação B!",source,255,0,0,true)
end
if getElementData(Jogador,"DNL:Categoria(C)") == true then
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação C!",source,255,0,0,true)
else
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação C!",source,255,0,0,true)
end
if getElementData(Jogador,"DNL:Categoria(D)") == true then
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação D!",source,255,0,0,true)
else
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação D!",source,255,0,0,true)
end
if getElementData(Jogador,"DNL:Categoria(E)") == true then
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação E!",source,255,0,0,true)
else
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação E!",source,255,0,0,true)
end
local Quantidade = getElementData(source, "TS:"..Droga_Selecionada.."") or 0
for slot = 0, 12 do
local Armamento = getPedWeapon ( Jogador, slot )
if Armamento > 0 then 
local NomeDaArma = getWeaponNameFromID ( Armamento )
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem "..NomeDaArma.."!",source,255,0,0,true)
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, "AirNewSCR_Porte_de_Armas") == "Sim" then
triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial revogou seu porte de armas!", "info") 
setElementData(Jogador, "AirNewSCR_Porte_de_Armas", 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
 

Posted (edited)

cara, eu não entendo muito porque você é muito complicado, se você puder compartilhar o arquivo lua corretamente, eu posso ajudar,Você pode consertar a parte do "Jogador"

se você ainda receber o mesmo erro, altere ou destrua o lado do triggerClientEvent
 

Edited by eoL|Shady
Posted

 

--[[
===========================================================
# Minha página: https://www.facebook.com/TioSteinScripter/#
#      ╔════╗╔══╗╔═══╗     ╔═══╗╔════╗╔═══╗╔══╗╔═╗─╔╗     #
#      ║╔╗╔╗║╚╣─╝║╔═╗║     ║╔═╗║║╔╗╔╗║║╔══╝╚╣─╝║║╚╗║║     #
#      ╚╝║║╚╝─║║─║║─║║     ║╚══╗╚╝║║╚╝║╚══╗─║║─║╔╗╚╝║     #
#      ──║║───║║─║║─║║     ╚══╗║──║║──║╔══╝─║║─║║╚╗║║     #
#      ──║║──╔╣─╗║╚═╝║     ║╚═╝║──║║──║╚══╗╔╣─╗║║─║║║     #
#      ──╚╝──╚══╝╚═══╝     ╚═══╝──╚╝──╚═══╝╚══╝╚╝─╚═╝     #
===========================================================
--]]

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

Comando = "p"
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,"DNL:Categoria(A)") == true then
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação A!",source,255,0,0,true)
else
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação A!",source,255,0,0,true)
end
if getElementData(Jogador,"DNL:Categoria(B)") == true then
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação B!",source,255,0,0,true)
else
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação B!",source,255,0,0,true)
end
if getElementData(Jogador,"DNL:Categoria(C)") == true then
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação C!",source,255,0,0,true)
else
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação C!",source,255,0,0,true)
end
if getElementData(Jogador,"DNL:Categoria(D)") == true then
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação D!",source,255,0,0,true)
else
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação D!",source,255,0,0,true)
end
if getElementData(Jogador,"DNL:Categoria(E)") == true then
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação E!",source,255,0,0,true)
else
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação E!",source,255,0,0,true)
end
local Quantidade = getElementData(source, "TS:"..Droga_Selecionada.."") or 0
for slot = 0, 12 do
local Armamento = getPedWeapon ( Jogador, slot )
if Armamento > 0 then 
local NomeDaArma = getWeaponNameFromID ( Armamento )
outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem "..NomeDaArma.."!",source,255,0,0,true)
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, "AirNewSCR_Porte_de_Armas") == "Sim" then
triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial revogou seu porte de armas!", "info") 
setElementData(Jogador, "AirNewSCR_Porte_de_Armas", 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

 

 

Posted

Já tem isso no seu código, apenas fiz algo para aparecer caso ele não tenha armamento:
 

--[[
===========================================================
# Minha página: https://www.facebook.com/TioSteinScripter/#
#      ╔════╗╔══╗╔═══╗     ╔═══╗╔════╗╔═══╗╔══╗╔═╗─╔╗     #
#      ║╔╗╔╗║╚╣─╝║╔═╗║     ║╔═╗║║╔╗╔╗║║╔══╝╚╣─╝║║╚╗║║     #
#      ╚╝║║╚╝─║║─║║─║║     ║╚══╗╚╝║║╚╝║╚══╗─║║─║╔╗╚╝║     #
#      ──║║───║║─║║─║║     ╚══╗║──║║──║╔══╝─║║─║║╚╗║║     #
#      ──║║──╔╣─╗║╚═╝║     ║╚═╝║──║║──║╚══╗╔╣─╗║║─║║║     #
#      ──╚╝──╚══╝╚═══╝     ╚═══╝──╚╝──╚═══╝╚══╝╚╝─╚═╝     #
===========================================================
--]]

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

Comando = "p"
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,"DNL:Categoria(A)") == true then
			outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação A!",source,255,0,0,true)
		else
			outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação A!",source,255,0,0,true)
		end
		if getElementData(Jogador,"DNL:Categoria(B)") == true then
			outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação B!",source,255,0,0,true)
		else
			outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação B!",source,255,0,0,true)
		end
		if getElementData(Jogador,"DNL:Categoria(C)") == true then
			outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação C!",source,255,0,0,true)
		else
			outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação C!",source,255,0,0,true)
		end
		if getElementData(Jogador,"DNL:Categoria(D)") == true then
			outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação D!",source,255,0,0,true)
		else
			outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação D!",source,255,0,0,true)
		end
		if getElementData(Jogador,"DNL:Categoria(E)") == true then
			outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação E!",source,255,0,0,true)
		else
			outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação E!",source,255,0,0,true)
		end
		local Quantidade = getElementData(source, "TS:"..Droga_Selecionada.."") or 0
		local arma = false
		for slot = 0, 12 do
			local Armamento = getPedWeapon ( Jogador, slot )
			if Armamento > 0 then 
				local NomeDaArma = getWeaponNameFromID ( Armamento )
				arma = true
				outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem "..NomeDaArma.."!",source,255,0,0,true)
			end
		end
		if not arma then 
			outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não está armado!",source,255,0,0,true)
		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, "AirNewSCR_Porte_de_Armas") == "Sim" then
			triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial revogou seu porte de armas!", "info") 
			setElementData(Jogador, "AirNewSCR_Porte_de_Armas", 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

 

  • 3 weeks later...
Posted

@Blaack Ainda Não pegou o problema pode ser no sever?

 

 

--[[
===========================================================
# Minha página: https://www.facebook.com/TioSteinScripter/#
#      ╔════╗╔══╗╔═══╗     ╔═══╗╔════╗╔═══╗╔══╗╔═╗─╔╗     #
#      ║╔╗╔╗║╚╣─╝║╔═╗║     ║╔═╗║║╔╗╔╗║║╔══╝╚╣─╝║║╚╗║║     #
#      ╚╝║║╚╝─║║─║║─║║     ║╚══╗╚╝║║╚╝║╚══╗─║║─║╔╗╚╝║     #
#      ──║║───║║─║║─║║     ╚══╗║──║║──║╔══╝─║║─║║╚╗║║     #
#      ──║║──╔╣─╗║╚═╝║     ║╚═╝║──║║──║╚══╗╔╣─╗║║─║║║     #
#      ──╚╝──╚══╝╚═══╝     ╚═══╝──╚╝──╚═══╝╚══╝╚╝─╚═╝     #
===========================================================
--]]

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

Comando = "p"
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,"DNL:Categoria(A)") == true then
			outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação A!",source,255,0,0,true)
		else
			outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação A!",source,255,0,0,true)
		end
		if getElementData(Jogador,"DNL:Categoria(B)") == true then
			outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação B!",source,255,0,0,true)
		else
			outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação B!",source,255,0,0,true)
		end
		if getElementData(Jogador,"DNL:Categoria(C)") == true then
			outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação C!",source,255,0,0,true)
		else
			outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação C!",source,255,0,0,true)
		end
		if getElementData(Jogador,"DNL:Categoria(D)") == true then
			outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação D!",source,255,0,0,true)
		else
			outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação D!",source,255,0,0,true)
		end
		if getElementData(Jogador,"DNL:Categoria(E)") == true then
			outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem Habilitação E!",source,255,0,0,true)
		else
			outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não tem Habilitação E!",source,255,0,0,true)
		end
		local Quantidade = getElementData(source, "TS:"..Droga_Selecionada.."") or 0
		local arma = false
		for slot = 0, 12 do
			local Armamento = getPedWeapon ( Jogador, slot )
			if Armamento > 0 then 
				local NomeDaArma = getWeaponNameFromID ( Armamento )
				arma = true
				outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador tem "..NomeDaArma.."!",source,255,0,0,true)
			end
		end
		if not arma then 
			outputChatBox("#0037FF✘#ffffffINFO#0037FF✘➺ #ffffff O jogador não está armado!",source,255,0,0,true)
		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, "AirNewSCR_Porte_de_Armas") == "Sim" then
			triggerClientEvent(Jogador, "addNotification", root, "#0037FF✘#ffffffINFO#0037FF✘➺ #ffffffO policial revogou seu porte de armas!", "info") 
			setElementData(Jogador, "AirNewSCR_Porte_de_Armas", 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
  • Moderators
Posted

Hi @leonardo2021cabrito

I've gone around and hid a few duplicate posts about this - please try to keep it all on 1 thread. Good luck resolving this.

Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for a lifetime - Lao Tzu

Posted

@leonardo2021cabritoEntre em contato com o criador do script se você comprou dele.
Não cole os códigos sem estar dentro da formatação da linguagem para evitar spam.

Please do not PM me with scripting related question nor support, use the forums instead.

  • DNL291 locked this topic
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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