05.02.2011, 23:29
Hello everyone, I got the next problem:
I`m trying to make a Team Deathmatch gamemode, I defined Teams but when it comes to SetPlayetTeamFromClass, something goes wrong, I`ll explain:
I use this:
First, defining the teams:
after that, at the bottom of the script, I inserted:
and put SetPlayerTeamFromClass(playerid, classid); at
But, the server recognizes only TEAM_POLICE, the first one.
I get no errors / warnings when I compile it but I tried to make a command only for another gTeam (for example TEAM_HITMAN) and the command wouldn`t work ... The server would not recognize the other teams, beside gTeam[playerid] == TEAM_POLICE ...
Anyone has any solution ? Thank you in advance.
I`m trying to make a Team Deathmatch gamemode, I defined Teams but when it comes to SetPlayetTeamFromClass, something goes wrong, I`ll explain:
I use this:
First, defining the teams:
pawn Код:
new gTeam[MAX_PLAYERS];
pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
switch(classid)
{
case 71, 265, 266, 267, 280, 281, 285:gTeam[playerid] = TEAM_POLICE;
case 163, 164, 165, 166, 233, 286, 287, 295:gTeam[playerid] = TEAM_BUREAU;
case 274, 275, 276, 277, 278, 279:gTeam[playerid] = TEAM_MEDICS;
case 147, 150, 141, 153, 156, 187, 188:gTeam[playerid] = TEAM_LICENSE;
case 61, 142, 169, 170, 211, 253, 255:gTeam[playerid] = TEAM_TAXI;
case 111, 112, 113, 290, 236, 206, 186:gTeam[playerid] = TEAM_BRATVA;
case 124, 125, 126, 217, 258, 259:gTeam[playerid] = TEAM_NUCCI;
case 47, 48, 108, 109, 110, 292:gTeam[playerid] = TEAM_SANGRE;
case 46, 114, 115, 116, 173, 174, 175:gTeam[playerid] = TEAM_VARIOS;
case 66, 67, 72, 133, 179, 181, 192, 191, 190, 201, 202, 247, 248, 254:gTeam[playerid] = TEAM_BIKERS;
case 127, 193, 272, 294:gTeam[playerid] = TEAM_HITMAN;
case 12, 105, 106, 107, 195, 269, 270, 271, 293:gTeam[playerid] = TEAM_GROVE;
case 13, 21, 22, 102, 103, 104, 296, 297, 298:gTeam[playerid] = TEAM_BALLAS;
case 93, 282, 283, 284, 288:gTeam[playerid] = TEAM_SHERIFF;
}
}
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerTeamFromClass(playerid, classid);
return 1;
}
I get no errors / warnings when I compile it but I tried to make a command only for another gTeam (for example TEAM_HITMAN) and the command wouldn`t work ... The server would not recognize the other teams, beside gTeam[playerid] == TEAM_POLICE ...
Anyone has any solution ? Thank you in advance.