Repository navigation
Parser
- The parser has been updated to use the open.mp libraries. SA-MP libraries are no longer supported.
- Added
OnMapBeginLoading. This callback executes before the first object in a map has been created. - Added
SkipCurrentlyLoadingMap. This function can be used to skip a map that's currently being loaded. It can be used in combination withOnMapBeginLoadingto give better control over what maps are fully loaded on server startup. - Added
IsMapParserRunning. This function simply returns whether or not theProcessMapsfunction is currently running and attempting to load all server maps. - The
RemoveBuildingForPlayersafeguard has been removed to (hopefully) encourage wider adoption of the open.mp client mod, which fixes the crashing that can occur when lots of buildings are removed. - Fixed memory leaks when unloading maps by reworking how map data is stored.
- Lists containing
RemoveBuildingForPlayerdata will now only persist in memory when a map actually removes buildings instead of every loaded map keeping an empty list in memory for no reason. - Removed some unneeded utility functions.
Here's an example on how you can use OnMapBeginLoading and SkipCurrentlyLoadingMap to skip unnecessary processing of certain map types.
public OnMapBeginLoading(mapid, const mapname[], firstobjectworldid)
{
// map being loaded is a business map. (uses a unique virtual world range for ONLY businesses)
if(IsMapParserRunning() && IsBusinessWorldID(firstobjectworldid))
{
new businessid = firstobjectworldid - BIZZ_WORLD_OFFSET;
if(IsValidBusiness(businessid))
{
// store the map name for later so we can load the map when a player enters the respective business
format(BusinessData[businessid][BusinessMap], MAX_MAP_NAME, mapname);
// skip the processing of the map
SkipCurrentlyLoadingMap();
}
}
}Converter
- The map converter has been completely rewritten from the ground up, courtesy of @mysy00. Refer to the readme for its updated documentation.