17.04.2011, 11:35
Hi there!
First of all, I know there are more tutorials that looks like this, but some of them, are not really.. well good, I think personally. "Remove this because it's unusefull". WHY is it unusefull? - And I also know, I already have a tutorial for script beginners, but this tutorial doesn't explain only scripting.
This tutorial is mentioned to people who wanna start with Grand Theft Auto San Andreas : Multiplayer -> Server. (So who wanna have his own server -.-)
This tutorial explains what you have to do, download etc. Let's get started.
What is 'serversided'?
You have two sides of SA:MP:
* Client-Side
* Server-Side
The clientside, that's you. When you play on a server, you're the client. The client sends requests etc. to the server, and the server will process it. Let's make an example:
Now, when you go ingame and typ "/command", you'll see: "You have just performed the next command: /command".
WHY?
Because, you (the client) have sent a command. The server receives it and runs everything that's in OnPlayerCommandText (that's being called if you send a command).
What do you need?
You'll need the next things:
* Pawno : [i]That's the program you're gonna need to use to compile scripts from .pwn to .amx. All the playable server have atleast a gamemode. When you load a gamemode/filterscript (more information below), it loads the .amx. An amx file is not readable or edittable.[i]
* SA-MP server files: This are the files to start the server. I am basically talking about the .exe files and the server.cfg. The .exe files are needed to start the server, the server.cfg contains important information, with servername, RCON password (That's the main admin password) and alot more. See more information below.
The SA:MP package contains this all. It can be found at the SA:MP download page. You must have the SA-MP 0.3c R2 Windows Server, or SA-MP 0.3c R2 Linux Server (x86) if you have linux.
Okay. I have the files. What now?
Now you can start scripting. But I won't tell about that. See the bottom of this post for URL's. I have a tutorial for scripting, the start.
All I'm gonna explain you now, is important information about the SA:MP package. This is what you're supposed to have:
You can delete the .txt files, but please read at least the "samp-license.txt". The "samp-readme.txt" contains a bit information about server.cfg. I won't tell alot about that, because that can be found exactly here: https://sampwiki.blast.hk/wiki/server.cfg.
First I'm gonna tell you what every map is, wherefor it is.
filterscripts : This map contains all the add-on's for the server. See below for more information
gamemodes : This map contains all the modes for the server. See also below for more info
include : Not really neccesary. The includes in there could be moved to pawno/include
npcmodes : Records + scripts of the NPC's. See below for more info (again)
pawno : This is the wonderfull program to compile scripts to .amx
plugins : The map which includes all the plugins (duh).
scriptfiles : This map can contain information/content for filterscripts, plugins and gamemodes. Eg. userfiles are mostly stored in these maps
Let's explain more, about what what is and what it does.
Gamemodes
A gamemode (script) is just a mode you must have. Without it, you can't start the server.
The gamemode contains the basic information, such as skin selection (the skins you can choose), spawn information etc.
filterscripts
This are also scripts, but you can start a server without filterscripts.
Filterscripts are just add-ons. They can make a gamemode better. They can also be VERY handy, if you're not really good in scripting, or if you are too lazy.
You can make, for example just make a small gamemode, and add alot of add-ons (the filterscripts), like an admin systen, house system, vehicle system...
includes
This are not scripts which are being loaded in a server. Includes contains (mostly) usefull functions which can be used into a script.
plugins
This are also scripts, but more advanced. The most players can't make this. You must have C(?) knowledge (I can't remember if it was C, C# or C++. I think (I'm almost sure) that it is C++)
However, plugins can also be add-ons, not for only a gamemode, but also for a filterscript. You can't have an house system with it (as far as I know), but more such things as function.
Well, all the plugins does contain functions. You can call plugins actually "Modifications" (mods), which you can't say of the filterscripts. That's atleast my opinion.
NPC's
"NPC" stands for "Non-Playing Characters". It are just robots.
They can be used for example an automatic bus driver. That's better then having a real human (that's playing SA:MP), because that's boring. (Always driving the same routes, non-stop).
NPC's can do everything over and over and over without being tired. Their only min point is that they cost server slots (If you have max. 25 players and if you have one bot, it'll say max 24 players).
The server.cfg
Read the wiki: https://sampwiki.blast.hk/wiki/server.cfg
Playing your server ()
Well, since you know that, you must know how to start the server.
You can simply do this by starting the program "samp-server.exe". Please note that you must portforward before you can play.
If you've portforwarded, players can only play when...
1) Your internet+computer firewall is off (I've ever read. I don't know if it's true but I do believe it.)
2) The samp-server.exe is started
3) You have actually internet (while samp-server.exe is on)
4) You have portforwared.
5) Your computer is turned on ^^
So if you want a 24/7 host, you should have a very good router (CPU usage, memory usage etc. The average persons can have arround 20-30 players without having laggs) and a always turned on computer. (Expensive, cuz of the power you're using).
I recommend you to buy a host, if you want it 24/7 , and without having laggs. See this topic: https://sampforum.blast.hk/showthread.php?tid=189169
Other usefull tutorials and URL's.
Tutorials which I made
* Starting with SCRIPTING: https://sampforum.blast.hk/showthread.php?tid=177490
* How to make a gamemode (from scratch): https://sampforum.blast.hk/showthread.php?tid=217304
Tutorials from other people
* (******): Why you shouldn't use 256: https://sampforum.blast.hk/showthread.php?tid=55261
* (Roomeo): How to portforward: https://sampforum.blast.hk/showthread.php?tid=240151 (Please tell me if you know a better tutorial).
Links
1- https://sampwiki.blast.hk/
This official wiki site from SA:MP contains almost all information about functions etc.
Visit the site for more information. If you have a question about a function or callback, first go to the site. Example the function "IsPlayerInRangeOfPoint".
Don't you know how to use it? Go to wiki. The links are almost always like this: https://sampwiki.blast.hk/wiki/function/callback_name . So in this case https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint.
That's all I have to say for now.
If I'm missing something or if I've got something wrong, please tell it to me.
Regards,
Kevin
First of all, I know there are more tutorials that looks like this, but some of them, are not really.. well good, I think personally. "Remove this because it's unusefull". WHY is it unusefull? - And I also know, I already have a tutorial for script beginners, but this tutorial doesn't explain only scripting.
This tutorial is mentioned to people who wanna start with Grand Theft Auto San Andreas : Multiplayer -> Server. (So who wanna have his own server -.-)
This tutorial explains what you have to do, download etc. Let's get started.
What is 'serversided'?
You have two sides of SA:MP:
* Client-Side
* Server-Side
The clientside, that's you. When you play on a server, you're the client. The client sends requests etc. to the server, and the server will process it. Let's make an example:
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
new string[128];
format(string, 128, "You have just performed the next command: %s", cmdtext);
SendClientMessage(playerid, 0xFFFFFFAA, string);
return 1;
}
WHY?
Because, you (the client) have sent a command. The server receives it and runs everything that's in OnPlayerCommandText (that's being called if you send a command).
What do you need?
You'll need the next things:
* Pawno : [i]That's the program you're gonna need to use to compile scripts from .pwn to .amx. All the playable server have atleast a gamemode. When you load a gamemode/filterscript (more information below), it loads the .amx. An amx file is not readable or edittable.[i]
* SA-MP server files: This are the files to start the server. I am basically talking about the .exe files and the server.cfg. The .exe files are needed to start the server, the server.cfg contains important information, with servername, RCON password (That's the main admin password) and alot more. See more information below.
The SA:MP package contains this all. It can be found at the SA:MP download page. You must have the SA-MP 0.3c R2 Windows Server, or SA-MP 0.3c R2 Linux Server (x86) if you have linux.
Okay. I have the files. What now?
Now you can start scripting. But I won't tell about that. See the bottom of this post for URL's. I have a tutorial for scripting, the start.
All I'm gonna explain you now, is important information about the SA:MP package. This is what you're supposed to have:
You can delete the .txt files, but please read at least the "samp-license.txt". The "samp-readme.txt" contains a bit information about server.cfg. I won't tell alot about that, because that can be found exactly here: https://sampwiki.blast.hk/wiki/server.cfg.
First I'm gonna tell you what every map is, wherefor it is.
filterscripts : This map contains all the add-on's for the server. See below for more information
gamemodes : This map contains all the modes for the server. See also below for more info
include : Not really neccesary. The includes in there could be moved to pawno/include
npcmodes : Records + scripts of the NPC's. See below for more info (again)
pawno : This is the wonderfull program to compile scripts to .amx
plugins : The map which includes all the plugins (duh).
scriptfiles : This map can contain information/content for filterscripts, plugins and gamemodes. Eg. userfiles are mostly stored in these maps
Let's explain more, about what what is and what it does.
Gamemodes
A gamemode (script) is just a mode you must have. Without it, you can't start the server.
The gamemode contains the basic information, such as skin selection (the skins you can choose), spawn information etc.
filterscripts
This are also scripts, but you can start a server without filterscripts.
Filterscripts are just add-ons. They can make a gamemode better. They can also be VERY handy, if you're not really good in scripting, or if you are too lazy.
You can make, for example just make a small gamemode, and add alot of add-ons (the filterscripts), like an admin systen, house system, vehicle system...
includes
This are not scripts which are being loaded in a server. Includes contains (mostly) usefull functions which can be used into a script.
plugins
This are also scripts, but more advanced. The most players can't make this. You must have C(?) knowledge (I can't remember if it was C, C# or C++. I think (I'm almost sure) that it is C++)
However, plugins can also be add-ons, not for only a gamemode, but also for a filterscript. You can't have an house system with it (as far as I know), but more such things as function.
Well, all the plugins does contain functions. You can call plugins actually "Modifications" (mods), which you can't say of the filterscripts. That's atleast my opinion.
NPC's
"NPC" stands for "Non-Playing Characters". It are just robots.
They can be used for example an automatic bus driver. That's better then having a real human (that's playing SA:MP), because that's boring. (Always driving the same routes, non-stop).
NPC's can do everything over and over and over without being tired. Their only min point is that they cost server slots (If you have max. 25 players and if you have one bot, it'll say max 24 players).
The server.cfg
Read the wiki: https://sampwiki.blast.hk/wiki/server.cfg
Playing your server ()
Well, since you know that, you must know how to start the server.
You can simply do this by starting the program "samp-server.exe". Please note that you must portforward before you can play.
If you've portforwarded, players can only play when...
1) Your internet+computer firewall is off (I've ever read. I don't know if it's true but I do believe it.)
2) The samp-server.exe is started
3) You have actually internet (while samp-server.exe is on)
4) You have portforwared.
5) Your computer is turned on ^^
So if you want a 24/7 host, you should have a very good router (CPU usage, memory usage etc. The average persons can have arround 20-30 players without having laggs) and a always turned on computer. (Expensive, cuz of the power you're using).
I recommend you to buy a host, if you want it 24/7 , and without having laggs. See this topic: https://sampforum.blast.hk/showthread.php?tid=189169
Other usefull tutorials and URL's.
Tutorials which I made
* Starting with SCRIPTING: https://sampforum.blast.hk/showthread.php?tid=177490
* How to make a gamemode (from scratch): https://sampforum.blast.hk/showthread.php?tid=217304
Tutorials from other people
* (******): Why you shouldn't use 256: https://sampforum.blast.hk/showthread.php?tid=55261
* (Roomeo): How to portforward: https://sampforum.blast.hk/showthread.php?tid=240151 (Please tell me if you know a better tutorial).
Links
1- https://sampwiki.blast.hk/
This official wiki site from SA:MP contains almost all information about functions etc.
Visit the site for more information. If you have a question about a function or callback, first go to the site. Example the function "IsPlayerInRangeOfPoint".
Don't you know how to use it? Go to wiki. The links are almost always like this: https://sampwiki.blast.hk/wiki/function/callback_name . So in this case https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint.
That's all I have to say for now.
If I'm missing something or if I've got something wrong, please tell it to me.
Regards,
Kevin