altv-issues
altv-issues copied to clipboard
Change Blip Color not working
Description of the problem
If you create a blip and change the color, it will only refreshed on the legend, not on the map.
Reproduction steps
Create Blip on onStart() (values from database): ... var tBlip = Alt.CreateBlip(BlipType.Pickup, new Position(blip.PosX, blip.PosY, 0)); tBlip.Color = blip.Color; tBlip.Alpha = blip.Alpha; tBlip.Name = blip.Name; tBlip.ScaleXY = new Vector2(blip.ScaleX, blip.ScaleY); tBlip.ShortRange = true; tBlip.Sprite = blip.Sprite; ...
Somewhere else: await AltAsync.Do(() => { var blip = Alt.GetAllBlips().FirstOrDefault(t => t.Name.Equals(fraktion.Blip.Name)); if (blip == null) return;
blip.Color = color;
});
Expected behaviour
It should also refresh the icon on the map
Additional context
No response
Operating system
Debian
Version
release
its refreshing if i call the method with the change twice
Confirmed on 13.0-dev42
clientside code for testing:
const blip = new alt.PointBlip(0, 0, 0);
blip.name = "test";
new alt.Utils.Keybind(18 /** alt key */, () => {
// blip color visually changes only after reopening pause menu map or minimap
blip.color = Math.floor(Math.random() * 20);
// blip color visually changes immediately
// native.setBlipColour(blip.scriptID, Math.floor(Math.random() * 20));
});
Can confirm this also happens on alt.RadiusBlip and alt.AreaBlip.
Easiest fix right now is to simply delete and re-create the blip..
@CoffeeGen you can change color with native, see my comment above yours
alpha setter is also broken. natives do work
@Zynischer @QuiGonJinnAndTonic test on newest dev please
@xxshady is this still a thing?
yes
I can provide more information, entering in pause menu refresh the color, removing the blip from the minimap when the blip is short range refresh the color and hiding an showing the hud also does (Related to pause menu).