open.mp
open.mp copied to clipboard
Missed (but important) YSF natives
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:
- HideVehicle, ShowVehicle, IsVehicleHidden
All they do is just toggle vehActive internal server flag (like vehWasted), pretty simple yet useful.
Removed building function:
- IsBuildingRemovedForPlayer
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:
- HideObjectForPlayer, ShowObjectForPlayer, IsObjectHiddenForPlayer
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.
- IsPlayerEditingObject, IsPlayerEditingAttachedObject
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:
- HideActorForPlayer, ShowActorForPlayer, IsActorHiddenForPlayer
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.
Menu functions:
- GetTotalMenus (or CountTotalMenus / GetMenuCount)
- SetMenuItem, SetMenuPos, SetMenuWidth, SetMenuTitle
Good addition for the same getters from the original YSF which were already included in omp server.
RakNet function:
- GetLocalIP
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..
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.