So I have made it so when you smoke meth it brings out a bong and does a animation how do i stop players from getting in the car while it is active?
here is my function so far:
function EnableBong()
bongActive = true
local ped = GetPlayerPed(-1)
local pedPos = GetEntityCoords(ped, false)
RequestAnimDict(animDict)
while not HasAnimDictLoaded(animDict) do
Citizen.Wait(100)
end
TaskPlayAnim(ped, animDict, animName, 8.0, -8.0, -1, (2 + 16 + 32), 0.0, 0, 0, 0)
RequestModel(GetHashKey(prop))
while not HasModelLoaded(GetHashKey(prop)) do
Citizen.Wait(100)
end
local bong = CreateObject(GetHashKey(prop), pedPos.x, pedPos.y, pedPos.z, 1, 1, 1)
bongEntity = bong
AttachEntityToEntity(bongEntity, ped, GetEntityBoneIndexByName(ped, "IK_R_Hand"), 0.0, 0.0, 0.0, 0.0, 0.0, 70.0, 0, 0, 0, 0, 0, 1)
end
any help will be greatly appreciated!
cheers