kasuganosoras / hologramspeed

🔢 FiveM hologram speedometer
GNU General Public License v3.0
67 stars 39 forks source link

Fix bug car shop (possibly fixes other bugs, but it is not proven.) #12

Closed matahombres closed 3 years ago

matahombres commented 3 years ago

How to test this bug:

  1. Go to the esx default car store.
  2. Choose a car and before it finishes starting change car.
  3. And... Tachaaan, hologramspeed disappears.

Because it happens:

What causes:

PD: As I said in the title, it possibly fixes other bugs, but I haven't looked any more if there is one that is caused because of that

kasuganosoras commented 3 years ago

Thanks : )

matahombres commented 2 years ago

Oh sorry, i made it so that different positions could be added for different vehicles. I did not notice that detail. As it is not complete and there are still some things to be modified I have not added it. But is my code:

function getAttachmentByVeh(currentVehicle)
    local vc = GetVehicleClass(currentVehicle)
    if(vc == 8 or vc == 13) then
        return vec3(1.5, -0.5, 0.85)
    end
    if(vc == 10 or vc == 20) then
        return vec3(2.5, 1.5, 2.5)
    end
    if(vc == 16) then
        return vec3(2.5, 1.5, 1.5)
    end
    if(vc == 15) then
        return vec3(2.5, 1, 1.5)
    end
    if(vc == 14) then
        return vec3(2.5, 0, 2)
    end
    return vec3(2.5, -1, 0.85)
end

Adds support for motorcycles and bicycles, but I didn't like it on trucks for example. Since for example in the emergency category there are suvs and there are trucks.

@kasuganosoras