Problem with vehshare.ytd

@Wacker-8 @Micka67 @aciducen1995

Thanks for asking me for help. Here is what I did.

AddEventHandler('playerLoggedIn', function()
    print("TXD Placa Mercosul")
    local txd = CreateRuntimeTxd('duiTxd')

    -- Plates
    plates = {
        'plate01',
        'plate02',
        'plate03',
        'plate04',
        'plate05',
        'plate01_n',
        'plate02_n',
        'plate03_n',
        'plate04_n',
        'plate05_n'
    }

    -- Plate
    for i = 1, 10 do
        local duiObj = CreateDui('https://www.linktoyourwebsite.com/fivem/' .. plates[i] .. '.png', 540, 300)
        _G.duiObj = duiObj
        local dui = GetDuiHandle(duiObj)
        local tx = CreateRuntimeTextureFromDuiHandle(txd, 'duiTex', dui)
        AddReplaceTexture('vehshare', plates[i], 'duiTxd', 'duiTex')
    end
end)

For the initial test, I changed the default plate ‘plate01’ to a .png and a .mp4. For the video, it played one time only but with sound.

This is just a simple script. It have some bugs. :bug: For a low percentage of connections, the full plate is displayed in the entire screen of the player. Maybe I need to use another event instead of ‘playerLoggedIn’.

4 Likes