[Tutorial] Adding a map to your server (good for new scripters)
#1

This is my 3rd tutorial, which shows you how to simply add maps to your server. It's pretty basic but a lot of detail isn't needed.
Firstly, you need to find the OnGameModeInit (or OnFilterScriptInit) callback. You should see something like this:
PHP Code:
public OnGameModeInit()
{
     
//CODE
     
return 1;

PHP Code:
public OnFilterScriptInit()
{
     
//CODE
     
return 1;

This will be for the CreateObject or CreateDynamicObject codes. You will need to put all of your code for Create(Dynamic)Object in here. E.g:
PHP Code:
public OnGameModeInit()
{
     
CreateObject(355,0,0,0,0,0,0); // Creates an object with id 355 at 0,0,0 with no rotation.
     
return 1;

Now, for the removebuildingforplayer code. If you have added this under OnGameModeInit, you will get an error saying "unidentified symbol: playerid". This will be used for OnPlayerConnect instead. Find your onplayerconnect callback (or add it if you dont)
PHP Code:
public OnPlayerConnect(playerid)
{
     return 
1;

You will now need to add your removebuildingforplayer code. You are recommended to not have over 150 removebuildingforplayer codes, due to lag on a connection.
So now, place your code under the onplayerconnect callback, and it should look something like this:
PHP Code:
public OnPlayerConnect(playerid)
{
     
RemoveBuildingForPlayer(playerid16684329.89842504.265615.57030.25); // Removes object id 16684 at 329.8984, 2504.2656, 15.5703 within a 0.25 radius
     
return 1;

Adding MTA maps

MTA maps must be converted before being added to SA:MP. There are multiple online converters, but one of the most common is this. Then, just follow the same method as shown above.

Constructive criticism is welcome, but don't rage and spam my PMs. Good luck with adding your maps to your server.
Reply
#2

Thanks for the post my friend was looking into adding maps but he forgot how to,another thanks to you ! Btw i Rep +1 u
Reply
#3

Easy tutorial, but nice job.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)