SA-MP mapping guide
How to make a map for your SA-MP or open.mp server, from the first object to the code you paste into your gamemode. Written by the mappers of Unity Roleplay.
Mapping in SA-MP means placing objects in the world of GTA San Andreas, changing their textures and removing the game's own buildings where you need room. The result is Pawn code, a list of CreateObject or CreateDynamicObject lines, that your server runs when it starts. This guide uses MapTogether, our free SA-MP map editor, but most of it works the same in any editor.
What you need
- GTA San Andreas for PC (version 1.0, the one SA-MP runs on).
- The SA-MP 0.3.7 or open.mp client, so the editor can show SA-MP's own objects (ids 18631 and up).
- A map editor. MapTogether runs on Windows 10 and 11 and on Android, and it's free.
- For streamed maps, the streamer plugin on your server.
1. Open your GTA folder
Start MapTogether and pick the folder GTA San Andreas is installed in. The editor reads the game where it is and never changes it. The whole map loads with its buildings, interiors and water, so you map in the same world players will see.
2. Find the objects you want
Press O for the Objects panel. Every model has a picture, and you can search by id, by name or by the textures it uses. A few ids worth knowing:
- 19353 to 19463: SA-MP's plain walls, doorways and windows. Most interiors are built from these.
- 19375 to 19382: big 9.64 x 10.5 panels that make good floors and ceilings.
- 18631 and up: everything SA-MP added: furniture, signs, lights, roads, food and more.
3. Place and move them
Click an object in the panel, then click in the world to drop it. Hold Shift to keep placing copies. Select it and use the arrows to move it (W) or the rings to turn it (E). Useful keys:
- End drops the selection onto whatever is under it.
- G turns grid snapping on, so walls line up exactly.
- V snaps corners and edges onto the objects next to it.
- Ctrl+D duplicates, Z turns 90 degrees, PageUp/PageDown move up and down.
Two surfaces in exactly the same spot flicker in game (z-fighting). Move one of them by a few millimetres, 0.005 is enough.
4. Change textures and add text
Every SA-MP object has material slots (0 to 15). In the game, SetObjectMaterial swaps the texture on one slot for any texture from the game, and SetObjectMaterialText writes text on it. In MapTogether you click a part of the object and pick the new texture from the texture browser, or type the text with its font, size and colours. The export writes the SetObjectMaterial and SetObjectMaterialText lines for you.
5. Remove buildings
To build where the game already has something, remove it with RemoveBuildingForPlayer. Press R and click the building. Its low detail copy (LOD) goes with it, otherwise you'd still see it from far away. These lines have to run in OnPlayerConnect, because the removal happens on each player's game, not on the server.
6. Interiors and virtual worlds
Most custom interiors are built high in the sky or far out at sea, where nothing else is, and players get there through a teleport. Give the objects an interior id and a virtual world so they only show for players who are inside. In MapTogether you set these for the whole map under View, Map defaults, or per object in the inspector.
7. Test it in game
On Windows, press the test button. MapTogether starts a small open.mp server on your PC with your map in it and opens the game for you, so you can walk through it before anyone else does. Changes you make in the editor show up in game.
8. Export the code
Press Ctrl+E. You get two choices:
- CreateDynamicObject (streamer plugin). The right choice for almost every map: the plugin only sends players the objects near them, so maps can have thousands of objects.
- CreateObject. No plugin needed, but every object counts toward the SA-MP object limit for every player, so it only suits small maps.
Paste the object lines into OnGameModeInit (or OnFilterScriptInit if the map is a filterscript) and the RemoveBuildingForPlayer lines into OnPlayerConnect.
Bringing in old maps
You don't have to start again. MapTogether opens Pawn code from any editor, Texture Studio maps (the .db files from scriptfiles/tstudio) and MTA .map files. Open the file or paste the code with Ctrl+I.
Mapping with AI
If you'd rather describe a map than place every chair, link your own Claude account in MapTogether (the free plan works) and ask it for "a small bar with a pool table and a back office". It places real SA-MP objects in front of you, and you can change anything it did. It's good for getting a room started quickly. You still need to check the details.
Questions
How do I make a map in SA-MP?
Open a SA-MP map editor like MapTogether, pick your GTA San Andreas folder, place and retexture objects, then export the code and paste it into OnGameModeInit. RemoveBuildingForPlayer lines go in OnPlayerConnect.
What is the best program for SA-MP mapping?
We use MapTogether, which we made. It is free, shows every object with a preview, does textures and material text, lets friends map with you live and tests the map in game with one button. Texture Studio is the classic in-game alternative.
Where do I put the map code?
CreateDynamicObject or CreateObject lines go in OnGameModeInit, or OnFilterScriptInit if the map is a filterscript. RemoveBuildingForPlayer lines go in OnPlayerConnect.
How do I remove buildings in SA-MP?
With RemoveBuildingForPlayer(playerid, model, x, y, z, radius) in OnPlayerConnect. In MapTogether press R and click the building, and its LOD is removed with it.
How do I change the texture of an object in SA-MP?
SetObjectMaterial (or SetDynamicObjectMaterial) swaps the texture on one material slot of an object for any texture in the game. In MapTogether you click the part of the object and pick the texture.
Do I need the streamer plugin?
For anything bigger than a small map, yes. CreateDynamicObject only sends players the objects near them, so a map can have thousands of objects.
Start mapping
MapTogether is free for Windows and Android. Download MapTogether or see how the SA-MP map editors compare.