Does this type of player blip system exist?

Hi there everyone!

I was talking with a friend last night and as we often do, we couldn’t agree on the player blips because he would like our server to be RP and I would rather it be retail-like. The resource we talked about last night was the player blips.

In retail, you could see where players were on the map. This allowed you to find your friends, congregate and have fun together. As my friend pointed out, it also allowed players to grief others on the map. Also it != RP.

So I got to thinking. What about a configurable player blip system. One in which the server owner can configure to default off or on when players enter and players could choose both to see others and hide themselves. I think this would make most people happy.

Does such a system exist? If not, does a standard blip resource exist that I could try to build off of?

Thanks for your time and thoughts!

making blips isn’t that difficult to do, and having it on/off based on a permission or server side configuration isn’t hard either, what becomes more tricky though is having certain players hidden and others be visible. Though even that is fairly simple, so to make it harder: have some players be hidden/visible for some players only. Now sync that across the server and you get a complete mess to have to sync/organize.

So yes, it is possible to do what you want, but it’s not going to be easy to do this because pretty much everything needs to run by the server and have it synced based on some configuration. Also, quick toggling of blips will probably cause problems if everyone starts doing it and cause massive sync problems, so you might want to make a good “config” sync system first, then apply that to your blips.

Hi there Vespura and thanks very much for the help!

I understand what you’re saying, I think. I need to build the core Allow/disallow system before having it deal with the blip system at all.

Can you think of a simple resource off the top of your head that works in this way(allowing user on/off with memory) that I could look at and take apart? I’ve gone down the list on my servers but all either don’t deal with it or are so complex that I have an issue finding the relevant code.

It’s not that I’m trying to be lazy, I’m just brand new to both lua and fivem underhood and something like that will help me understand how it works.

While I don’t have the exact use case, I have blips appear for squads and also for specific jobs (police see wanted players, EMS see dead players, etc).

I started with Scammers blip/player head indicator script that can be found here: [Release] Scammer's Script Collection (09/03/17)

I made a thread for each case. While true, and then a quick if statement for if blips should be enabled or not, and then iterate each player and add the blip. It was actually pretty straightforward.

1 Like

which is easy if you’re just looping through 1 (specific) list of players to enable/disable, or having a “global” on/off thing for a specific client, but varying on/off states per player for specific clients will get tricky.

Thanks very much for that link, Salty. Unfortunately, that resource doesn’t add the player’s corresponding username or ID to the map legend, so you’re flying almost as blind when looking at the map as you were without blips in the first place.

Or perhaps that behavior is just on my end?

make a decor for the player ped’s visibility, check before adding/removing a blip if that decor isn’t set.

That’d still make that player visible/invisible to all players. what if you wanted player 1 to see player 2 and 3, but you only wanted player 2 to see player 1 and not player 3. Then decors would become less useful.

Though if you want a “global” visible/invisible variable for each player then yes decors would be the way to go.

see others: enable allowed blips locally
hide themselves: set ‘hidemepls’ decor

Ok guys, am I right with the following logic?

  1. User config to show other blips: Can either store this locally like in a flatfile or in a database.

  2. user config to hide themselves: Must be stored server side so it can be retrieved by other clients

If this is correct, I need to learn both how to store something both clientside and serverside. For something like this(not getting written to often), can someone provide argument for the best method of handling this(file vs db)?

As was suggested by Vespura, I am pretty sure I need to figure out this aspect before I figure out the actual blip implementation.

I would (read: did) approach this by storing an array (or table because Lua sigh) server side of all of the player IDs that DO want to be displayed. Then the client gets the array sent to them, and iterates all players and compares the player’s ID to the array and if it exists, it displays it.

Anytime someone joins, leave, or toggles display, update the array on the server side and trigger an event on all clients that sends the new, updated array.

Let me know if that does or doesn’t make sense. I’d be happy to hear a more efficient way, too, but this seemed relatively straightforward.

Note: Admittedly, I never messed with decors that @strontium mentioned. They may work better.

I’d personally avoid using decors, there is a limit to how many of them you can have and from what I’ve read on the CFX discord they may not be supported by future versions of Infinity