SA-MP Forums Archive
[Tutorial] How to make Gangs/Teams [EASY] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] How to make Gangs/Teams [EASY] (/showthread.php?tid=282178)

Pages: 1 2


How to make Gangs/Teams [EASY] - Santox14 - 09.09.2011

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!


Re: How to make Gangs/Teams [SIMPLE] - [GTA]AmericanGangster - 09.09.2011

nice tutorial!


Re: How to make Gangs/Teams [SIMPLE] - =WoR=Varth - 09.09.2011

Quote:
Originally Posted by [GTA]AmericanGangster
View Post
nice tutorial!
You call this, nice?
No I don't. Nothing has been explain there.


Re: How to make Gangs/Teams [EASY] - =WoR=G4M3Ov3r - 09.09.2011

Nothing has been explained well, Better improve it.


Re: How to make Gangs/Teams [EASY] - Kaperstone - 10.09.2011

Explane alittle more :\


Re: How to make Gangs/Teams [EASY] - AceFlyer - 10.09.2011

a Little bit more explaining would be good like everyone said:P


Re: How to make Gangs/Teams [EASY] - WarriorMax - 22.09.2011

Nice


Re: How to make Gangs/Teams [EASY] - Ehab1911 - 23.09.2011

Thank you


Re: How to make Gangs/Teams [EASY] - Max_Coldheart - 23.09.2011

pawn Code:
new gTeam[MAX_PLAYERS]; // What's this??

warning 203: symbol is never used: "gTeam" // Wuts this????

forward SetPlayerTeamFromClass(playerid, classid);//What is forward?
   public OnPlayerRequestClass(playerid, classid) // Whats public?
{
    SetPlayerTeamFromClass(playerid, classid); // What is this?
    return 1; // And this?
}
public SetPlayerTeamFromClass(playerid, classid) // And this?
{
Thank you.


Re : How to make Gangs/Teams [EASY] - Naruto_Emilio - 27.09.2011

That not a tutorial..... explain more man.


Re: How to make Gangs/Teams [EASY] - Cody_Ward - 30.09.2011

I need help, i followed everything in the tutorial but when i click the "Spawn" button nothing happens!
Please Help!


Re: How to make Gangs/Teams [EASY] - [HK]Ryder[AN] - 24.01.2012

Good.But this is copy and paste.Explain MORE


Re: How to make Gangs/Teams [EASY] - T0pAz - 24.01.2012

Please learn how to write a tutorial before posting. And if you are too lazy to do that, don't bother to post.


Re: How to make Gangs/Teams [EASY] - megamind2067 - 07.08.2012

I get these errors please help

C:\Users\Master13\Desktop\2012 the Final Battle\gamemodes\tes.pwn(61) : error 029: invalid expression, assumed zero
C:\Users\Master13\Desktop\2012 the Final Battle\gamemodes\tes.pwn(61) : error 017: undefined symbol "SetPlayerTeamFromClass"
C:\Users\Master13\Desktop\2012 the Final Battle\gamemodes\tes.pwn(62) : error 029: invalid expression, assumed zero
C:\Users\Master13\Desktop\2012 the Final Battle\gamemodes\tes.pwn(63) : error 001: expected token: ";", but found "{"
C:\Users\Master13\Desktop\2012 the Final Battle\gamemodes\tes.pwn(63) : warning 217: loose indentation
C:\Users\Master13\Desktop\2012 the Final Battle\gamemodes\tes.pwn(64) : error 017: undefined symbol "SetPlayerTeamFromClass"
C:\Users\Master13\Desktop\2012 the Final Battle\gamemodes\tes.pwn(67) : warning 225: unreachable code
C:\Users\Master13\Desktop\2012 the Final Battle\gamemodes\tes.pwn(67) : error 029: invalid expression, assumed zero
C:\Users\Master13\Desktop\2012 the Final Battle\gamemodes\tes.pwn(67) : error 017: undefined symbol "SetPlayerTeamFromClass"
C:\Users\Master13\Desktop\2012 the Final Battle\gamemodes\tes.pwn(71) : error 017: undefined symbol "gTeam"
C:\Users\Master13\Desktop\2012 the Final Battle\gamemodes\tes.pwn(71) : warning 215: expression has no effect
C:\Users\Master13\Desktop\2012 the Final Battle\gamemodes\tes.pwn(71) : error 001: expected token: ";", but found "]"
C:\Users\Master13\Desktop\2012 the Final Battle\gamemodes\tes.pwn(71) : error 029: invalid expression, assumed zero
C:\Users\Master13\Desktop\2012 the Final Battle\gamemodes\tes.pwn(71) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


Re: How to make Gangs/Teams [EASY] - Strier - 22.12.2012

Couldn't get a shit :/


Re: How to make Gangs/Teams [EASY] - Lapon - 22.12.2012

Nice copy. Better luck next time with better tutorial.


Re: How to make Gangs/Teams [EASY] - iSniper - 07.01.2013

HELP!!
I keep getting these errors:

error 017: undefined symbol "Grove"
error 017: undefined symbol "Ballas"


Re: How to make Gangs/Teams [EASY] - qazwsx - 25.07.2013

Thanks mane


Re : How to make Gangs/Teams [EASY] - Turkiish03 - 18.11.2014

Thanks for tutoriel


Re: How to make Gangs/Teams [EASY] - LOCS - 18.11.2014

Nice and easy