openmultiplayer / open.mp

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

Missed (but important) YSF natives #636

Open NexiusTailer opened 1 year ago

NexiusTailer commented 1 year ago

Speaking about YSF functions, there are also still some of them which could be ported (implemented) in open.mp server by default without any problems or in-script issues with their using.

Vehicle functions:

All they do is just toggle vehActive internal server flag (like vehWasted), pretty simple yet useful.


Removed building function:

Check if the building with a certain model and coords were already removed previously. Useful not to do a double-removing something in a script and thus increase the chances of a client crash when repeating such code many times. Moreover, GetPlayerBuildingsRemoved is already exist in omp server, so this will be an expectable addition.


Object functions:

The difference between this and destroying an object in that it won't free this object slot (ID) for other objects if they created after, and showing an object back will save its ID like it was before hiding. Considered relevant since similar natives for pickup (ShowPickupForPlayer, HidePickupForPlayer and IsPickupHiddenForPlayer) were already ported and exist now.

They were removed from older YSF versions just because of crashes (ha-ha), so now it can be re-implemented natively without any such problems...


Actor functions:

The difference between this and destroying an actor in that it won't free this actor slot (ID) for other actors if they created after, and showing an actor back will save its ID like it was before hiding. Considered relevant since similar natives for pickup (ShowPickupForPlayer, HidePickupForPlayer and IsPickupHiddenForPlayer) were already ported and exist now.

Seems to be pretty useful as well as to be in-line with SetSpawnInfo and SetVehicleSpawnInfo analogues (for player and for vehicles accordingly) which are already exist.


Menu functions:

Good addition for the same getters from the original YSF which were already included in omp server.


RakNet function:

Allow to get the local IP address. In fact, it's able to get all IP address(es) of each network interface since RakNet knows this information and it could be accessed from a script. Useful to get internal and external server IP without bind cfg option or http request.


UPD: Related to #189 but seems it's kinda stale for a long time..

NexiusTailer commented 10 months ago

I think if something is still planned to add from YSF, would be good to consider everything related to it together, so I put a link to #796 as related issue.