23.04.2012, 23:35
Here is a easier way.
Forward
On Gamemode init add this
If not this
On the PlayerRequestSpawn put this
Easier and simple to make more class's
Then on the setupplayerteamclass put thispublic
pawn Code:
new gTeam[MAX_PLAYERS];
pawn Code:
forward SetPlayerTeamFromClass(playerid, classid);
On Gamemode init add this
pawn Code:
AddPlayerClassEx(1,100,0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
pawn Code:
AddPlayerClass(1,100,0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
On the PlayerRequestSpawn put this
pawn Code:
public OnPlayerRequestSpawn(playerid)
{
SetPlayerTeamFromClass(playerid, classid);
return 1;
}
Then on the setupplayerteamclass put thispublic
pawn Code:
public SetPlayerTeamFromClass(playerid, classid)
{
{
if (classid == 100))
{
gTeam[playerid] = Admin;
GameTextForPlayer(playerid, "Admin", 500, 5);
SendClientMessage(playerid, /*Your color here example*/COLOR_RED, "This class is only for administrators");
return 1;
}
return 1;
}