Problem with vehshare.ytd

Any word or fixes on this?

Vehshare.ytd still doesn’t work.
February 27, 2020.

ok, so?

why are you assuming it’s meant to ‘work’?

due to how the game loads this txd early on, it can’t be overridden per-server as that’d break server disconnection etc.

try ADD_REPLACE_TEXTURE if you want to replace specific textures from such a txd.

4 Likes

@d-bubble
Thank you very much. I was able to replace almost anything to the plate using ADD_REPLACE_TEXTURE.
Just to see the possibilities, I`ve replaced the default texture with a .mp4 video from the Internet and it worked. It played the sound too.

1 Like

Where do you go to put that?

@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

hey, is it possible for you to make a video on this subject, i can’t figure out your format for some reason, and where would i put this?

So I edited your code and it showed up @oaojmiguel

@TheKittenGamerYT copy the code into a client.lua and change the LINKTOIMG.png to your image link

I would make your plate image 1200px x 700px or something around that

I used https://imgbb.com/upload to upload my image.

I bet there is a easier way to do this but it works anyways.

I use this coding for adding image to only 1 plate:

local txd = CreateRuntimeTxd('duiTxd')
    for i = 1, 10 do
        local duiObj = CreateDui('LINKTOIMG.png' .. 'plate04' .. '.png', 540, 300)
        _G.duiObj = duiObj
        local dui = GetDuiHandle(duiObj)
        local tx = CreateRuntimeTextureFromDuiHandle(txd, 'duiTex', dui)
        AddReplaceTexture('vehshare', 'plate04', 'duiTxd', 'duiTex')
    end

-----------------------------------------------------------------------------------------------------------------------
-- Make sure to add the _n one too!

local txd = CreateRuntimeTxd('duiTxd')
    for i = 1, 10 do
        local duiObj = CreateDui('LINKTOIMG.png' .. 'plate04_n' .. '.png', 540, 300)
        _G.duiObj = duiObj
        local dui = GetDuiHandle(duiObj)
        local tx = CreateRuntimeTextureFromDuiHandle(txd, 'duiTex', dui)
        AddReplaceTexture('vehshare', 'plate04_n', 'duiTxd', 'duiTex')
    end
3 Likes

Any Help?

@eliavm55
Looks to be your image link. Try using https://imgbb.com/upload for your plate upload and make sure its a .PNG

I never saw the plate numbers disappear. But sometimes it shows on your screen when you join. There is really nothing I can do about it. Its a bug

1 Like

Do you have a license key with a patreon tier? that is maybe what it works for you and not for everyone else… Just like the clothing stream

this doesn’t work

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',
        'yankton_plate',
        'yankton_plate_n'
    }

    -- Plate
    
    for i = 1, 10 do
        local duiObj = CreateDui('https://i.ibb.co/g7Mr88k/plate01.png' .. 'plate01' .. '.png', 540, 300)
        _G.duiObj = duiObj
        local dui = GetDuiHandle(duiObj)
        local tx = CreateRuntimeTextureFromDuiHandle(txd, 'duiTex', dui)
        AddReplaceTexture('vehshare', 'plate01', 'duiTxd', 'duiTex')
    end
    
    
    for i = 1, 10 do
        local duiObj = CreateDui('https://i.ibb.co/t85VbNW/plate01-n.png' .. 'plate01_n' .. '.png', 540, 300)
        _G.duiObj = duiObj
        local dui = GetDuiHandle(duiObj)
        local tx = CreateRuntimeTextureFromDuiHandle(txd, 'duiTex', dui)
        AddReplaceTexture('vehshare', 'plate01_n', 'duiTxd', 'duiTex')
    end

    
    for i = 1, 10 do
        local duiObj = CreateDui('img/plate02.png' .. 'plate02' .. '.png', 540, 300)
        _G.duiObj = duiObj
        local dui = GetDuiHandle(duiObj)
        local tx = CreateRuntimeTextureFromDuiHandle(txd, 'duiTex', dui)
        AddReplaceTexture('vehshare', 'plate02', 'duiTxd', 'duiTex')
    end

    
    for i = 1, 10 do
        local duiObj = CreateDui('img/plate02_n.png' .. 'plate02_n' .. '.png', 540, 300)
        _G.duiObj = duiObj
        local dui = GetDuiHandle(duiObj)
        local tx = CreateRuntimeTextureFromDuiHandle(txd, 'duiTex', dui)
        AddReplaceTexture('vehshare', 'plate02_n', 'duiTxd', 'duiTex')
    end

   
    for i = 1, 10 do
        local duiObj = CreateDui('img/plate03.png' .. 'plate03' .. '.png', 540, 300)
        _G.duiObj = duiObj
        local dui = GetDuiHandle(duiObj)
        local tx = CreateRuntimeTextureFromDuiHandle(txd, 'duiTex', dui)
        AddReplaceTexture('vehshare', 'plate03', 'duiTxd', 'duiTex')
    end

   
    for i = 1, 10 do
        local duiObj = CreateDui('img/plate03_n.png' .. 'plate03_n' .. '.png', 540, 300)
        _G.duiObj = duiObj
        local dui = GetDuiHandle(duiObj)
        local tx = CreateRuntimeTextureFromDuiHandle(txd, 'duiTex', dui)
        AddReplaceTexture('vehshare', 'plate03_n', 'duiTxd', 'duiTex')
    end
end)

-- [url=https://imgbb.com/][img]https://i.ibb.co/g7Mr88k/plate01.png[/img][/url]
-- [url=https://imgbb.com/][img]https://i.ibb.co/t85VbNW/plate01-n.png[/img][/url]

client script name is customplates.lua

fxmanifest is

fx_version 'bodacious'
game 'gta5'

client_script {
'customplates.lua',
}

Use this code:

local txd = CreateRuntimeTxd('duiTxd')
    for i = 1, 10 do
        local duiObj = CreateDui('https://i.ibb.co/g7Mr88k/plate01.png' .. 'plate01' .. '.png', 540, 300)
       _G.duiObj = duiObj
        local dui = GetDuiHandle(duiObj)
        local tx = CreateRuntimeTextureFromDuiHandle(txd, 'duiTex', dui)
        AddReplaceTexture('vehshare', 'plate01', 'duiTxd', 'duiTex')
    end

-----------------------------------------------------------------------------------------------------------------------
-- Make sure to add the _n one too!

local txd = CreateRuntimeTxd('duiTxd')
    for i = 1, 10 do
        local duiObj = CreateDui(https://i.ibb.co/t85VbNW/plate01-n.png' .. 'plate01_n' .. '.png', 540, 300)
         _G.duiObj = duiObj
        local dui = GetDuiHandle(duiObj)
        local tx = CreateRuntimeTextureFromDuiHandle(txd, 'duiTex', dui)
        AddReplaceTexture('vehshare', 'plate01_n', 'duiTxd', 'duiTex')
    end

For your __resource.lua please use this:

resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'

client_script 'plates.lua'

If you have any questions let me know.

1 Like

Thank you for your reply, do I need to add something like end) after those codes or something before? because just this doesn’t work :frowning: I’m very noob with this specially fivem is kinda tricky sometime

EDIT: Thnak you so much it works, there was just a problem in the code, I fix it by copying your first post!

EDIT2: If I paste multiple code, it gives blue-sweet-moon error to the client while connecting, so if I want to add multiple plate, do I need to make multiple script or I need to change something?

EDIT3: More than 3 plates in the .lua makes the client crash

just learn lua, your code is REALLY bad, why would you loop the addtexture 10 times for every plate

you’re a funny man, I can’t dedicate my time to learn lua, if you can’t help, just don’t say anything, it’s better

at least you gave me a tip that the code is looping 10 times and that’s maybe that, that make the client crash

I’ll go ahead and make you a resource for your plate.

caliplate-adras.rar
I also used new coding. I am not able to run FiveM anytime soon so if you could test it, that would be great!

Coding I Used:

plates = {
{"plate01","https://i.ibb.co/g7Mr88k/plate01.png",370,188},
{"plate01_n","https://i.ibb.co/t85VbNW/plate01-n.png",370,189},
}

for l, p in pairs(plates) do
    local txd = CreateRuntimeTxd("testing")
    local duiObj = CreateDui(p[2], p[3], p[4])
    local dui = GetDuiHandle(duiObj)
    local tx = CreateRuntimeTextureFromDuiHandle(txd, "test", dui)
    AddReplaceTexture("vehshare", p[1], "testing", "test")
end

Thank you it’s also working, I figured to make the previous code working for all plates by removing the loop (thanks to tadehz even if he’s not very polite)
If you need help with something you can ask me

Hello I use your code and it worked and its amazing but I have other problem ;( is there anything I can do to move letter and numbers to right?