[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


Messages In This Thread
Make factions/Gangs (Simple) - by iManakoss - 01.02.2013, 14:27
AW: Make factions/Gangs (Simple) - by Blackazur - 01.02.2013, 15:33
Re: Make factions/Gangs (Simple) - by SmithyComp - 01.02.2013, 15:37
Re: Make factions/Gangs (Simple) - by RajatPawar - 01.02.2013, 15:39
Re: Make factions/Gangs (Simple) - by iManakoss - 01.02.2013, 15:43
Re: Make factions/Gangs (Simple) - by iManakoss - 02.02.2013, 07:17
Re: Make factions/Gangs (Simple) - by SCLA - 02.02.2013, 08:26
Re: Make factions/Gangs (Simple) - by iManakoss - 02.02.2013, 11:09
Re: Make factions/Gangs (Simple) - by [GF]Logic - 02.02.2013, 13:58
Re: Make factions/Gangs (Simple) - by iManakoss - 02.02.2013, 18:25

Forum Jump:


Users browsing this thread: 1 Guest(s)