Team problem - 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)
+--- Thread: Team problem (
/showthread.php?tid=435234)
Team problem -
Squirrel - 06.05.2013
Alright so I want to make that the first team can choose any skin from 0 to 264 and other team can use only from 265 to 287, but how? If I make it like this I wont be able to use it.
Код:
for(new i = 0; i < 264; i++)
{
AddPlayerClass(i, 1544.0514,-1675.7766,13.5577,98.0974, 0, 0, 0, 0, 0, 0);
}
for(new i = 265; i < 287; i++)
{
AddPlayerClass(i, 1544.0514,-1675.7766,13.5577,98.0974, 0, 0, 0, 0, 0, 0);
}
Is there any way I can use this in the code below?
For this code I gotta manualy add every skin :/
Код:
SetPlayerTeamFromClass(playerid, classid)
{
if(classid == 0 .. 264)
{
gTeam[playerid] = PUBLIC_ENEMY;
}
if(classid == 265 .. 287)
{
gTeam[playerid] = POLICE;
}
}
Re: Team problem -
vvhy - 06.05.2013
What you would do is something like this:
pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
switch (classid)
{
case 266,211,265,267,283,284,71,286://These will be cop skins
{
gTeam[playerid] = TEAM_COP;
}
default: //all other AddPlayerClass's will be civilians
{
gTeam[playerid] = TEAM_CIVIL;
}
}
}
Then
pawn Код:
SetPlayerTeamFromClass(playerid, SkinID);
Edit: Oh, replied same minute as ******
AW: Team problem -
Squirrel - 06.05.2013
Ahhhh thanks you guys! +rep to both of you!!