Setting up a simple server in SAMP -
user345 - 18.06.2008
Initial Setup
Firstly you will need to download the appropriate server package. This will depend on your OS (Operating System). The downloads page can be found
here. You will now be presented with a screen with downloads for the Client and Server.
Scroll down until you see the following screen.
http://i286.photobucket.com/albums/l...erdownload.jpg
From here choose your server package and download it by clicking on the coloured text under the package name.
**Note** Before you download the server package be sure you read the
SA-MP Services Agreement. This will define your rights as a SAMP server owner and the rules you must abide by to use the SAMP software.
Once you have downloaded the Server package that your require and you have read the Service Agreement locate your download.
http://i286.photobucket.com/albums/l...sampserver.jpg
You will now need to extract it, right click on the Zip archive and click extract//extract all//extract here. (Make sure you extract the files to a folder to keep things nice and tidy)
http://i286.photobucket.com/albums/l...mx/extract.jpg
For windows users, you may use a program such as
WinRAR.
**Note** The above screenshot is taken from a computer with WinRAR installed, you may not have the exact same screen, but you should still have an Extract option somewhere if you run XP//Vista.
After extracting you should now have a new folder somewhere // list of files of the SAMP Server, if so, you have extracted correctly. Now when you open the folder you will see something like this.
http://i286.photobucket.com/albums/l...ampserver2.jpg
(Windows users only, Linux owners will have a slightly different screen)
Now that this has been done successfully the next stage is to decide on hosting. If you plan on hosting your server from home then follow the next stage of the tutorial. if you plan on buying a server from one of the
SAMP Server Hosts Then you may skip to
Configuring The Server
Some notes about Home Hosting vs Buying a Server Host
Home hosting will usually cause laggy gameplay as the server is usually hosted on a low-speed internet connection with multiple users accessing it.
Home hosting servers will only be online when the computer it's being hosted on is online
Server Hosts are usually hosted on high quality/high speed internet connections (100Mb//1Gb) depending on host.
Sever Hosts are 24/7 and can provide help if you encounter problems with your server.
__________________________________________________ ________________________________________
Hosting on a Home Computer
If you do decide to host off your home computer then there are a few things you must do.
Port Forward - A tutorial can be found
here made by me, so if you have any questions feel free to ask me. (I have requested a tutorial for SAMP today on
www.Portforward.com and will see what happens.)
Allow Gta_Sa.exe // announce.exe // Samp_Server.exe through any firewalls/anti-virus you may have on your computer.
**Note** Users of Kapersky antivirus please visit
here.
__________________________________________________ _________________________________________
Configuring The Server
Once you have completed all of the above it is now time to set up your server.
Scripts
Since this guide is aimed at people who are new to scripting then i will assume you have little-to-no scripting knowledge.
Brief overview of PAWN.
Unlike other internet games, SAMP's gamemodes are scripted in PAWN, this means more effort is required into setting up a SAMP server. In other words, you can't go to a nice screen which says "Please Select Gametype, Max players, etc" There is more work involved.
Some PAWN references
The SAMP Wikipedia is a great place to find information about basic scripting. However, since the official Wikipedia page is down, you can use an alternative link.
Discoverthelife Back-Up Wikipedia. The Search Function on this Wikipedia seems to be broken, so if you would like to browse all the pages then click
here.
For general PAWN related documentation click
here (Taken from f3llah1n's thread found
here.
Andre9977's Indentation Tutorial
Pastebin for script debugging
Mike's PAWN references (Be aware the wiki.samp.com links are not functioning at this time.
PAWN Scripts
If you feel you aren't quite ready for making your own script then that's perfectly fine. If you are new to scripting then it's best to modify an existing script to your needs. You will learn eventually to make your own scripts.
Pre-made scripts can be found under the
Script Showroom section of the forums.
Different Types of Scripts
Gamemodes [Denoted with [GM]//[Gamemode]]
Filterscripts [Denoted with [FS]]
Includes [Denoted with [INC]]
Applications [Denoted with [APP]]
Maps [Denoted with [MAP]]
Gamemodes are the main scripts and are the main gameplay in the server.
Filterscripts are add-on scripts which add something special to the server, like an object streamer//admin house//objects, etc.
Includes give extra functions to a PAWN script.
Applications are used to enhance the server in some way, such as an RCON Addon.
Maps are groups of objects put together to form an extra area on the Original San Andreas Map (Such as a Fifth Airport // Stuntzone // Dm Area, etc)
Different Gamemodes
The main types of gamemodes are as follows.
DM or Deathmatch - Killing other players to win
Stunt - Maps filled with lots of jumps/loops/etc
Cops and Robbers - Cops chasing criminals, how much simpler can it be?
RPG - Role Playing Game - Take on the role of a taxi driver and go round doing your job, meeting people and acting as you would do in real life
Race - Where you can race against other people to win
All-In-One - Where you get a mixture of all of the above
There are more variations on these gamemodes but thee are the main ones.
The most popular gamemode around is undoubtedly:
The Godfather - Popular RPG gamemode
Installing the Script
When you have found a script you like, download it somewhere easy to find. Locate the script. If the script is a .PWN file then do the next step. If it is a .AMX file or if the script contains both a .PWN and .AMX file then skip the next step.
Compiling .PWN Files
Open up your SAMP server folder which you extracted earlier on in the tutorial. Look for a folder called "Pawno" and open it.
You should now see a screen that looks like this.
http://i286.photobucket.com/albums/l...awnofolder.jpg
Now double click on the Pawno icon.
http://i286.photobucket.com/albums/l.../pawnoicon.jpg
This will bring up a screen that looks like this.
http://i286.photobucket.com/albums/l...lumx/pawno.jpg
Click on File
Click Open
Browse to your .PWN file and click open.
Your script will now appear on the screen. At the top of the screen click on "Build" then click on "Compile". At this point your computer may slow down, compiling the script takes up a fair amount of memory and time so don't panic!
You should now see a screen like this.
http://i286.photobucket.com/albums/l.../compiling.jpg
Is you see errors in the box and you aren't sure why they are occuring then post in the
Scripting Section. Post the code you are having problems with in Pastebin (If it's a large piece of code you are having problems with, but DONT post the WHOLE script!), and link to the pastebin code.
Or use the Insert Code button if the code is small.
However, if the compilation is successful you will see a screen similar to the above. Now close down PAWN and look for the .PWN file you compiled. You should now see a .AMX file with the same name as the .PWN file.
Adding the Gamemode to the Server
Now, once you have got your .AMX and .PWN file move them to the "Gamemodes" Folder within your Server Folder.
If you have any Filterscripts or Includes you also wish to incllude then move them to the Appropriate Folders. The filterscripts folder can be found in the same Directory as the Gamemodes folder. The Includes folder can be found in the Pawno Folder.
Editing the Server Config File
Open up your server folder and you should see a "Server.cfg" file. Right click the file and click Open With. Choose either Wordpad or Notepad from the list and Select Ok.
You will now be presented with a screen like this.
http://i286.photobucket.com/albums/l...rverconfig.jpg
Brief explanation of the Server.cfg File
Lanmode defines whether or not the server can be accessed from the internet. 0 being Yes, 1 being No
Rcon_password defines the password which Administrators will use to admin the server using the Rcon screen
Maxplayers defines the Maximum amount of players that can join your server (200 being the maximum amount)
Port defines the port number which clients will connect to your server with. (MUST be the same as the forwarded port)
Hostname defines the name of the server as seen from the Internet List//Favourites List
Gamemode(number) defines the Gamemodes which will appear on the server.
Filterscripts defines the Filterscripts which will be used on the server
Announce defines whether or not the server will show up on the Internet list (1 for yes, 0 for no)
Query this can be deleted from the .cfg file (Not needed)
Weburl defines the website which will be displayed on the servers mini-information section
Anti-cheat should be 0 (Ant-cheat was removed from SAMP)
The Server_Readme file also contains these explanations:
Code:
SA:MP 0.2.2 Server Setup
----------------------
Once the configuration is complete, run samp-server.exe to
launch the server process.
CONFIGURATION:
Example server.cfg:
echo Executing Server Config...
lanmode 0
maxplayers 32
port 7777
hostname Unnamed Server
announce 0
gamemode0 lvdm 1
gamemode1 rivershell 1
gamemode2 sniper 1
gamemode3 barron 1
gamemode4 sftdm 1
weburl www.sa-mp.com
rcon_password changeme
To configure the server, you must edit the values in server.cfg. They are explained below:
hostname
--------
Parameters:
string
Description:
Specifies the hostname shown in the server browser
port
----
Parameters:
int
Description:
Specifies the port to listen on.
This port is used for game connections, rcon connections, and for querying.
maxplayers
----------
Parameters:
int
Description:
Specifies the maximum amount of players.
lanmode
-------
Parameters:
int (0 or 1)
Description:
Turns lanmode on (1) or off (0). Lanmode (as the name suggests) is for use on LAN games, where bandwidth is not a problem. Lanmode sends data at a higher rate, for a smoother game.
announce
-------
Parameters:
int (0 or 1)
Description:
Announces your server to the 'Internet' server list in the SA:MP browser. On (1) or Off (0).
weburl
------
Parameters:
string
Description:
Specifies the URL shown in the server browser, which is associated to the server.
rcon_password
-------------
Parameters:
string
Description:
Specifies the password needed to connect to rcon, or login to rcon ingame.
gamemode0 - gamemode15
----------------------
Parameters:
string
int
Description:
Specifies the rotation settings. The first parameter sets the game mode name. The second is the number of times it will repeat.
You can use gamemode0 to specify the first gamemode, gamemode1 to specify the second, etc.
When you have set the .cfg file to your needs. Save it.
Now click on the samp_Server.exe file and you should get a black DOS screen like this.
http://i286.photobucket.com/albums/l.../dosscreen.jpg
Of course, this is running a default gamemode.
If when you try to open the Samp_Server.exe file, the screen immediately closes consult the Server_log file.
The most common problems are things such as.
Error: Your password must be changed from the default password, please change it.
Change your Rcon Password!
[12:33] I couldn't load any gamemode scripts. Please verify your server.cfg
[12:33] It needs a gamemode0 line at the very least.
Add a 0 to the gamemode statement
**Note** The Announce.exe file does NOT need to be opened too, if you try to do so, the screen will immediately close. Announce.exe will be opened automatically when Announce 1 is set in the Server.cfg file.
Testing the Server
Now to see if the server works!
If this server is running from your computer and you want to join then add the IP 127.0.01 into your favourites list.
For your friends to join, you need to obtain your External IP from
here.
Then give them the IP and Port number. (IP:Port Number) E.g 123.123.123.345:7777
If you or your friends can't join the server, then you will need to check the Port-Forwarding//Firewalls section again.
However, if the server is from a paid host, then they should supply you with an IP address. Add that to your favourites list and join.
If you need help, remember to contact your host!
I'm pretty sure there's a few things missing from this, so if you find anything missing tell me and i'll add it to the tut, with credit to you.
**Windows Owners* be sure to read
this!
IRC: Scripting Channel is also set up for problems with Scripting, it is located at:
irc.gamesurge.net #sa-mp.scripting
Re: Setting up a simple server in SAMP -
Azteca - 18.06.2008
Very nice tutorial. You've put a lot of work in to this and it's really paid off. Now I know where to refer my friends when they ask me such questions.
Thanks mate.
Re: Setting up a simple server in SAMP -
Snickers - 18.06.2008
Really nice tutorial, should be stikied in my eyes, but too bad that the pictures don't work
Re: Setting up a simple server in SAMP -
user345 - 18.06.2008
Quote:
Originally Posted by Azteca
Very nice tutorial. You've put a lot of work in to this and it's really paid off. Now I know where to refer my friends when they ask me such questions.
Thanks mate.
|
Thanks!
Quote:
Originally Posted by Snickers
Really nice tutorial, should be stikied in my eyes, but too bad that the pictures don't work 
|
They work here, you blocked photobucket?
Re: Setting up a simple server in SAMP -
Snickers - 18.06.2008
Nope
Re: Setting up a simple server in SAMP -
user345 - 18.06.2008
Quote:
Originally Posted by Snickers
Nope 
|
Ok =/ I'll add the links under the pics.
Edit: If anyone can add anything to the tutorial about the Linux side of things i would be grateful.
Re: Setting up a simple server in SAMP -
KayY - 20.07.2008
Nice, but I got a newbie question..
I don't have a router, and I want to run a server.
I already put in a mod, it's already running, I can already play in it. But only me.
Got my own IP adress, When I try to get the IP adress from
http://www.whatismyip.com/ I get (Retrieving info...) IP
I added the IP adress from whatismyip.com and port:7777 but it still doesnt show up.
I'm not using a router. Can anyone help plz =)
Sorry for my newbyness xD
I run in windows
Re: Setting up a simple server in SAMP -
Stratos - 20.07.2008
Thereґs nothing different in Linux. Only the start command.
Very nice Tutorial!
Re: Setting up a simple server in SAMP -
Jaymzanator - 21.07.2008
Quote:
Originally Posted by KayY
Nice, but I got a newbie question..
I don't have a router, and I want to run a server.
I already put in a mod, it's already running, I can already play in it. But only me.
Got my own IP adress, When I try to get the IP adress from http://www.whatismyip.com/ I get (Retrieving info...) IP
I added the IP adress from whatismyip.com and port:7777 but it still doesnt show up.
I'm not using a router. Can anyone help plz =)
Sorry for my newbyness xD
I run in windows
|
make sure you are running on port 7777.
try joining 127.0.0.1:7777
this is your local loopback IP address. it will always point to your computer.
this is different from your external IP address. your ISP may share your IP with a number of people.
make sure your firewall allows port 7777 from external zones.
if this is a server for testing, i recommend not taking any action.
if you are going to host a game for people i recommend paying for a server. (unless you have 10mbit+ broadband and a server that will be up 24/7)
Re: Setting up a simple server in SAMP -
hunterman007 - 25.07.2008
jpe linux is just go to map with console putty or somthing and then ./samp022svr en ./announce
Re: Setting up a simple server in SAMP -
CAMERON_BANFIELD - 27.07.2008
My server is ran on windows xp sp3 and when i start up samp and wait for it to load it says server restarting
please help
Re: Setting up a simple server in SAMP -
GTASAIV - 27.07.2008
Good tutorial this is if it wants to be shown
http://www.youtube.com/watch?v=3eqeygIwBKA
Re: Setting up a simple server in SAMP -
mabokeur - 29.07.2008
thx very very much
Re: Setting up a simple server in SAMP -
dolarcek - 02.08.2008
I have a question.... what can i do....when i open that server_log f

ile its just Error: Your password must be changed from the default password, please change it. What can i do?
Re: Setting up a simple server in SAMP -
Ice_Cube - 04.08.2008
20% it done i've tested the server......now how can i make it public?
Re: Setting up a simple server in SAMP -
TargetZone - 05.08.2008
Help! I got a script and everything works. But. When I got to whatsmyip.org, and I give someone it with the 7777 on it, they say nothing is there. Why is this? Btw I'm not paying for any host
Re: Setting up a simple server in SAMP -
bilakispa - 05.08.2008
Nice tutorials, well done
Re: Setting up a simple server in SAMP -
TargetZone - 05.08.2008
Can anyone please help with the problem above
Re: Setting up a simple server in SAMP -
Agent_Smith - 06.08.2008
Nice tutorial...
very usefull thanks for making it
youre the best!!!
Re: Setting up a simple server in SAMP -
maxgrv - 06.08.2008
Quote:
Originally Posted by dolarcek
I have a question.... what can i do....when i open that server_log f  ile its just Error: Your password must be changed from the default password, please change it. What can i do?
|
Just that, change the rcom password from changeme to something else