Код:
#define Cops 0
#define Army 1
#define Civil 2
#define SerialKiller 3
Код:
AddPlayerClass(287,-1315.9380,437.7021,7.1875,4.0838,0,0,0,0,0,0); // army
AddPlayerClass(283,-1596.3175,733.3856,-4.9063,4.0007,0,0,0,0,0,0); // Cop
//Civil
AddPlayerClass(1, -2719.8279,-318.5510,7.8438, 45.3150,0,0,0,0,0,0);
AddPlayerClass(2,-2742.4075,375.8751,4.3652,89.4049,0,0,0,0,0,0);
AddPlayerClass(3,-2630.1689,599.0845,14.4531,178.8243,0,0,0,0,0,0);
AddPlayerClass(33,-2630.1689,599.0845,14.4531,178.8243,0,0,0,0,0,0);
AddPlayerClass(4,-1985.4353,138.6892,27.6875,83.1007,0,0,0,0,0,0);
AddPlayerClass(5,-1547.2014,676.1210,7.1875,87.3474,0,0,0,0,0,0);
Код:
public OnPlayerRequestClass(playerid, classid)
{
switch(classid)
{
case 0:
{
gTeam[playerid] = Cops;
GameTextForPlayer(playerid, "~b~Cop", 5000, 5);
SetPlayerPos(playerid,283, -2860.4360, -342.8072, 14.2333);
SetPlayerFacingAngle(playerid,87.1632);
SetPlayerCameraPos(playerid, -2852.8296, -343.4230, 14.5014);
SetPlayerCameraLookAt(playerid, -2860.4360, -342.8072, 14.2333);
}
case 1:
{
gTeam[playerid] = Army;
GameTextForPlayer(playerid, "~g~Army", 5000, 5);
SetPlayerPos(playerid,287, -2860.4360, -342.8072, 14.2333);
SetPlayerFacingAngle(playerid,87.1632);
SetPlayerCameraPos(playerid, -2852.8296, -343.4230, 14.5014);
SetPlayerCameraLookAt(playerid, -2860.4360, -342.8072, 14.2333);
}
case 2:
{
gTeam[playerid] = Civil;
GameTextForPlayer(playerid, "~w~Civil", 5000, 5);
SetPlayerPos(playerid, -2860.4360, -342.8072, 14.2333);
SetPlayerFacingAngle(playerid,87.1632);
SetPlayerCameraPos(playerid, -2852.8296, -343.4230, 14.5014);
SetPlayerCameraLookAt(playerid, -2860.4360, -342.8072, 14.2333);
}
case 3:
{
gTeam[playerid] = SerialKiller;
GameTextForPlayer(playerid, "~r~Serial Killer", 5000, 5);
SetPlayerPos(playerid,33, -2860.4360, -342.8072, 14.2333);
SetPlayerFacingAngle(playerid,87.1632);
SetPlayerCameraPos(playerid, -2852.8296, -343.4230, 14.5014);
SetPlayerCameraLookAt(playerid, -2860.4360, -342.8072, 14.2333);
}
}
return 1;
}
Код:
forward SetPlayerToTeamColour(playerid);
public SetPlayerToTeamColour(playerid)
{
if(gTeam[playerid] == Cops)
{
SetPlayerColor(playerid, COLOR_BLUE);
}
else if(gTeam[playerid] == Army)
{
SetPlayerColor(playerid, COLOR_PURPLE);
}
else if(gTeam[playerid] == Civil)
{
SetPlayerColor(playerid, COLOR_WHITE);
}
else if(gTeam[playerid] == SerialKiller)
{
SetPlayerColor(playerid, COLOR_PINK);
}
}
Код:
public OnPlayerSpawn(playerid)
{
if(gTeam[playerid] == Cops)
{
GivePlayerWeapon(playerid, 3, 500);
GivePlayerWeapon(playerid, 22, 500);
GivePlayerWeapon(playerid, 25, 500);
GivePlayerWeapon(playerid, 17, 10);
}
if(gTeam[playerid] == Army && (GetPlayerScore(playerid) <= 1700))return SendClientMessage(playerid, COLOR_RED, "You Need 1700 Score To Use Army");
{
GivePlayerWeapon(playerid, 4, 500);
GivePlayerWeapon(playerid, 16, 500);
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 32, 500);
GivePlayerWeapon(playerid, 33, 500);
GivePlayerWeapon(playerid, 26, 500);
SetPlayerArmour(playerid, 50.0);
}
if(gTeam[playerid] == Civil)
{
}
if(gTeam[playerid] == SerialKiller && (GetPlayerScore(playerid) <= 1200))return SendClientMessage(playerid, COLOR_RED, "You Need 1200 Score To Use Serial Killer");
{
GivePlayerWeapon(playerid, 9, 500);
GivePlayerWeapon(playerid, 37, 500);
GivePlayerWeapon(playerid, 33, 500);
GivePlayerWeapon(playerid, 24, 500);
SetPlayerArmour(playerid, 100.0);
}
return 1;
}
And the players can spawn with army even tho they have 0 score,but 1700 is needed..