I'm working on a Team DM GM, when a player is in class selection, the team name should appear with GameText & The players color should be changed to team color...
Код:
#include <a_samp>
////////////////////////////////////////////////////////////////////////////////
forward SetupPlayerForClassSelection(playerid);
////////////////////////////////////////////////////////////////////////////////
new WarTeam[MAX_PLAYERS];
////////////////////////////////////////////////////////////////////////////////
#define TEAM_ARMY 1
#define TEAM_TERROR 2
#define TEAM_ARMY_COLOR 0x00FF00AA // Bright Green
#define TEAM_TERROR_COLOR 0xFF00FFAA // Bright Purple
////////////////////////////////////////////////////////////////////////////////
main()
{
print("\nPrefect Projects - World War GM Loaded");
}
////////////////////////////////////////////////////////////////////////////////
public OnGameModeInit()
{
SetGameModeText("World War");
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(102, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(103, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
AddPlayerClass(104, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
////////////////////////////////////////////////////////////////////////////////
public OnGameModeExit()
{
return 1;
}
////////////////////////////////////////////////////////////////////////////////
public OnPlayerRequestClass(playerid, classid)
{
SetupPlayerForClassSelection(playerid);
if(classid == 105 || classid == 106 || classid == 107) {
GameTextForPlayer(playerid,"~g~Army",1000,1);
} else if(classid == 102 || classid == 103 || classid == 104) {
GameTextForPlayer(playerid,"~r~Terrorists",1000,1);
}
SetPlayerTeamFromClass(playerid, classid);
return 1;
}
////////////////////////////////////////////////////////////////////////////////
public SetupPlayerForClassSelection(playerid)
{
SetPlayerInterior(playerid,14);
SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
SetPlayerFacingAngle(playerid, 270.0);
SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
}
////////////////////////////////////////////////////////////////////////////////
public OnPlayerSpawn(playerid)
{
SetPlayerToTeamColor(playerid);
SetPlayerInterior(playerid,0);
return 1;
}
////////////////////////////////////////////////////////////////////////////////
SetPlayerTeamFromClass(playerid, classid)
{
if (classid == 105 || classid == 106 || classid == 107)
{
WarTeam[playerid] = TEAM_ARMY;
}
else
{
WarTeam[playerid] = TEAM_TERROR;
}
}
////////////////////////////////////////////////////////////////////////////////
SetPlayerToTeamColor(playerid)
{
if (WarTeam[playerid] == TEAM_ARMY)
{
SetPlayerColor(playerid, TEAM_ARMY_COLOR);
}
else if (WarTeam[playerid] == TEAM_TERROR)
{
SetPlayerColor(playerid, TEAM_TERROR_COLOR);
}
}