Team Colors
#7

Quote:
Originally Posted by guitarmandanny
Посмотреть сообщение
This is what I use to set Teams colours, edit it to your script.
Код:
#define TEAMA 0
#define TEAMB 1

public OnGameModeInit()
{

AddPlayerClassEx(0, 15, 1979.1917, -1222.0964, 25.1824, 97.3597, 0, 0, 0, 0, 0, 0); //TEAMA

AddPlayerClassEx(1, 14 1979.1917, -1222.0964, 25.1824, 97.3597, 0, 0, 0, 0, 0, 0); //TEAMB

	return 1;
}

forward SetPlayerTeamFromClass(playerid, classid);
   public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerTeamFromClass(playerid, classid);
    return 1;
}


public SetPlayerTeamFromClass(playerid, classid)

{

if(classid == 0) //TEAM A
    {
        gTeam[playerid] = TEAMA;
      		SetPlayerPos(playerid,1975.2399,-1220.0157,25.0779); // position of the player in the class selection
		SetPlayerCameraPos(playerid,1969.5686,-1224.0016,24.9909); // Cameraposition
		SetPlayerCameraLookAt(playerid,1975.2399,-1220.0157,25.0779);//Camera Look at position
		SetPlayerFacingAngle(playerid,122.4500); //Facing Angle
		SetPlayerColor(playerid,BLUE); // Teamcolor
		PlayerInfo[playerid][PlayerClass] = TEAMA;

    }
if(classid == 1) //TEAMB
    {
        gTeam[playerid] = TEAMB;
        	SetPlayerPos(playerid,1975.2399,-1220.0157,25.0779); // position of the player in the class selection
		SetPlayerCameraPos(playerid,1969.5686,-1224.0016,24.9909); // Cameraposition
		SetPlayerCameraLookAt(playerid,1975.2399,-1220.0157,25.0779);
		SetPlayerFacingAngle(playerid,122.4500);
		SetPlayerColor(playerid,ORANGE); // Teamcolor
		PlayerInfo[playerid][PlayerClass] = TEAMB;
    }
}
Don't need use gTeam !


Use native functions
pawn Код:
// Definitions (on top of gamemode)
#define COPS_TEAM           (0)
#define SWAT_TEAM           (1)


// On GameModeInit
AddPlayerClassEx(  COPS_TEAM, SKIN_ID, POS_SPAWN_X, POS_SPAWN_Y, POS_SPAWN_Z, POS_ANGLE,  WEAPON1, WEAPON1_AMMO, WEAPON2, WEAPON2_AMMO, WEAPON3, WEAPON3_AMMO) // Classid 0
AddPlayerClassEx(  SWAT_TEAM, SKIN_ID, POS_SPAWN_X, POS_SPAWN_Y, POS_SPAWN_Z, POS_ANGLE,  WEAPON1, WEAPON1_AMMO, WEAPON2, WEAPON2_AMMO, WEAPON3, WEAPON3_AMMO) // Classid 1
AddPlayerCLassEx( parameters ); // Classid 2... etc..



// On: (OnRequestClass)
switch(classid){
    case 0: SetPlayerTeam(playerid, COPS_TEAM); // Cops team (Classid 0)
    case 1: SetPlayerTeam(playerid, SWAT_TEAM); // Swat Team (classid 1)
}


// shows player team:
switch(GetPlayerTeam(playerid)){
    case COPS_TEAM: SendClientMessage(playerid, -1, "Your team is COPS");
    case SWAT_TEAM: SendClientMessage(playerid, -1, "Your team is Swat");
}
Reply


Messages In This Thread
Team Colors - by nicholas1 - 30.10.2012, 00:32
Re: Team Colors - by Deron_Green - 30.10.2012, 00:37
Re: Team Colors - by verlaj - 30.10.2012, 05:45
Re: Team Colors - by zSuYaNw - 30.10.2012, 05:52
Re: Team Colors - by nicholas1 - 31.10.2012, 02:18
Re: Team Colors - by guitarmandanny - 31.10.2012, 02:31
Re: Team Colors - by zSuYaNw - 31.10.2012, 02:37
Re: Team Colors - by nicholas1 - 31.10.2012, 22:16
Re: Team Colors - by zSuYaNw - 01.11.2012, 02:33
Re: Team Colors - by nicholas1 - 01.11.2012, 03:47

Forum Jump:


Users browsing this thread: 2 Guest(s)