mirror of
https://github.com/jimathy/jim-consumables.git
synced 2026-08-19 15:36:05 +01:00
Fixes to 2nd model loading
This commit is contained in:
@@ -83,18 +83,22 @@ RegisterNetEvent('jim-consumables:Consume', function(itemName)
|
|||||||
consuming = true
|
consuming = true
|
||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
--Prop Spawning
|
--Prop Spawning
|
||||||
if model and IsModelValid(model) == 1 then
|
if model then
|
||||||
if Config.Debug then print("^5Debug^7: ^3PropSpawn^7: ^2Spawning consumable prop^7.") end
|
if IsModelValid(model) == 1 then
|
||||||
attachProp = makeProp({ prop = model, coords = vector4(0.0,0.0,0.0,0.0)}, 1, 1)
|
if Config.Debug then print("^5Debug^7: ^3PropSpawn^7: ^2Spawning consumable prop^7.") end
|
||||||
AttachEntityToEntity(attachProp, PlayerPedId(), bone, P1, P2, P3, P4, P5, P6, true, true, false, true, 1, true)
|
attachProp = makeProp({ prop = model, coords = vector4(0.0,0.0,0.0,0.0)}, 1, 1)
|
||||||
if model2 and IsModelValid(model2) == 1 then
|
AttachEntityToEntity(attachProp, PlayerPedId(), bone, P1, P2, P3, P4, P5, P6, true, true, false, true, 1, true)
|
||||||
attachProp2 = makeProp({ prop = model2, coords = vector4(0.0,0.0,0.0,0.0)}, 1, 1)
|
if model2 then
|
||||||
AttachEntityToEntity(attachProp2, PlayerPedId(), bone2, P7, P8, P9, P10, P11, P12, true, true, false, true, 1, true)
|
if IsModelValid(model2) == 1 then
|
||||||
else print("^5Debug^7: ^3Consume^7: ^2Second prop model isn't valid/found^7.") end
|
attachProp2 = makeProp({ prop = model2, coords = vector4(0.0,0.0,0.0,0.0)}, 1, 1)
|
||||||
while consuming do Wait(50) end
|
AttachEntityToEntity(attachProp2, PlayerPedId(), bone2, P7, P8, P9, P10, P11, P12, true, true, false, true, 1, true)
|
||||||
if DoesEntityExist(attachProp) then destroyProp(attachProp) attachProp = nil end
|
else print("^5Debug^7: ^3PropSpawn^7: ^2Second prop model isn't valid/found^7.") end
|
||||||
if DoesEntityExist(attachProp2) then destroyProp(attachProp2) attackProp = nil end
|
end
|
||||||
else print("^5Debug^7: ^3PropSpawnstop^7: ^2Prop model isn't valid/found^7.") end
|
while consuming do Wait(50) end
|
||||||
|
if DoesEntityExist(attachProp) then destroyProp(attachProp) attachProp = nil end
|
||||||
|
if DoesEntityExist(attachProp2) then destroyProp(attachProp2) attachProp2 = nil end
|
||||||
|
else print("^5Debug^7: ^3PropSpawn^7: ^2Prop model isn't valid/found^7.") end
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
while consuming do
|
while consuming do
|
||||||
if time <= 0 then consuming = false end
|
if time <= 0 then consuming = false end
|
||||||
|
|||||||
Reference in New Issue
Block a user