altmp / altv-issues

Issues and roadmap for alt:V project
93 stars 17 forks source link

Add possibility to get streamed in entities for player #747

Closed Chris0x closed 3 years ago

Chris0x commented 3 years ago

Suggestion

Add a function/property to get all current streamed in players for a player Use cases

When you want to emit an event but dont want to iterate through all players, this should be the way to go Describe the solution you'd like

I think alt:V already caches somehow these players, so make them available Describe alternatives you've considered

client.EmitInRange(event, args...) Additional context

/

C0kkie commented 3 years ago

Also on clientside it would be usefull to only get players in range

LeonMrBonnie commented 3 years ago

This should just be added to the C++ SDK as a shared method. Because this would be useful on both client- and serverside.

zziger commented 3 years ago

It would be actually nice to have something like alt.Player.streamedIn or alt.Vehicle.streamedIn. It would allow to e.g. render nametags / find nearest player more efficiently

LeonMrBonnie commented 3 years ago

You can use the gameEntityCreate and gameEntityDestroy event to keep track of streamed entities already.

zziger commented 3 years ago

I actually do this rn to render nicknames, but i think this is something that would be nice to have in altv itself

LeonMrBonnie commented 3 years ago

Available as alt.Player.streamedIn etc. on clientside in newest dev