gta-rest-in-peace / esx_hifi

Get some music in your party
GNU General Public License v3.0
18 stars 19 forks source link

When i place the hifi in the floor, it doesnt spawn #11

Open AdrianLeal4 opened 3 years ago

AdrianLeal4 commented 3 years ago

I need to fix it. If i have to i paid. Anyone have the script fixed??

bleiker152 commented 3 years ago

Its a fault client event using esx:spawnobject but the new extended does not have it edit event in 33 lane from:

RegisterNetEvent('esx_hifi:place_hifi')
AddEventHandler('esx_hifi:place_hifi', function()
    startAnimation("anim@heists@money_grab@briefcase","put_down_case")
    Citizen.Wait(1000)
    ClearPedTasks(PlayerPedId())
    TriggerEvent('esx:spawnObject', 'prop_boombox_01')
end)

to:


RegisterNetEvent('esx_hifi:place_hifi')
AddEventHandler('esx_hifi:place_hifi', function()
    startAnimation("anim@heists@money_grab@briefcase","put_down_case")
    Citizen.Wait(1000)
    ClearPedTasks(PlayerPedId())

    local ped = GetPlayerPed(-1)
    x, y, z = table.unpack(GetEntityCoords(ped, true))
    ox, oy, oz = table.unpack(GetOffsetFromEntityInWorldCoords(ped, 0.0, 1.0, -2.0))
    boombox = GetHashKey("prop_boombox_01")

    local object = CreateObject(boombox, ox, oy, oz, true, true, false)
    PlaceObjectOnGroundProperly(object)

  --  TriggerEvent('esx:spawnObject', 'prop_boombox_01')
end)