openmultiplayer / open.mp

Open Multiplayer, a multiplayer mod fully backwards compatible with SA-MP
https://open.mp
Mozilla Public License 2.0
423 stars 78 forks source link

IsObjectStreamedIn #885

Closed NexiusTailer closed 4 months ago

NexiusTailer commented 4 months ago

There are new natives like IsPickupStreamedIn, IsActorStreamedIn or Is3DTextLabelStreamedIn which is great, but there is still no IsObjectStreamedIn which also might be very useful, so I suggest adding it as well.

Also, please consider this (stale) issue, as every suggested function there fits well to be ported from YSF into omp server (and for some reason have not yet been added in it along with the others).

AmyrAhmady commented 4 months ago

How does IsObjectStreamedIn even work?

NexiusTailer commented 4 months ago

It can be done just like any other similar native, for example, IsVehicleStreamedIn(vehicleid, forplayerid) where forplayerid is the player who streams in or not streams in this vehicle/object.

AmyrAhmady commented 4 months ago

vehicles stream, so do actors, textlabels, and pickups how do you determine an object is streamed or not when there's no streaming for objects? Even for attaching to players/vehicles that stream in, we only send attach RPC

All objects are created when player is connected (or player objects that get created on server and immediately get created for player) And they're are all deleted when you destroy them or player leaves. There's no "streaming" unlike others

NexiusTailer commented 4 months ago

Oh, seems it completely went out of my head that DrawDistance parameter is not about serverside stream but just a clientside render distance, sorry. I initially checked CreateObject native and remembered about this param, so... anyway, thank you for clarifying it for any others who maybe wanna do the same issue in future but find this lol