mirror of
https://github.com/jimathy/jim-consumables.git
synced 2026-08-16 22:16:02 +01:00
Try to fix props now spawning correctly
Not sure what is going on, they are server synced but Its possible its not loading the correctly because of the spawn location I've changed it to make the props at the players location in hopes this fixes the issue
This commit is contained in:
@@ -72,6 +72,7 @@ RegisterNetEvent(getScript()..':Consume', function(itemName)
|
||||
debugPrint("^5Debug^7: ^3Consume^7: ^2Starting event, locking inventory and grabbing data^7..")
|
||||
tempLockInv(true)
|
||||
local Player = PlayerPedId()
|
||||
local pedCoords = GetEntityCoords(Player)
|
||||
local emote = Emotes[consumable.emote] or Emotes["crisps"]
|
||||
if isAnimal then --- Animal ped adjustments
|
||||
local presets = {
|
||||
@@ -232,11 +233,11 @@ RegisterNetEvent(getScript()..':Consume', function(itemName)
|
||||
if model then
|
||||
if IsModelValid(model) == 1 then
|
||||
debugPrint("^5Debug^7: ^3PropSpawn^7: ^2Spawning consumable prop^7...")
|
||||
attachProp = makeProp({ prop = model, coords = vector4(0.0,0.0,0.0,0.0)}, 1, 1)
|
||||
attachProp = makeProp({ prop = model, coords = vec4(pedCoords.x, pedCoords.y, pedCoords.z, 0.0)}, 1, 1)
|
||||
AttachEntityToEntity(attachProp, Player, bone, P1, P2, P3, P4, P5, P6, true, true, false, true, 1, true)
|
||||
if model2 then
|
||||
if IsModelValid(model2) == 1 then
|
||||
attachProp2 = makeProp({ prop = model2, coords = vector4(0.0,0.0,0.0,0.0)}, 1, 1)
|
||||
attachProp2 = makeProp({ prop = model2, coords = vec4(pedCoords.x, pedCoords.y, pedCoords.z, 0.0)}, 1, 1)
|
||||
AttachEntityToEntity(attachProp2, Player, bone2, P7, P8, P9, P10, P11, P12, true, true, false, true, 1, true)
|
||||
else
|
||||
print("^5Debug^7: ^3PropSpawn^7: ^2Second prop model isn't valid/found^7.")
|
||||
|
||||
Reference in New Issue
Block a user