Switch,Case
#1

It sets the player team when the player selects a terrorists skin but it does not work or counter-terrorists

Код:
#define TERRORISTS 0
#define C_TERRORISTS 1
Код:
switch(classid)
{
    case 73,121,122,179,254:
    {
	Team[playerid] = TERRORISTS;
	SetPlayerColor(playerid, COLOR_RED);
	return 1;
    }
    case 284,285,287,280:
    {
        Team[playerid] = C_TERRORISTS;
	SetPlayerColor(playerid, COLOR_BLUE);
	return 1;
    }
}
Reply
#2

classid is not skinid, switch(GetPlayerSkin(playerid))
Reply
#3

You can make it with addplayerclass ,not with skins
Код:
public OnGameModeInit() 
{ 

	AddPlayerClass(258, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // case 0
	AddPlayerClass(202, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // case 1
	AddPlayerClass(198, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // case 2
	AddPlayerClass(261, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // case 3
    return 1; 
}
public OnPlayerRequestClass(playerid, classid)
{
	switch (classid)
	{
		case 0, 1: // terrorist
		{
			//code
		}
                case 2, 3://C-Terorist
                {
                      //code
                }
	}
	
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)