Ok since the wiki seems to be down, I thought I’d answer a few questions about how to autoload server maps and how to select the spawn points.
First you need a working server map probably downloaded from here:
GTA5-Mods.com Map Section
Most of these maps were created for the original fivem, some things have changed since then. Most of these maps were initially made to be loaded through a trainer client side, which is becoming more difficult to accomplish, and ineffectual to multiplayer anyways.
There are three streaming tutorials on here already so I will only quickly go over what needs to be done, but am willing to answer questions so long as I am working with this project.
Take the map gokart from gta5-mods. When you extract the map to resources folder of your server you will have 1 folder and 4 files in the gokart directory: \resources\gokart\
images <–(folder)
gokart.json
gokart.meta
images.meta
water.xml
you need to create a new text file: __resources.lua <-(note the two underscores in front of it)
in this file I’ll highlight in bold what differs to allow map to autoload:
resource_type ‘map’ { gameTypes = { fivem = true } }
map 'map.lua’
replace_level_meta ‘gokart’
files {
‘gokart.meta’,
‘gokart.json’,
‘images.meta’,
‘water.xml’
}
That will allow the map to autoload but we need to fix a path in the gokart.meta:
In order to load the maps clientside they required a path usermaps:/
For serverside it needs to be resources:/
so open up gokart.meta and find and replace all occurences of usermaps (with) resources .
do the same thing in images.meta.
Also the game engine now loads data from the stream folder instead of the images folder, so rename the folder in gokart images (with) stream
You’ll need to edit all the meta files path from images to stream in the same areas usermaps would have been in originally usually:
for example the last item of images.meta:
<Item>
<filename>usermaps:/gokart/images/v.rpf</filename>
<contents>CONTENTS_MAP</contents>
<fileType>RPF_FILE</fileType>
<installPartition>PARTITION_2</installPartition>
</Item>
becomes
<Item>
<filename>resources:/gokart/stream/v.rpf</filename>
<contents>CONTENTS_MAP</contents>
<fileType>RPF_FILE</fileType>
<installPartition>PARTITION_2</installPartition>
</Item>
Once you’ve done this you relaunch your server after deleting its cache directory of course:
Then when it loads the map will be autoloaded, great exceapt you fall into an ocean of nothing. cause the spawn points aren’t here:
to create spawnpoints we need to create a new text file map.lua in the gokart directory:
it contains this:
spawnpoint ‘a_m_y_skater_01’ { x = 2665, y = -395, z = 35 }
spawnpoint ‘a_m_y_skater_02’ { x = 2665, y = -395, z = 35 }
–
I’ve already mapped out the spawnpoint for you to start at the finish lane of the map. But how do I get the spawn points of the map, you ask?
If you remember math, x is horizontal space y is vertical space and z is elevated space (how high you are).
To find out where to place a spawn point. Open up the gokart.json file, this is the list of every object in the map, find an item that lists a “position” variable, a lot of this is trial and error: for example:
I found an item here:
{
"position": [
2668.209,
-453.8654,
41.495
],
"rotation": [
0.0,
0.0,
0.0,
1.0
],
"guid": "d5ad2b6c-dd19-4a36-b928-bf6672c20036",
"archetypeName": "hash:1000935171"
},
2668 is x -453 is y and 42 is how high it is
so back in my map.lua I would put something like:
spawnpoint ‘a_m_y_skater_01’ { x = 2670, y = -455, z = 45 }
spawnpoint ‘a_m_y_skater_02’ { x = 2670, y = -455, z = 45 }
–
The z is kinda important especially on maps with mountains and hills, as you don’t want to start under the mountain or way to high with a parachute (unless you want to).
clear your cache make sure your mod is loaded of course: in the citmp-server.yml under AutostartResources: -gokart
This works well for small maps with low texture resolution. In theory it works for huge maps too, but you’ll likely get the dreaded zlib error verify game cache, as textures bigger the 1024 will hang the client (dunno if they are going to fix that), or possibly even some other random error message as the bigger the map the bigger the chances some complex thing will go wrong.
Any questions, let me know? I’ve got some maps i’m still trying to get to work myself but this is the basics so far.