Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Tutorial] [SA:MP] Part 1: Add The Gamemode And Classes Into Your Server.

Initiate Mage
Joined
Mar 30, 2009
Messages
3
Reaction score
0

Hello Guys,
Welecome to my Part 1: on 'add the Gamemode and Classes for your server.'

Step 1:
1: Download SAMP Server Download
2: Extract All The Files Into A Folder.

CoughMedia - [Tutorial] [SA:MP] Part 1: Add The Gamemode And Classes Into Your Server. - RaGEZONE Forums



Step 2:
1: Go Into The Pawno Folder
2: Go Into 'pawno'
3: Press new

CoughMedia - [Tutorial] [SA:MP] Part 1: Add The Gamemode And Classes Into Your Server. - RaGEZONE Forums



Important to non orginial SA holders:
Before you can continue you need to put this command into your Pawno.

Code:
public OnPlayerCommandText(playerid, cmdtext[])
{

    	if(strcmp(cmdtext,"/Savepos",true)==0)
	{
	    new info[128];
	    new Float:x, Float:y, Float:z;
	    GetPlayerPos(playerid,x,y,z);
	    new File:save=fopen("/SavePositions.txt", io_append);
	    format(info,sizeof(info),"Position: %f, %f, %f\r\n",x,y,z);
    	fwrite(save, info);
    	fclose(save);
		return 1;
	}

}
Once you go into your Server, you can do /savepos and it will save the co-ordinates into the filterscripts folder and compile and save it.


For normal users, you will be able to just open DE-BUG Mode and do /save and that will save into your San Andreas folder named SavedPositions.txt or something like that.


Ok now, if you scroll down the public OnGameModeInit()
We will add the Gamemode, Players and Vehicles into here.

Ok, to add the gamemode you should have to do this,

Code:
[COLOR="Blue"]public[/color] OnGameModeInit()
{
	SetGameModeText("fill this in with your gamemode.");//Use this to set the mode which players search for

My gamemode is Los Santos Deathmatch but yours can be anything.

Adding The Classes Into Here

1: Under where you put the gamemode, Leave 2 gaps after and then put in this command,

Code:
AddPlayerClass(0, 2508.3367, -1673.90*** 13.3776, 0, 1, 1, 22, 125, *** 250);
AddPlayerClass(**** 2508.3367, -1673.90*** 13.3776, 0, 1, 1, 22, 125, *** 250);
AddPlayerClass(106, 2508.3367, -1673.90*** 13.3776, 0, 1, 1, 22, 125, *** 250);
AddPlayerClass(107, 2508.3367, -1673.90*** 13.3776, 0, 1, 1, 22, 125, *** 250);

Now them will spawn in Grove Street.
To Add Your Own Classes and how to get the co-ord's. Just go into DEBUG mode and do /save and they will be in savedpositions.txt in your GTASanAndreas folder. , unless like I said earlier if you don't have the normal sa, just go back to your folder and open server.cfg and go down to gamemode and put the name of the save you named your pawno save data. and then save that and go into
samp-server then go into SAMP Multiplayer and add 127.0.0.1:7777 and then go into your server and do /savepos.

and then your co-orderniates will save in scriptfiles and then you replace,
Code:
2508.3367, 1673.90*** 13.3776
with yours.

To add classes you can find them in wiki-samp.com or whatever the website is.


btw, the code should have this at the end.

Code:
	return 1;
}

And then after this is what the coding should look like at the end of this lesson.

Code:
public OnPlayerCommandText(playerid, cmdtext[])
{

    	if(strcmp(cmdtext,"/Savepos",true)==0)
	{
	    new info[128];
	    new Float:x, Float:y, Float:z;
	    GetPlayerPos(playerid,x,y,z);
	    new File:save=fopen("/SavePositions.txt", io_append);
	    format(info,sizeof(info),"Position: %f, %f, %f\r\n",x,y,z);
    	fwrite(save, info);
    	fclose(save);
		return 1;
	}

}

COLOR="Blue"]public[/color] OnGameModeInit()
{
	SetGameModeText("fill this in with your gamemode.");//Use this to set the mode which players search for

AddPlayerClass(0, 2508.3367, -1673.90*** 13.3776, 0, 1, 1, 22, 125, *** 250);
AddPlayerClass(**** 2508.3367, -1673.90*** 13.3776, 0, 1, 1, 22, 125, *** 250);
AddPlayerClass(106, 2508.3367, -1673.90*** 13.3776, 0, 1, 1, 22, 125, *** 250);
AddPlayerClass(107, 2508.3367, -1673.90*** 13.3776, 0, 1, 1, 22, 125, *** 250);

return 1;
}
Or atleast has them in, if they dont they will not compile and you will not be able to access your server.
After that you can compile the server and then save it.



In the next segment I will be showing you on how to add Vehicles and Commands and Colors for your ID's in your server.

If you have any serious problems and need master help, please contact 'QuakeSteel@hotmail.com'

Bye bye :thumbup: (Time for my sleep :closedeyes:)
 
Last edited:
Initiate Mage
Joined
Mar 30, 2009
Messages
3
Reaction score
0
Re: Part 1: Add The Gamemode And Classes Into Your Server.

Yes I maybe abit confusing but...

:p

I'm 13 years old.
 
Initiate Mage
Joined
Nov 25, 2007
Messages
1
Reaction score
0
Re: Part 1: Add The Gamemode And Classes Into Your Server.

Where can i get Pawno program? mine says "Unable to execute compiler..." when im trying to compile my .pwn files.
 
Initiate Mage
Joined
Feb 18, 2009
Messages
3
Reaction score
0
What are the stars used for? the 3 that go ***?

Code:
AddPlayerClass(0, 2508.3367, -1673.90*** 13.3776, 0, 1, 1, 22, 125, *** 250);
 
Newbie Spellweaver
Joined
Sep 24, 2012
Messages
6
Reaction score
1
Or instead of using all of those 'addplayerclass' you can just do this:

Code:
public OnGameModeInit()
{
	for(new i = 0; i < 299; i++)
    {
	    switch(i)
	    {
	      case (3,4,5,6,8,42,65,74,86,119,149,208,268,273,289): continue;
	      default: AddPlayerClass(i, 1241.0105, -2052.6873, 59.9975, 2.8144, -1, -1, -1, -1, -1, -1);
	    }
    }
}

And that will add all of the player classes (from 0 to 300)
Now to where the camera looks...


Code:
public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid,1095.3811,-2036.9301,82.7055); // position you're at
 	SetPlayerFacingAngle(playerid,271.5483); // which direction you are looking at
	SetPlayerCameraPos(playerid, 1106.181518, -2036.951049, 82.758186); //where the camera is
	SetPlayerCameraLookAt(playerid, 1101.183349, -2037.086181, 82.758186); // where the camera's looking at
	return 1;
}

I was using these coordinates as an example, you can use whatever you wish though.
 
Back
Top