mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-19 06:46:04 +01:00
Add condition for stopping entity fade in
This commit is contained in:
@@ -55,7 +55,7 @@ end
|
|||||||
-- ```lua
|
-- ```lua
|
||||||
-- local ped = makePed(pedData, pedCoords, true, false, nil, {'animDict', 'animName'}, true)
|
-- local ped = makePed(pedData, pedCoords, true, false, nil, {'animDict', 'animName'}, true)
|
||||||
-- ```
|
-- ```
|
||||||
function makePed(data, coords, freeze, collision, scenario, anim, synced)
|
function makePed(data, coords, freeze, collision, scenario, anim, synced, fade)
|
||||||
local ped = nil
|
local ped = nil
|
||||||
local model = nil
|
local model = nil
|
||||||
if type(data) == "table" then
|
if type(data) == "table" then
|
||||||
@@ -142,10 +142,11 @@ function makePed(data, coords, freeze, collision, scenario, anim, synced)
|
|||||||
end
|
end
|
||||||
unloadModel(model)
|
unloadModel(model)
|
||||||
Peds[keyGen()..keyGen()] = ped
|
Peds[keyGen()..keyGen()] = ped
|
||||||
|
if fade ~= false then
|
||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
fadeInEnt(ped)
|
fadeInEnt(ped)
|
||||||
end)
|
end)
|
||||||
|
end
|
||||||
return ped
|
return ped
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ local Props = {}
|
|||||||
--- }
|
--- }
|
||||||
--- local prop = makeProp(propData, true, false)
|
--- local prop = makeProp(propData, true, false)
|
||||||
--- ```
|
--- ```
|
||||||
function makeProp(data, freeze, synced)
|
function makeProp(data, freeze, synced, fade)
|
||||||
loadModel(data.prop)
|
loadModel(data.prop)
|
||||||
local prop = CreateObject(data.prop, data.coords.x, data.coords.y, data.coords.z-1.03, synced and synced or false, synced and synced or false, false)
|
local prop = CreateObject(data.prop, data.coords.x, data.coords.y, data.coords.z-1.03, synced and synced or false, synced and synced or false, false)
|
||||||
SetEntityAlpha(veh, 0, false)
|
SetEntityAlpha(veh, 0, false)
|
||||||
@@ -30,9 +30,11 @@ function makeProp(data, freeze, synced)
|
|||||||
debugPrint("^6Bridge^7: ^1Prop ^2Created^7: '^6"..prop.."^7' | ^2Hash^7: ^7'^6"..data.prop.."^7' | ^2Coord^7: "..formatCoord(data.coords))
|
debugPrint("^6Bridge^7: ^1Prop ^2Created^7: '^6"..prop.."^7' | ^2Hash^7: ^7'^6"..data.prop.."^7' | ^2Coord^7: "..formatCoord(data.coords))
|
||||||
SetModelAsNoLongerNeeded(data.prop)
|
SetModelAsNoLongerNeeded(data.prop)
|
||||||
Props[keyGen()..keyGen()] = prop
|
Props[keyGen()..keyGen()] = prop
|
||||||
CreateThread(function()
|
if fade ~= false then
|
||||||
fadeInEnt(prop)
|
CreateThread(function()
|
||||||
end)
|
fadeInEnt(prop)
|
||||||
|
end)
|
||||||
|
end
|
||||||
return prop
|
return prop
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ local Vehicles = {}
|
|||||||
--- ```lua
|
--- ```lua
|
||||||
--- local vehicle = makeVeh('adder', vector4(123.4, 567.8, 90.1, 180.0))
|
--- local vehicle = makeVeh('adder', vector4(123.4, 567.8, 90.1, 180.0))
|
||||||
--- ```
|
--- ```
|
||||||
function makeVeh(model, coords, synced)
|
function makeVeh(model, coords, synced, fade)
|
||||||
loadModel(model)
|
loadModel(model)
|
||||||
local veh = CreateVehicle(model, coords.x, coords.y, coords.z, coords.w, synced ~= false, false)
|
local veh = CreateVehicle(model, coords.x, coords.y, coords.z, coords.w, synced ~= false, false)
|
||||||
SetVehicleHasBeenOwnedByPlayer(veh, true)
|
SetVehicleHasBeenOwnedByPlayer(veh, true)
|
||||||
@@ -31,9 +31,11 @@ function makeVeh(model, coords, synced)
|
|||||||
debugPrint("^6Bridge^7: ^1Veh ^2Created^7: '^6"..veh.."^7' | ^2Hash^7: ^7'^6"..model.."^7' | ^2Coord^7: "..formatCoord(coords))
|
debugPrint("^6Bridge^7: ^1Veh ^2Created^7: '^6"..veh.."^7' | ^2Hash^7: ^7'^6"..model.."^7' | ^2Coord^7: "..formatCoord(coords))
|
||||||
unloadModel(model)
|
unloadModel(model)
|
||||||
Vehicles[#Vehicles + 1] = veh
|
Vehicles[#Vehicles + 1] = veh
|
||||||
CreateThread(function()
|
if fade ~= false then
|
||||||
fadeInEnt(veh)
|
CreateThread(function()
|
||||||
end)
|
fadeInEnt(veh)
|
||||||
|
end)
|
||||||
|
end
|
||||||
return veh
|
return veh
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user