[Release] EmergencyBlips

Emergency Blips

Looking for a script to add blips on the map for only certain players – like police, or EMS for example? Look no further!

This is meant for script developers to use!

Screenshot

blip on map

(An example of a player blip that shows for only certain specified players)

Features

  • Works for any framework (as well as no framework, of course)
  • Easy API

Installation

  • Download
  • Or visit the repo here
  • 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.

  • Both events are server events.

  • See this link for blip color codes (at bottom).

Notes

  • 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!

35 Likes

Great job, ty

1 Like

Works with ESX?

@Mart475 It should work, yes! I haven’t actually tried myself because I don’t use ESX but I don’t see a reason for it not to work!

2 Likes

How would i set it up for ESX? Does it work out of the box?

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.

I don’t know how to code a single bit, i only know how to edit it. So i probably won’t do it. :frowning:

Nice release!

1 Like

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!

Oh, ok. Sorry for my 1 brain cell brain.

Do i need to call the Event every frame? I don’t think so since there’s a remove event too. ?

greetings

Awesome stuff minipunch. Thanks for sharing. :+1:

1 Like

@DesertFade No. These are both server events and you only trigger eblips:add once as well as trigger eblips:remove once.

Oh, okay, thanks. Will use your resource, thanks for sharing!

1 Like

No problem! Let me know if you have any issues with it or questions!

Heyo, got that error:

after using this snippet in my server script:

not sure if it is my mistake or your script.

@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.

I’ve put out the value of source, and it’s the number 4 (after rejoining number 5, so server id working lol), so it should be right, shouldn’t it?

@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.

where do you define userSource from in your example?

Need to test it with a friend later, no ones online at the moment to test the blips with me unfortunate.