kibook / pmms

Synchronized media player for FiveM and RedM
136 stars 57 forks source link

fix: `attempt to index a nil value (field 'options')` #93

Open Z3rio opened 3 months ago

Z3rio commented 3 months ago

This PR resolves issue: #71

image

Recreation

You can recreate this error by running the following code on your server-side:

local src = source
local ped = GetPlayerPed(src)

if ped then
    exports.pmms:startByNetworkId(NetworkGetNetworkIdFromEntity(ped), {
        url = "SOME URL",
        duration = 3,
        range = 5
    })
end

Solution

This is solved via actually passing down the options to the pmms:play event and sendMediaMessage function.