Put the EmergencyBlips folder into your server’s resources folder.
Add start EmergencyBlips to your server’s server.cfg file.
Usage
Use TriggerEvent(“eblips:add”, {name = “Jane Doe”, src = 123, color = 1}) when you want to make a person show up on the map for other people who have also been made to show on the map. Usually you would call this event when the player goes on duty for the job.
Use TriggerEvent(“eblips:remove”, serverID) when you want to stop a person who is showing up on the map from showing on the map. Usually you would call this event when the player goes off duty for the job.
For eblips:add: name is the text that shows on the map when a blip is selected, src should be the player’s server ID, and color is the blip color.
This script now supports infinity mode! See the download link above!
P.S. this is a developer resource and does nothing by itself, you must use the above two events for the blips to work. Oh, and feel free to offer feedback, suggestions, or even contribute via the repository!
For blips to show, you need to find the script that handles when players go on and off duty as police/EMS/whatever else job you want blips to show for and then modify it to use the two events mentioned in the description for showing and hiding the blips as necessary when the player goes on and off duty, respectively.
It’s meant for script developers to use, but if you are able to find the script that makes players go on duty for the job you want blips for then all you need to do is find where it makes them go on duty (in the server file) and then add the line TriggerEvent(“eblips:add”, {name = “Blip Name Here”, src = serverID, color = 1}) then just change Blip Name Here to whatever you want the map to show when the blip is selected and change serverID to be the server ID of the player you want to show. Removing the blip is very similar – even easier actually but pretty much the same idea. That’s all I can really say without actually doing it for you unfortunately!
@DesertFade Judging by the error I believe you are giving src a bad value. It needs to be a number and it needs to be a player’s server ID. Make sure your source is actually the correct value.
That error is saying it failed to get the player from the provided server ID essentially.
@DesertFade Are you sure it is a number and not a string? You can use type(source) to see its type. If it’s a string try converting it to number by using tonumber(source).
Also, maybe try changing the name from being set to source to using some other string value like "Test" even though I don’t think that would be the issue.
And are you sure this is being called from a server sided script?
Here is an example of one of my resources using it and it works just fine: TriggerEvent("eblips:add", {name = "Taylor Weitman", src = userSource, color = 3}) where userSource is the player’s server ID as a number.