01.02.2013, 14:27
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
.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:
Step 7:
Go to OnPlayerRequestClass and add this:
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:
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:
If you like it, please REP.
Also I will make a new tutorial soon
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
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; }
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); } }
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); }
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; }
Also I will make a new tutorial soon