[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
#2

nice tutorial!
Reply
#3

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

Nothing has been explained well, Better improve it.
Reply
#5

Explane alittle more :\
Reply
#6

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

Nice
Reply
#8

Thank you
Reply
#9

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.
Reply
#10

That not a tutorial..... explain more man.
Reply
#11

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

Good.But this is copy and paste.Explain MORE
Reply
#13

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

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
Reply
#15

Couldn't get a shit :/
Reply
#16

Nice copy. Better luck next time with better tutorial.
Reply
#17

HELP!!
I keep getting these errors:

error 017: undefined symbol "Grove"
error 017: undefined symbol "Ballas"
Reply
#18

Thanks mane
Reply
#19

Thanks for tutoriel
Reply
#20

Nice and easy
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)