01.09.2008, 17:08
I've made this tutorial for the many people who want to make a (working) SA-MP server, and may need some help..
This tutorial includes:
» Downloading, installing + playing sa-mp
» Creating your own server
» Getting your server online
» Advertising your server
Downloading, installing + playing SA-MP:
First make sure that you have version 1.0 of GTA: San Andreas. If you don't have version 1.0, download this first:
To download SA-MP, go to http://sa-mp.com/download.php and download the newest version (0.2X) of SA-MP
(make sure that you download the Client, and not the Server.)
When the download is completed, open the file that you've just downloaded. (duh..)
If everything went right, you should see this:
Than click I Agree and than you must search the folder where GTA: San Andreas is installed. (standard C:\Program Files\Rockstar Games\GTA San Andreas)
When the folder is selected, click Install.
And than Finish.
You can easely find SA-MP in the start menu.
Start » All programs » San Andreas Multiplayer » San Andreas Multiplayer.
When opening SA-MP, you will see a window like this:
To add a server to your favorites, use the button and enter the IP:Port of the server.
To see a list of all the SA-MP servers, klick the Internet button. (it may need some time to load all the servers)
Press the button to connect to the selected server.
Creating your own server
Before you can modify your server, you first have to download some files here.
(in this tutorial I'm showing you how to create a server on a Windows server only)
When it's downloaded you'll need to unpack the .zip file to where ever you want.
After extracting the .zip, you will see these files/folders:
» server.cfg (file)
» server-readme.txt (file)
» samp-server.exe (file)
» samp-licence.txt (file)
» announce.exe (file)
» scriptfiles (folder)
» spawno (folder)
» gamemodes (folder)
» filterscripts (folder)
For example, we will use the lvdm.pwn gamemode (you can also create your own mode but i don't want to type that much)
you can find lvdm.pwn in the gamemodes folder.
Configuring your server.cfg:
When you open it you will see this:
» rcon_password change the line rcon_password changeme to an other password that you like.
this password will be needed to log in to the server with /rcon login <mypassword>
» announde 1 means if the server will be announced in the SA-MP server list (1) or not (0).
» filterscripts here you will enter the filterscripts that your server must load.
» weburl will be displayed in the server browser of SA-MP (right left corner).
» anticheat must be set to 0 becouse (if set to 1) it may crash your server.
The rest explain themselves..
Adding vehicles:
If you want to add vehicles, you will first need to find the positions of where the vehicle will be spawned.
You can find them by going on a SA-MP server, taking a vehicle and than typing /save <nameyouchoose>
or by starting debug mode:
press "Launch Debug"
Use /v <modelid> to spawn your vehicle, and /save <nameyouchoose> to save the position.
Than go to your GTA: San Andreas folder and find the savedpositions.txt file.
There you will see a line like this:
Copy that line (select it and CTRL + C)
and than paste (CTRL + V) it in the lvdm.pwn file under the OnGameModeInit callback.
(you will see some other vehicles placed there from the lvdm mode, so just place your line under, above or between them).
You can change the type of car by changing the modelid parameter:
Modelid's can be found here.
Adding player classes: (= the player you choose when connecting to a server)
You first need to save the position again like in "adding vehicles" (see above)
And place the code from savedpositions.txt under the OnGameModeInit callback.
(you will see some other player classes placed there from the lvdm mode, so just place your line under, above or between them).
It may look like this:
Skin id's can be found here.
Adding pickups:
Adding pickups works the same as adding vehicles and adding player classes (see above).
The defference is that you use this function:
Example:
Pickup id's can be found here and here.
Pickup types:
Making simple commands:
(= teleport command)
This uses function SetPlayerPos:
Example:
This Must be placed under callback: OnPlayerCommandText
When you're done with scripting:
You must compile your script before you close the window.
Getting your server online:
If you want to connect to your server, click the button from samp.exe and enter this ip: 127.0.0.1:7777
The 7777 from 127.0.0.1:7777 is the port of your server. this must be the same as the port in your server.cfg
If other people want to connect to your server, you must first forward your port (the 7777 from in the server.cfg)
for this, i direct you to this topic. (can't be explained better)
And to check if your server is online, use this.
Advertising your server:
If you made your server, you can advertise your server here
but please Read the rules before you post!
When you've done all the steps, you have.. a server :P
So that's it, i hope this tutorial helps a lot of people
If you have any questions or did i forget something, feel free to reply
Fallout.
This tutorial includes:
» Downloading, installing + playing sa-mp
» Creating your own server
» Getting your server online
» Advertising your server
Downloading, installing + playing SA-MP:
First make sure that you have version 1.0 of GTA: San Andreas. If you don't have version 1.0, download this first:
To download SA-MP, go to http://sa-mp.com/download.php and download the newest version (0.2X) of SA-MP
(make sure that you download the Client, and not the Server.)
When the download is completed, open the file that you've just downloaded. (duh..)
If everything went right, you should see this:
Than click I Agree and than you must search the folder where GTA: San Andreas is installed. (standard C:\Program Files\Rockstar Games\GTA San Andreas)
When the folder is selected, click Install.
And than Finish.
You can easely find SA-MP in the start menu.
Start » All programs » San Andreas Multiplayer » San Andreas Multiplayer.
When opening SA-MP, you will see a window like this:
To add a server to your favorites, use the button and enter the IP:Port of the server.
To see a list of all the SA-MP servers, klick the Internet button. (it may need some time to load all the servers)
Press the button to connect to the selected server.
Creating your own server
Before you can modify your server, you first have to download some files here.
(in this tutorial I'm showing you how to create a server on a Windows server only)
When it's downloaded you'll need to unpack the .zip file to where ever you want.
After extracting the .zip, you will see these files/folders:
» server.cfg (file)
» server-readme.txt (file)
» samp-server.exe (file)
» samp-licence.txt (file)
» announce.exe (file)
» scriptfiles (folder)
» spawno (folder)
» gamemodes (folder)
» filterscripts (folder)
For example, we will use the lvdm.pwn gamemode (you can also create your own mode but i don't want to type that much)
you can find lvdm.pwn in the gamemodes folder.
Configuring your server.cfg:
When you open it you will see this:
» rcon_password change the line rcon_password changeme to an other password that you like.
this password will be needed to log in to the server with /rcon login <mypassword>
» announde 1 means if the server will be announced in the SA-MP server list (1) or not (0).
» filterscripts here you will enter the filterscripts that your server must load.
» weburl will be displayed in the server browser of SA-MP (right left corner).
» anticheat must be set to 0 becouse (if set to 1) it may crash your server.
The rest explain themselves..
Adding vehicles:
If you want to add vehicles, you will first need to find the positions of where the vehicle will be spawned.
You can find them by going on a SA-MP server, taking a vehicle and than typing /save <nameyouchoose>
or by starting debug mode:
press "Launch Debug"
Use /v <modelid> to spawn your vehicle, and /save <nameyouchoose> to save the position.
Than go to your GTA: San Andreas folder and find the savedpositions.txt file.
There you will see a line like this:
Code:
AddStaticVehicle(429, -2704.3149, 224.6218, 3.8592, 191.0172, 1, 1); // nameyouchoose ( AddStaticVehicle(modelid, x, y, z, angle, color1, color2); )
and than paste (CTRL + V) it in the lvdm.pwn file under the OnGameModeInit callback.
(you will see some other vehicles placed there from the lvdm mode, so just place your line under, above or between them).
You can change the type of car by changing the modelid parameter:
Code:
AddStaticVehicle(»»modelid««, x, y, z, angle, color1, color2);
Adding player classes: (= the player you choose when connecting to a server)
You first need to save the position again like in "adding vehicles" (see above)
Code:
AddPlayerClass(skin-id, x, y, z, rotation, weapon 1, ammo 1, weapon12, ammo 2, weapon13, ammo 3);
(you will see some other player classes placed there from the lvdm mode, so just place your line under, above or between them).
It may look like this:
Code:
AddPlayerClass(265, 1958.3783, 1343.1572, 15.3746, 270.1425, 0, 0, 24, 300, 0, 0);
Adding pickups:
Adding pickups works the same as adding vehicles and adding player classes (see above).
The defference is that you use this function:
Code:
AddStaticPickup(pickupid ,pickuptype, x, y, z);
Code:
AddStaticPickup(1273,2,-2146.688964,98.546432,35.320312);
Pickup types:
Code:
0 Item does not display 2 Pickupable and respawns after a few minutes 3 Pickupable, no respawn 4 Disappears shortly after creation (used for drops?) 5 Disappears shortly after creation (used for drops?) 8 pickupable (no effect) - disappears shortly after creation (used for ?) 11 Blows Up few seconds after creation* 12 Blows Up few seconds after creation (car explosion? timer is the burning flame?) 13 X - Slowly descends in Z and eventually goes through the floor (parachute?) 15 Pickupable, no respawn 19 Pickupable with no effect (Information icon?) 22 Pickupable, no respawn
(= teleport command)
This uses function SetPlayerPos:
Code:
SetPlayerPos(playerid, X, Y, Z);
Code:
if(!strcmp(cmdtext,"/myteleport",true)) { SetPlayerPos(playerid, -2099.7470, 245.2656, 35.8833); SendClientMessage(playerid,0xFF3399AA,"You have been teleported to -myteleport-"); return 1; }
When you're done with scripting:
You must compile your script before you close the window.
Getting your server online:
If you want to connect to your server, click the button from samp.exe and enter this ip: 127.0.0.1:7777
The 7777 from 127.0.0.1:7777 is the port of your server. this must be the same as the port in your server.cfg
If other people want to connect to your server, you must first forward your port (the 7777 from in the server.cfg)
for this, i direct you to this topic. (can't be explained better)
And to check if your server is online, use this.
Advertising your server:
If you made your server, you can advertise your server here
but please Read the rules before you post!
When you've done all the steps, you have.. a server :P
So that's it, i hope this tutorial helps a lot of people
If you have any questions or did i forget something, feel free to reply
Fallout.