HG Snuuk Posted August 24, 2019 Share Posted August 24, 2019 Opa tudo bom ^^ , é que estou tendo um conflito com dois scripts no momento que seria com o inventario do carro e o script de prisão quando o individuo vai pro porta malas e ele consegue acessar o porta malas assim travando o carro . gostaria de fazer com que assim que o mesmo for preso ele n consiguir acessar nada nem o mouseclicker nem cancelar anim de afogado . 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) Link to comment
HG Snuuk Posted August 25, 2019 Author Share Posted August 25, 2019 alguem sabe como posso tar bloqueando comandos quando o play for preso na viatura ? exemplo o player n consiguir cancelar animação com o shift ou não abrir showCursor ? Link to comment
juaosilv Posted August 25, 2019 Share Posted August 25, 2019 A melhor solução (entendendo seu problema) é fazer com que quando o usuário seja preso seja setado uma elementDate nele, depois é só você fazer um código bloqueando o uso desses comando caso ele tenha a elementData setada. Link to comment
Jonas^ Posted August 26, 2019 Share Posted August 26, 2019 (edited) O bloqueio deve ser feito pelo evento OnClientKey. Desta forma: addEventHandler ("onClientKey", root, function (button, press) if getElementData (localPlayer, "dataPreso") then -- Suponhando que a data que o jogador recebe quando é preso é "dataPreso", então: if button == "F1" or button == "F2" or button == "F3" or button == "F4" or button == "F5" or button == "F6" or button == "F7" or button == "F9" or button == "F10" or button == "F11" or button == "F12" or button == "t" then cancelEvent () end end end) Edited August 26, 2019 by Jonas^ Link to comment
Other Languages Moderators Lord Henry Posted August 26, 2019 Other Languages Moderators Share Posted August 26, 2019 A questão de cancelar animações com o Shift é por causa do Freeroam. Ele cancela qualquer animação ao tentar pular. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now