[Tutorial] Make factions/Gangs (Simple)
#1

Welcome Guys, this is my first tutorial.

How to make Factions/Gangs.

First, you don't need any include.
Second, It's simple!.

Let's start!

Step One:

Go on your local server(ip: localhost:7777) and find the spawn Coordinates.Type /save to save the cords.

Step 2:
Go to Documents/GTA San Andreas User Files/SAMP/savedpositions.txt and open it.

Step 3:
You can notice AddPlayerClass(100,2352.7244,-1163.3182,27.4262,1.5394,0,0,0,0,0,0); Then Copy it.

Step 4:
Open pawno which is located in Pawno folder in your Server folder.Run it as administrator.Delete the
Код:
#if defined FILTERSCRIPT
.Add new gTeam[MAX_PLAYERS]; and new gPlayerClass[MAX_PLAYERS]

Step 5:
After that you need to define colors and teams like #define COLOR_WHITE 0xFFFFFFAA and to define the team you need to #define TEAM_GROVES 1

Step 6:
Go to OnGameModeInit and add the Spawn Locations:
Код:
public OnGameModeInit()
{
  SetGameModeText("GameMode Name");
   AddPlayerClass(22,2527.1042,-1664.5869,15.1666,180.9750,0,0,0,0,0,0); //Spawn 1 (replace it with you spawn positions)

  return 1;
}
Step 7:
Go to OnPlayerRequestClass and add this:
Код:
public OnPlayerRequestClass(playerid, classid)
{
    gPlayerClass[playerid] = classid;
    gTeam[playerid] = classid;

    switch (classid) {

        case 0:

            {
                gTeam[playerid] = TEAM_GROVES;
                GameTextForPlayer(playerid, "~g~ Your Faction Name", 5500, 5);
                SetPlayerColor(playerid, COLOR_WHITE);

            }
}
Information: Each case is fited for only one Spawn Location. If you have 10 AddPlayerClass, you need to add 10 Cases.Add 2 buckets on your last case because the script will show errors

Step 8:
Now add this under your scripted cases:
Код:
 if(classid == 0)
       {
        SetPlayerPos(playerid, 2527.1042,-1664.5869,15.1666);
		SetPlayerFacingAngle(playerid,180);
		SetPlayerCameraPos(playerid,2526.9868,-1666.8330,15.1683);
		SetPlayerCameraLookAt(playerid,2527.1042,-1664.5869,15.1666);

	   }
Note: You can't add on if(classid == 0), make a new one on each scripted case.
On SetPlayerPos add where will the player's skin will be shown. On SetPlayerFacingAngle add 0, 90,180,270 (0= North
90= West, 180= South 270= East, by adding it, the player will look at North,West,South and East), on SetPlayerCameraPos add where the camera will be( in order to player points on the camera, you need to find where you camera looks at [N,W,S,E]) and SetPlayerCameraLookAt you need to add the same cords with the cords you put on SetPlayerPos,only then you will able to see where your skin will be.

Finished, if you have any problem, you should see the Code I added to help you:

Код:
#include <samp>

#define COLOR_WHITE 0xFFFFFFAA
#define TEAM_GROVES 1

new gTeam[MAX_PLAYERS];
new gPlayerClass[MAX_PLAYERS];

public OnGameModeInit()
{
SetGameModeText("Blank Script");
AddPlayerClass(22,2527.1042,-1664.5869,15.1666,180.9750,0,0,0,0,0,0); // Spawn1 / Case 1
return 1;
}
public OnPlayerRequestClass
{
new gTeam[playerid] = classid; 
new gPlayerClass[playerid] = classid;
switch (classid) {
case 0:

            {
                gTeam[playerid] = TEAM_CPB;
                GameTextForPlayer(playerid, "~r~ Compton Piru Bloods", 5500, 5);
                SetPlayerColor(playerid, COLOR_RED);

            }
}
 if(classid == 0)
       {
        SetPlayerPos(playerid, 2527.1042,-1664.5869,15.1666);
		SetPlayerFacingAngle(playerid,180);
		SetPlayerCameraPos(playerid,2526.9868,-1666.8330,15.1683);
		SetPlayerCameraLookAt(playerid,2527.1042,-1664.5869,15.1666);

	   }
return 1;
}
If you like it, please REP.

Also I will make a new tutorial soon
Reply
#2

Simple but good for Beginners.
Reply
#3

Good work for a basic tutorial.
Reply
#4

This is a teams tutorial. Much better, out there! I thought it was a real gang! Anyways, gj.
Reply
#5

Thank you for the feedback guys, that makes me make more tutorials, such as LocalChat without any include, and some of /me /do and others.I am making this tutorials since I am a RP'er.And sorry for bad english.Do not worry for Any warnings, they aren't crashes the server
Reply
#6

Bump!
Reply
#7

Nice...
Reply
#8

If you Rep me, it would be cool!
Reply
#9

1- Don't ask for +rep it's not cool.

2- you are only allowed to Bump a thread if it was related to Scripting help section [Questions etc]

rather than that not bad.
Reply
#10

Okay, Didn't know that, sorry.
Thanks anyways
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)