mta-samp-maploader is a MTA resource that reads SA-MP map code in Pawn and loads the map objects and other elements in MTA.
This project uses 2 resources that samp_maploader
requires.
newmodels
from mta-add-modelssampobj_reloaded
from mta-add-models
- Go to the latest mta-add-models release page: link
- Download the following resources (dependencies):
newmodels
sampobj_reloaded
- Download
models.zip
containing all dff/txd/col files required (SA-MP Objects)
- Download
- Go to the latest mta-samp-maploader release page: link
- Download the
samp_maploader
resource - Place the 3 folders you downloaded in your server's resources folder
- Execute command
refresh
in server console to see if all 3 resources are loaded successfully
Here are some changes you could make to the dependencies:
- Remove the test commands from
newmodels
- Disable debug messages in newmodels/_config.lua
- Remove all predefined mods in newmodels/mod_list.lua, newmodels/meta.xml and 'models' folder
- Remove the test commands from
sampobj_reloaded
With this samp_maploader
resource you can load SA-MP maps in the Pawn format. To do this, follow these steps:
-
Place map files in samp_maploader/maps
- Check the list of supported Pawn functions here
- Lines must be a series of function calls, see the existing example Pawn files
-
List map files (name.pwn) in samp_maploader/meta.xml under
<!-- SA-MP Maps -->
- This allows the resource to send these files to the client when they join so the maps can be loaded
-
Place custom model files in samp_maploader/models
- This is required if your map has any
added objects
usingAddSimpleModel
- Must have dot
dff, txd and col
files for each new object - If you don't have a collision file for your model check this tutorial
- This is required if your map has any
-
List custom model files (dff + txd + col) in samp_maploader/meta.xml under
<!-- SA-MP Map Models -->
- This is required if your map has any
added objects
usingAddSimpleModel
- This allows the resource to send these files to the client when they join so the models can be loaded when requested in a map file
- This is required if your map has any
-
Define maps to load in samp_maploader/map_list.lua inside
mapList
- Read the comments to understand how to define your map
-
Use
start samp_maploader
to initiate the resource -
‼️ Important: If you restartnewmodels
, you will also need to restartsamp_maploader
.
- MTA currently limits the amount of objects you can stream within a small radius (memory issue). It's very noticeable when in SA-MP interiors with a lot of objects, e.g. test map #2
There's a tool to generate a .col
file from a given .dff
model. Check out the tutorial here.