04.07.2013, 15:30
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:
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:
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)
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:
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.
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;
}
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;
}
PHP Code:
public OnPlayerConnect(playerid)
{
return 1;
}
So now, place your code under the onplayerconnect callback, and it should look something like this:
PHP Code:
public OnPlayerConnect(playerid)
{
RemoveBuildingForPlayer(playerid, 16684, 329.8984, 2504.2656, 15.5703, 0.25); // Removes object id 16684 at 329.8984, 2504.2656, 15.5703 within a 0.25 radius
return 1;
}
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.