Jump to content

Recommended Posts

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

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 by Jonas^
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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