Team problem
#1

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;
    }
}
Reply
#2

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 ******
Reply
#3

Ahhhh thanks you guys! +rep to both of you!!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)