I need tutorial of Teams no Keywords and Scripting Basics i need Tutorial how to create Teams !
This is my GM.
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerTeamFromClass(playerid, classid);
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
Now when i enter to game i will have 2 skins how to give a Game Text on it to players now what team he is?
pawn Код:
#define Civilian 0
#define Cops 1
#define Medic 2
public OnGameModeInit()
{
AddPlayerClass(219, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); // CIVIL // This is 0
AddPlayerClass(280,2281.3210,2429.7224,3.2734,359.5055,3,1,22,50,29,500); // COPS // This is 1
AddPlayerClass(274, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); // MEDIC // This is 2
}
SetPlayerTeamFromClass(playerid, classid)
{
if(classid >= 0 && classid <= 0) SetPlayerTeam(playerid, Civilian); // All ways start with 0
else if(classid >= 1 && classid <= 1) SetPlayerTeam(playerid, Cops);
else if(classid >= 2 && classid <= 2) SetPlayerTeam(playerid, Medic);
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerTeamFromClass(playerid, classid);
if(classid >= 0 && classid <= 0)
{
GameTextForPlayer(playerid, "~r~Civilian", 3000, 3);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 2219.1992,2124.8589,18.0782);
SetPlayerFacingAngle(playerid, 265.7682);
SetPlayerCameraPos(playerid, 2160.5520, 1167.0829, 10.8125);
SetPlayerCameraLookAt(playerid, 2157.1101, 1167.2665, 9.1435);
}
if(classid >= 1 && classid <= 1)
{
GameTextForPlayer(playerid, "~r~Cops", 3000, 3);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 2219.1992,2124.8589,18.0782);
SetPlayerFacingAngle(playerid, 265.7682);
SetPlayerCameraPos(playerid, 2160.5520, 1167.0829, 10.8125);
SetPlayerCameraLookAt(playerid, 2157.1101, 1167.2665, 9.1435);
}
if(classid >= 2 && classid <= 2)
{
GameTextForPlayer(playerid, "~r~Medic", 3000, 3);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 2219.1992,2124.8589,18.0782);
SetPlayerFacingAngle(playerid, 265.7682);
SetPlayerCameraPos(playerid, 2160.5520, 1167.0829, 10.8125);
SetPlayerCameraLookAt(playerid, 2157.1101, 1167.2665, 9.1435);
}
return 1;
}
Try this as it maybe a little better to understand and is a good simple way for teams to be set out
if you need more help or reciveve error then post here and we will continue to help you!!!