Question about teams :
#1

I got this code, and also, on the classrequest, 32 skins for choose. The problem is how do I define 16 of these skins for the red team, and the other ones for blue team; Thank you.
Код:
public OnPlayerRequestClass(playerid, classid)
{

	SetPlayerPos(playerid, 136.5217,1597.6338,33.8650);
	SetPlayerCameraPos(playerid, 134.7852,1603.5570,33.2559);
	SetPlayerCameraLookAt(playerid, 136.5217,1597.6338,33.8650);
	SetPlayerFacingAngle(playerid, 0.0);
    SetPlayerTeamFromClass(playerid, classid);
	return 1;
}
SetPlayerTeamFromClass(playerid, classid)
{
  if (classid == 0)//This is using what we had at the top. #define TEAM_RED 0 if the classid = 0 then they are team red.
      {
			   GameTextForPlayer(playerid,"~r~ Red Team", 3000, 6);
			   gTeam[playerid] = time1;
      }
      else if (classid == 1)  //Else means any other ones will be
      {
			   GameTextForPlayer(playerid,"~b~ Blue Team",3000, 6);
	           gTeam[playerid] = time2;
      }
  return 1;
}
Код:
public OnGameModeInit()
{

	SetGameModeText("Desert War");
	////// TIME 0 /////////////////////////////////////////////////////////
	AddPlayerClass(155, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(162, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(163, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(164, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(165, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(166, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(167, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(260, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(264, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(22, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(105, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(106, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(107, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(27, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(29, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(16, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    
    /////////////////////// TIME 1 ///////////////////////////////////////////////
    AddPlayerClass(280, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(281, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(282, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(283, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(284, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(285, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(286, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(287, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(288, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(274, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(275, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(276, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(277, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(278, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(279, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(294, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}
Reply
#2

pawn Код:
switch(classid)
    {
        case 0,1,2,3:
        {
on so on and so on
Reply
#3

yw ty :PP , now I also know how to use switch and case ;P
Reply
#4

no problem sir.
Reply
#5

Dude =d , a single problem was that just some of skins I chose as blue team showed the text "blue team", but some which I chose for the blue , doesn't shows "blue team". And also, dont show for "red team", and I removed "SetPlayerTeamFromClass". I tried to put switch(classid) and the case for each class and gametext according to color, maybe a bug? ( I put in OnPlayerRequestClass);
Reply
#6

... Please
Reply
#7

use a ~h~ after the ~b~ or ~r~ and make sure u fit all the classes..
Reply
#8

had to be as well :
Код:
if(classid >= 0 && classid <= 16)
		{
	    GameTextForPlayer(playerid,"~b~ Blue Team",3000, 6);
		}
	    if(classid >= 17 && classid <= 32 ) 
	    {
	    GameTextForPlayer(playerid,"~r~ Red Team", 3000, 6);
		}
Thank yo.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)