18.06.2012, 18:12
The teams arent working, I do not get the clientmessage when spawning and I still have the DEADCONNECT color.
If there's any better way of doing this then please show me, I'm not a expert at this kind of stuff.
If there's any better way of doing this then please show me, I'm not a expert at this kind of stuff.
Код:
new gTeam[MAX_PLAYERS]; //Teams #define Team_Police 0 #define Team_Medic 1 #define Team_Civilian 2 public OnPlayerRequestClass(playerid, classid) { SetPlayerColor(playerid, COLOR_DEADCONNECT); SetPlayerPos(playerid, 359.3477, -2077.1821, 8.9575); SetPlayerInterior(playerid, 0); SetPlayerFacingAngle(playerid, 178.0051); SetPlayerCameraPos(playerid, 358.9874,-2084.0168,7.8359); SetPlayerCameraLookAt(playerid, 359.3477, -2077.1821, 8.9575); SetPlayerTeamFromClass(playerid, classid); switch(classid) { case 0..281: { GameTextForPlayer(playerid, "~w~CIVILIAN", 3000, 3); } case 282..287: { GameTextForPlayer(playerid, "~b~~h~MEDIC", 3000, 3); } case 288..299: { GameTextForPlayer(playerid, "~b~POLICE", 3000, 3); } } return 1; } SetPlayerTeamFromClass(playerid, classid) { if(classid >= 288 && classid <= 299) { gTeam[playerid] = Team_Police; } else if(classid >= 282 && classid <= 287) { gTeam[playerid] = Team_Medic; } else if(classid >= 0 && classid <= 281) { gTeam[playerid] = Team_Civilian; } } forward public SetPlayerToTeamColor(playerid); public SetPlayerToTeamColor(playerid) { if(gTeam[playerid] == Team_Police) { SetPlayerColor(playerid, COLOR_BLUE); } if(gTeam[playerid] == Team_Medic) { SetPlayerColor(playerid, COLOR_PINK); } if(gTeam[playerid] == Team_Civilian) { SetPlayerColor(playerid, COLOR_WHITE); } return 1; }