Код:
#include <a_samp>
#define GROVE 0
#define POLICE 1
#define Ballas 2
#define Vagos 3
#define Aztecas 4
new gTeam[MAX_PLAYERS];
public OnGameModeInit()
{
//Grove Start
AddPlayerClass(105,2497.2693,-1676.9578,13.3398,23.6501,0,0,0,0,0,0); //Grove Street Gang Member (0)
AddPlayerClass(106,2497.2693,-1676.9578,13.3398,23.6501,0,0,0,0,0,0);
AddPlayerClass(107,2497.2693,-1676.9578,13.3398,23.6501,0,0,0,0,0,0);
//Ballas
AddPlayerClass(102,2497.2693,-1676.9578,13.3398,23.6501,0,0,0,0,0,0);
AddPlayerClass(103,2497.2693,-1676.9578,13.3398,23.6501,0,0,0,0,0,0);
AddPlayerClass(104,2497.2693,-1676.9578,13.3398,23.6501,0,0,0,0,0,0);
//Los Aztecas
AddPlayerClass(114,2497.2693,-1676.9578,13.3398,23.6501,0,0,0,0,0,0);
AddPlayerClass(115,2497.2693,-1676.9578,13.3398,23.6501,0,0,0,0,0,0);
AddPlayerClass(116,2497.2693,-1676.9578,13.3398,23.6501,0,0,0,0,0,0);
//Vagos
AddPlayerClass(108,2497.2693,-1676.9578,13.3398,23.6501,0,0,0,0,0,0);
AddPlayerClass(109,2497.2693,-1676.9578,13.3398,23.6501,0,0,0,0,0,0);
AddPlayerClass(110,2497.2693,-1676.9578,13.3398,23.6501,0,0,0,0,0,0);
//Police
AddPlayerClass(281,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); //Police Officer (1)
AddPlayerClass(282,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); //Police Officer (1)
AddPlayerClass(283,1544.0514,-1675.7766,13.5577,98.0974,0,0,0,0,0,0); //Police Officer (1)
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerTeamFromClass(playerid, classid);
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerToTeamColour(playerid);
return 1;
}
SetPlayerTeamFromClass(playerid, classid)
{
if(classid == 0)
{
gTeam[playerid] = GROVE_STREET;
}
if(classid == 1)
{
gTeam[playerid] = POLICE;
}
if(classid == 2)
{
gTeam[playerid] = Ballas;
}
if(classid == 3)
{
gTeam[playerid] = Vagos;
}
if(classid == 4)
{
gTeam[playerid] = Aztecas;
}
}
SetPlayerToTeamColour(playerid)
{
if(gTeam[playerid] == GROVE_STREET)
{
SetPlayerColor(playerid,GROVE_STREET_COLOUR); //Green
}
if(gTeam[playerid] == Ballas)
{
SetPlayerColor(playerid,#f25170); //Green
}
if(gTeam[playerid] == Vagos)
{
SetPlayerColor(playerid,#91a7d0); //Green
}
if(gTeam[playerid] == Aztecas)
{
SetPlayerColor(playerid,#afc94c); //Green
}
if(gTeam[playerid] == POLICE)
{
SetPlayerColor(playerid,#21a9ec); // Blue
}
}