Comments (8)
Ooof, looks like I haven't documented the event...
There's an event called livemap:AddBlip
on the server that takes a blip object as it's parameter. This should add a blip to the interface when it's called (as well as adding it to the blips.json file). It's a "static" blip (i.e it won't move like player's blips do) but, sounds like it could be what you're looking for.
The blip object is defined as
A blip follows the format:
{
sprite = Number (required)
pos = Table (required){
x = Float (required)
y = Float (required)
z = Float (required)
}
name = String (optional)
description = String (optional)
}
from live_map.
Hi, thank you for pointing out, but I already discovered that. Except, it's not working :( I tought that it wasn't possible like so.
It's kinda weird. I add a blip like this when a callout is created:
client.lua
-- create a blip object for the live map
local live_map_blip = {
name = "Callout",
description = name,
sprite = 61,
pos = {
x = x,
y = y,
z = 0
}
}
TriggerServerEvent('livemap:AddBlip', live_map_blip)
It's not showing up on the map. When I refresh the blips via the controls menu, the new blip shows up in blips.json, but doesn't appear on the map... See screenshot:
For testing purposes, I haven't generated any other blips.
How are you updating the blips file? When the blip is added, it shows up in my browser console, but not in the actual file on my server? It's only there after stopping the resource lol 😀 Then when starting the resource again, the blip shows up on the map! (after a refresh of course).
I'm confused XD
Also, when switching servers (between local and production), the blips from the old server remain on the map. They disappear after a manual refresh. Will write an issue for that on the interface repo.
EDIT: TGRHavoc/live_map-interface#81
Thank you for your incredible speedy support these days, it really helps :)
BTW, do you have a list of supported sprites?
from live_map.
When the blip is added, it shows up in my browser console, but not in the actual file on my server?
Yeah. If I recall correctly, the blips.json file should only be written to when the resource is stopped.
It should appear on the interface as soon as it's created though.... It might a an issue on the interface, not sure. I'll have to have a look when I get some more free time (just had a bunch of tasks for work come through).
Thanks for the interface issue, must have not implemented the whole "remove all blips when switching servers" logic that I had before the refactor :)
Thank you for your incredible speedy support these days, it really helps :)
And thank you for the detailed bug reports. Some people don't use the template and expect me to work miracles.
As for sprites for the blips:
https://github.com/TGRHavoc/live_map-interface/blob/develop/js/src/markers.js#L8
The "id" is what you're looking for. If a sprite doesn't have an "id" then, just add one (or however many down it is from the last one with an "id").
For example, "Store" has the id of "52".
from live_map.
Switched to adding it in server.lua:
-- create a blip object for the live map
local live_map_blip = {
name = "Callout",
description = name,
sprite = 61,
pos = {
x = coords.x,
y = coords.y,
z = 0
}
}
TriggerEvent('livemap:AddBlip', live_map_blip)
The blips now show after a manual 'refresh blips' in the interface, but is giving me a [WARN] LiveMap Sockets - Blip has no sprite...
from live_map.
As for sprites for the blips:
https://github.com/TGRHavoc/live_map-interface/blob/develop/js/src/markers.js#L8The "id" is what you're looking for. If a sprite doesn't have an "id" then, just add one (or however many down it is from the last one with an "id").
For example, "Store" has the id of "52".
Does that correspond to this?
I'm using 41 in-game (flashing red/blue), but I guess something like that isn't possible ;)
from live_map.
Does that correspond to this?
No, iirc, I got the blip IDs from Scripthook (https://github.com/crosire/scripthookvdotnet/blob/main/source/scripting_v3/GTA/BlipSprite.cs / https://gtamods.com/wiki/Blip_Sprite_IDs) but, removed the ones that I couldn't find on the texture sheet.
I'm using 41 in-game (flashing red/blue), but I guess something like that isn't possible ;)
Not unless you add an icon yourself (a GIF of a blue to red circle) and add the marker yourself using the ID 41 since, it's available.
Tbf, It might be a good idea to make the blips on the interface use the same IDs and images as the ones documented on FiveM... I guess I would need to write a script to scrape the icons and the IDs because fuck writing that out by hand
from live_map.
local live_map_blip = { name = "Callout", description = name, sprite = 61, pos = { x = coords.x, y = coords.y, z = 0 } } TriggerEvent('livemap:AddBlip', live_map_blip)
Very late comment, but did you get it working? Its seems that the blip gets written directly to the blips.json. Server console is just responding with "[WARN] LiveMap Sockets - Blip has no sprite...". Indeed, when you refresh the webpage it reloads the blips.json and therefore seems to display the blip.
from live_map.
I've just removed the validBlip from the livemap.js in the FiveM resource. Browser now gives a error: https://i.imgur.com/kgXjhaS.jpeg
The code i'm using:
`
local pos = GetEntityCoords(PlayerPedId(), not IsPlayerDead(PlayerId()))
local live_map_blip = {
name = "Callout",
description = "test1",
sprite = 50,
pos = {
x = pos.x,
y = pos.y,
z = pos.z
}
}
TriggerServerEvent('livemap:AddBlip', live_map_blip)`
from live_map.
Related Issues (20)
- Access denied for command blips. HOT 1
- Error with starting the resource HOT 5
- Player not getting tracked after removing and triggering "livemap:AddPlayerData" HOT 3
- [question]: convert lat & lng back to GTA map coords HOT 4
- [question]: how to convert lng & lat to x, y ,z HOT 2
- Question HOT 4
- Having a error with loading the map ((((Error getting blips! Maybe the server is down or, the config is setup incorrectly.)))) HOT 6
- Question (not urgent, also sorry for all the questions recently) HOT 7
- License Plate doesn't get removed from data HOT 7
- Documentation
- Location on livemap is somewhat off HOT 1
- High resource usage HOT 8
- Live map not found as a resource. HOT 2
- Bug: 'localhost' = 200, '127.0.0.1' = 404 HOT 21
- Nucleus proxy not functioning HOT 7
- So i have set up everything to run this with snaily cad system v4 and it still refuses to connect here are my settings below along with some pictures HOT 1
- Issue with the websockets HOT 1
- Reverse hashing not working HOT 3
- Not seems to work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from live_map.