Question about decals (AddDecals and weapon impact decals)

Hi,
has anyone ever managed to get the AddDecal Native to work?

I’ve been trying everything, but for some reason, no decals are showing up.
However, when I check with the IsDecalAlive Native, it returns true.

  createdDecals[indexNumber] = AddDecal(1030, coords.x, coords.y, coords.z, normalVector.x, normalVector.y, normalVector.z, radius, red, green, blue, alpha, 5000, true, true, true)
        print(createdDecals[indexNumber], "createdDecals[indexNumber]")
        print(IsDecalAlive(createdDecals[indexNumber]))

Another question where you could also help me. Is it possible to change the decal that appears on impact for an add-on weapon? For example, if I want a pistol to have the same effect as a snowball when it hits a wall or a vehicle. Can this be changed somewhere in the weapons.meta file?

Unfortunately, I can’t seem to find much information on this when googling.

RegisterCommand (‘decal’, function (src, arg, rawInput)
local decalType = tonumber (arg) or 1010
local targetedCoord = GetOffsetFromEntityInWorldCoords (PlayerPedId (), 0.0, 1.0, -1.0)
decal = AddDecal (
1110,
targetedCoord.x, targetedCoord.y, targetedCoord.z, – posizione
0.0, 0.0, -1.0, – direzione
0, 1, 0, – sconosciuto
4.0, 4.0, – larghezza, altezza
255, 0.1, 0.1, 1.0, 150.0, false, false, false
)
end)

this draw something

1 Like

Thank you for your answer! At least it draws something.
Sadly it is always as big as the face you are creating it on, no matter how small you set the width and height.
:person_shrugging:

RegisterCommand('decal', function (src, arg, rawInput)
    local decalType = tonumber(arg[1])
    if decalType == nil then decalType = 1020 end
    local targetedCoord = GetEntityCoords(PlayerPedId())
    testdecal = AddDecal(decalType,
    targetedCoord.x, targetedCoord.y, targetedCoord.z-1.0, --position
    0.0, 0.0, -0.301, --direction
    0, 0, 0, --unknown
    0.1, 0.1, --width height
    1.0, 0.0, 0.0, 110.0, 150.0, false, false, false)
    Citizen.Wait(1000)
    print('Is decal alive', IsDecalAlive(testdecal))
    Citizen.Wait(1000)
    RemoveDecalsInRange(targetedCoord, 1.0)
    Citizen.Wait(100)
    print('Is decal alive', IsDecalAlive(testdecal))
end)

Couldnt get it to work either.
Really horrible to work with shit that isn’t even outputting anything.

It works, thank you so much! Now my players can vomit :face_vomiting:

what dir?