[HELP] Team problem
#5

Infact I got some other shit with it lol.

I'm trying to make more than just 2 screens and I get multiple problems.

Here's the deal, I made a cop team and a SendClientMessage function when you spawn you will get *You have joined team *name* But it doesn't work, the first time I spawn with a skin nothing shows up.

When I get in and change skin to ballas, which I added the correct skin for it says "You have joined team grove" but then after I kill myself a couple of times it sorts out with grove/ballas team (You have joined team Grove) etc.
The problem is, when I join the team COPS , it shows *You have joined team BALLAS* when I clearly added another team in the code.

Look:

Here's my defintion for teams.
Код:
new team[MAX_PLAYERS];
#define GROVE 0x00FF00AA
#define BALLAS 0xFF00FFAA
#define COPS 0x3A47DEFF
#define team1 1
#define team2 2
#define team3 3
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_BRIGHTRED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_BLUE 0x3A47DEFF
#define COLOR_TAN 0xBDB76BAA
#define COLOR_PURPLE 0x800080AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_BLACK 0x00000000
#define COLOR_DARKGREY 0x696969FF
OnPlayerSpawn
Код:
public OnPlayerSpawn(playerid)
{
		if(team[playerid] == team1)
    {
        SetPlayerColor(playerid, GROVE);//color
        SetPlayerTeam(playerid, 1);// you need team so if someone shoots another person in team, they wont lose health
		SendClientMessage(playerid, GROVE, "You have joined team GROVE");
    }
	 	if(team[playerid] == team2)
    {
        SetPlayerColor(playerid, BALLAS); // color
        SetPlayerTeam(playerid, 2);
		SendClientMessage(playerid, BALLAS, "You have joined team BALLAS");
    }
        if(team[playerid] == team3)
	{
	    SetPlayerColor(playerid, COPS); //color
	    SetPlayerTeam(playerid, 3);
		SendClientMessage(playerid, COPS, "You have joined team COPS");
		}
   		return 1;
}
OnPlayerRequestClass
Код:
public OnPlayerRequestClass(playerid, classid)
{
	if(classid == 0|1|2) // first skin
{
	 team[playerid] = team1; // first team
}
	if(classid == 3|4|5) // second skin
{
	team[playerid] = team2; // second team
}
	if(classid == 6|7|8) //third skins
{
	team[playerid] = team3; //third team
}
  	SetPlayerPos(playerid,2311.3455,-1658.9199,14.2456);
	SetPlayerCameraPos(playerid, 2319.4363,-1658.9548,13.9579);
	SetPlayerCameraLookAt(playerid, 2311.3455,-1658.9199,14.2456);
    return 1;
}
Код:
public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("HTDM");
    AddPlayerClass(105,2311.3455,-1658.9199,14.2456,270.2288,24,100,29,300,0,0); // Grove
    AddPlayerClass(106,2311.3455,-1658.9199,14.2456,270.2288,32,300,22,150,0,0); // Grove
    AddPlayerClass(107,2311.3455,-1658.9199,14.2456,270.2288,32,300,22,150,0,0); // Grove
   	AddPlayerClass(102,2164.6941,-1685.5839,15.0859,302.4727,24,100,29,300,0,0); // Ballas
	AddPlayerClass(103,2164.6941,-1685.5839,15.0859,302.4727,32,300,22,150,0,0); // Ballas
	AddPlayerClass(104,2164.6941,-1685.5839,15.0859,302.4727,22,150,25,100,0,0); // Ballas
	AddPlayerClass(280,1540.2865,-1674.9822,13.5503,88.6450,24,100,29,300,0,0); // Snutspawn
	AddPlayerClass(281,1540.2865,-1674.9822,13.5503,88.6450,32,300,22,150,0,0); // Snutspawn
	AddPlayerClass(282,1540.2865,-1674.9822,13.5503,88.6450,25,300,22,150,0,0); // Snutspawn
Ignore the indentation it's fine in my code.

Any solution? Thanks in advance.
Reply


Messages In This Thread
[HELP] Team problem - by Hudgens - 17.03.2011, 18:40
Re: [HELP] Team problem - by tanush - 17.03.2011, 18:45
Re: [HELP] Team problem - by Hudgens - 17.03.2011, 19:07
Re: [HELP] Team problem - by tanush - 17.03.2011, 19:10
Re: [HELP] Team problem - by Hudgens - 17.03.2011, 20:55
Re: [HELP] Team problem - by tanush - 17.03.2011, 21:33

Forum Jump:


Users browsing this thread: 2 Guest(s)