Team deathmatch - 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: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Team deathmatch (
/showthread.php?tid=118624)
Team deathmatch -
Freddy Z - 04.01.2010
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?
Re: Team deathmatch -
*ToM* - 04.01.2010
-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]);
Re: Team deathmatch -
Freddy Z - 04.01.2010
Can you be more specific? i don't even know how to check if a player is in team etc...
Re: Team deathmatch -
*ToM* - 04.01.2010
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
??
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 !
Re: Team deathmatch -
M4S7ERMIND - 04.01.2010
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};
Re: Team deathmatch -
Freddy Z - 04.01.2010
Ok, and now how do i let the players choose the gang and how do i edit the selecting team display?
Re: Team deathmatch -
Freddy Z - 04.01.2010
i mean, i've done everything you said, but when i select charaters i only see carl johnsons and nothing about team
Re: Team deathmatch -
ClanDBZVegeta - 04.01.2010
did u do the
"AddPlayerClass" even?!?
Re: Team deathmatch -
Freddy Z - 05.01.2010
nope
Do i need it here too?
how can i do it?