Team deathmatch
#1

I followed the instructions --> https://sampwiki.blast.hk/wiki/PAWN_tuto...eam_deathmatch

So i added all about team deathmatch to my script, but now i need the characters and i don't know how to add'em...
I have 3 skins for each team, and i want to show only one character in the selecting team display, and when the player spawns, i want to random spawn one of the 3 skins. Can you help me?
Reply
#2

-Random Skins-

// At the top of the script
pawn Код:
new gTeam1Skins[3][3] = {
{126}, // Skin Id's
{124},
{113}
};

new gTeam2Skins[3][3] = {
{280}, // Skin Id's
{282},
{285}
};
Then go to OnPlayerSpawn callback, and check if player is in a team 1 ' if(gTeam or PlayerInfo whatever you have).
and set random skin spawn like that :

pawn Код:
new rand;
    rand = random(sizeof(gTeam1Skins));
    SetPlayerSkin(playerid, gTeam1Skins[rand][0]);
Reply
#3

Can you be more specific? i don't even know how to check if a player is in team etc...
Reply
#4

Quote:
Originally Posted by Freddy Z
Can you be more specific? i don't even know how to check if a player is in team etc...
Did you use
pawn Код:
new gTeam[MAX_PLAYERS];
??
If so then you use " if(gTeam[playerid] == 0) " // 0 as first team should be defined as team 0.
It's easy look, you just put this under OnPlayerSpawn callback :

pawn Код:
if(gTeam[playerid] == 0) { // Check if Player is in a first defined Team
    new rand;
    rand = random(sizeof(gTeam1Skins));
    SetPlayerSkin(playerid, gTeam1Skins[rand][0]); // Then give him a random skin
        }
and Voila !
Reply
#5

Quote:
Originally Posted by Toniu_
// At the top of the script
pawn Код:
new gTeam1Skins[3][3] = {
{126}, // Skin Id's
{124},
{113}
};

new gTeam2Skins[3][3] = {
{280}, // Skin Id's
{282},
{285}
};
Theres no need for an extra dimension. Its a waste of space.


pawn Код:
new gTeam1Skins[3] = {126, 124, 113};
new gTeam2Skins[3] = {280, 282, 285};
Reply
#6

Ok, and now how do i let the players choose the gang and how do i edit the selecting team display?
Reply
#7

i mean, i've done everything you said, but when i select charaters i only see carl johnsons and nothing about team
Reply
#8

did u do the
"AddPlayerClass" even?!?
Reply
#9

nope
Do i need it here too?
how can i do it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)