[Tutorial] Creating a sa-mp server + getting it online.
#1

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:

Code:
 AddStaticVehicle(429, -2704.3149, 224.6218, 3.8592, 191.0172, 1, 1); // nameyouchoose
 ( AddStaticVehicle(modelid, x, y, z, angle, color1, color2); )
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:

Code:
AddStaticVehicle(»»modelid««, x, y, z, angle, color1, color2);
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)

Code:
AddPlayerClass(skin-id, x, y, z, rotation, weapon 1, ammo 1, weapon12, ammo 2, weapon13, ammo 3);
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:

Code:
AddPlayerClass(265, 1958.3783, 1343.1572, 15.3746, 270.1425, 0, 0, 24, 300, 0, 0);
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:

Code:
AddStaticPickup(pickupid ,pickuptype, x, y, z);
Example:
Code:
AddStaticPickup(1273,2,-2146.688964,98.546432,35.320312);
Pickup id's can be found here and here.

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
Making simple commands:

(= teleport command)

This uses function SetPlayerPos:

Code:
SetPlayerPos(playerid, X, Y, Z);
Example:

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;
	}
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.
Reply
#2

Great tutorial, i think it's better than the other stickied one.
Can i get permission to add this in my super-duper sa-mp guide?
Reply
#3

yes that's fine
Reply
#4

Nice work Fallout .
Reply
#5

Nice tut, Even tho I Don't need it :/
Reply
#6

thanks!
Reply
#7

Haha, nice work!
Very usefull if you dont know how to setup a server.
Reply
#8

Quote:
Originally Posted by Wadabak
Mutch = Much.

Also if you are using that debug program, you will start from the beginning of GTA:SA, and you aren't able to acces the other islands with it.

Use simon's debug instead.
Quote:
Originally Posted by polopolo
by the way, if you set anticheat to 1, the server will crash, also add that in the tutorial.

Good tutorial, much new people should read this.
Maby I will make an video version of what you all said in the tutorial (because most people wanna see what to do instead of watching "not moving" pictures)
hehe thx, it's edited
Reply
#9

Nice tut. Get ready for the ultra nooby questions that are about to be posted.
Reply
#10

Mutch = Much.

Also if you are using that debug program, you will start from the beginning of GTA:SA, and you aren't able to acces the other islands with it.

Use simon's debug instead.
Reply
#11

by the way, if you set anticheat to 1, the server will crash, also add that in the tutorial.

Good tutorial, much new people should read this.
Maby I will make an video version of what you all said in the tutorial (because most people wanna see what to do instead of watching "not moving" pictures)
Reply
#12

This comes when I open the server.cfg..

Someone know what it is?
Reply
#13

open server.cfg with notepad (right mouse button -> open with -> notepad.)
Reply
#14

Nice tutorial!

but i watched to you tutorial about get the server on internet ( in other splayers list)
so other people can join my server.
thats the only thing that didnt work

can you help me bij saying exactly how it works.

(for connection Xfire=gijsbomers)
Reply
#15

check this topic: http://forum.sa-mp.com/index.php?topic=70202.0
Reply
#16

cool you even get it sticked
Reply
#17

hehe yes some admin did :P
Reply
#18

i dont know english very well so... :P
when i do everything (/rcon login xxx) where i can see my ip and there is just dm, stunt... servers i can`t find rpg... where i can download it??
Reply
#19

very good
just a problem when i add the car with /v the savedpositions.txt appear AddPlayerClass(0,1731.7379,-2458.7112,13.5547,213.5016,0,0,0,0,0,0); // cars
not vehicle =O

why? how can i solve this?
Reply
#20

Quote:
Originally Posted by aleksa
i dont know english very well so... :P
when i do everything (/rcon login xxx) where i can see my ip and there is just dm, stunt... servers i can`t find rpg... where i can download it??
you don't need to download it.. just press the "Internet" button and wait until the servers are loaded.
than you can use the filters to search for a mode like rpg (left bottom of the sa-mp window)

Quote:
Originally Posted by revenger48
very good
just a problem when i add the car with /v the savedpositions.txt appear AddPlayerClass(0,1731.7379,-2458.7112,13.5547,213.5016,0,0,0,0,0,0); // cars
not vehicle =O

why? how can i solve this?
use /save (to place the AddStaticVehicle in the savedpositions.txt file) while you are inside a vehicle
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)