[Tutorial] How to make Gangs/Teams [EASY]
#1

This is for scripters that got Problems with SetPlayerTeamFromClass

Don't fret, it is not the end of the world, this is just saying you never used it. This will go away in part 2.
If your making a simple team death match then you wont need a lot of this tutorial, but this part is important for later.
Above the main function, you will need to define the teams.

pawn Code:
#define BALLAS 0  // we define the Teams now = Ballas
#define GROVES 1  // Same = Groves
But before we start all of the setting player team, we need to create variables to tell the script how to check teams. It's a simple variable above the main function.
pawn Code:
new gTeam[MAX_PLAYERS];

If you compile now you will get an error
pawn Code:
warning 203: symbol is never used: "gTeam"

now on OnPlayerRequestClass we do this : You delete the SetPlayerPos , SetPlayerCameraPos and SetPlayerCameraLookAt then you add this:

pawn Code:
forward SetPlayerTeamFromClass(playerid, classid);
   public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerTeamFromClass(playerid, classid);
    return 1;
}
public SetPlayerTeamFromClass(playerid, classid)
{
Then we will add the Teams/Gangs under OnPlayerRequestClass!

pawn Code:
if(classid == 0)
    {
        gTeam[playerid] = BALLAS;
        GameTextForPlayer(playerid,"~w~Ballas",3000,5); // This will show up an Text , when you select your class
        SetPlayerPos(playerid,1975.2399,-1220.0157,25.0779); // position of the player in the class selection
        SetPlayerCameraPos(playerid,1969.5686,-1224.0016,24.9909); // Cameraposition
        SetPlayerCameraLookAt(playerid,1975.2399,-1220.0157,25.0779);
        SetPlayerFacingAngle(playerid,122.4500);
        SetPlayerColor(playerid,0xA000FFFF); // Teamcolor
    }
else if(classid == 1)
    {
        gTeam[playerid] = GROVES;
        GameTextForPlayer(playerid,"~w~Grove Street Famlilys",3000,5);
        SetPlayerPos(playerid,2500.6060,-1672.1453,13.3512);
        SetPlayerCameraPos(playerid,2507.0615,-1674.3574,13.3732);
        SetPlayerCameraLookAt(playerid,2500.6060,-1672.1453,13.3512);
        SetPlayerFacingAngle(playerid,252.4717);
        SetPlayerColor(playerid,0x55FF00FF);
    }
}
Under OnGameModeInit we will add some skins and the coordinates are the Spawn of your Team/Gang
pawn Code:
// Ballas
AddPlayerClass(104,1979.1917,-1222.0964,25.1824,97.3597,0,0,0,0,0,0); // 104=Skin , 1979.1917 =X ect....
// Groves
AddPlayerClass(107,2508.5671,-1673.6665,13.3793,86.2585,0,0,0,0,0,0);

Hope this will help!

if you find mistakes post em!
Reply


Messages In This Thread
How to make Gangs/Teams [EASY] - by Santox14 - 09.09.2011, 20:56
Re: How to make Gangs/Teams [SIMPLE] - by [GTA]AmericanGangster - 09.09.2011, 20:57
Re: How to make Gangs/Teams [SIMPLE] - by =WoR=Varth - 09.09.2011, 21:00
Re: How to make Gangs/Teams [EASY] - by =WoR=G4M3Ov3r - 09.09.2011, 21:04
Re: How to make Gangs/Teams [EASY] - by Kaperstone - 10.09.2011, 15:55
Re: How to make Gangs/Teams [EASY] - by AceFlyer - 10.09.2011, 16:08
Re: How to make Gangs/Teams [EASY] - by WarriorMax - 22.09.2011, 19:13
Re: How to make Gangs/Teams [EASY] - by Ehab1911 - 23.09.2011, 08:51
Re: How to make Gangs/Teams [EASY] - by Max_Coldheart - 23.09.2011, 13:29
Re : How to make Gangs/Teams [EASY] - by Naruto_Emilio - 27.09.2011, 16:36
Re: How to make Gangs/Teams [EASY] - by Cody_Ward - 30.09.2011, 16:32
Re: How to make Gangs/Teams [EASY] - by [HK]Ryder[AN] - 24.01.2012, 13:28
Re: How to make Gangs/Teams [EASY] - by T0pAz - 24.01.2012, 13:32
Re: How to make Gangs/Teams [EASY] - by megamind2067 - 07.08.2012, 18:48
Re: How to make Gangs/Teams [EASY] - by Strier - 22.12.2012, 06:42
Re: How to make Gangs/Teams [EASY] - by Lapon - 22.12.2012, 07:21
Re: How to make Gangs/Teams [EASY] - by iSniper - 07.01.2013, 21:07
Re: How to make Gangs/Teams [EASY] - by qazwsx - 25.07.2013, 08:26
Re : How to make Gangs/Teams [EASY] - by Turkiish03 - 18.11.2014, 18:20
Re: How to make Gangs/Teams [EASY] - by LOCS - 18.11.2014, 18:34
Re: How to make Gangs/Teams [EASY] - by LeXuZ - 19.11.2014, 13:19
Re: How to make Gangs/Teams [EASY] - by blade7788 - 29.11.2016, 18:09

Forum Jump:


Users browsing this thread: 1 Guest(s)