#define COLOR_BLUE 0x0000BBAA #define COLOR_RED 0xDC143CFF new gTeam[MAX_PLAYERS]; new playersInTeam[2]; public OnPlayerRequestClass(playerid, classid) { if ( playerConnecting[playerid] == 0) { playersInTeam[gTeam[playerid]] -= 1; incar[playerid]=0; } playerConnecting[playerid] = 0; if ( playersInTeam[TEAM_RED] > playersInTeam[TEAM_BLUE]) { SetSpawnInfo( playerid, 0, 154,-1033.7377,-650.6849,33.0270,0.0583,0,0,0,0,0,0 ); SpawnPlayer( playerid ); gTeam[playerid] = TEAM_BLUE; playersInTeam[TEAM_BLUE] += 1; SendClientMessage(playerid, 0xAA3333AA, "meerrooddanblauw"); SetPlayerColor(playerid, COLOR_BLUE); return 1; } if ( playersInTeam[TEAM_BLUE] > playersInTeam[TEAM_RED]) { SetSpawnInfo( playerid, 0, 162,206.0570,-230.1020,2.8289,177.9338,0,0,0,0,0,0 ); SpawnPlayer( playerid ); gTeam[playerid] = TEAM_RED; playersInTeam[TEAM_RED] += 1; SendClientMessage(playerid, 0xAA3333AA, "meerblauwdanrood"); SetPlayerColor(playerid, COLOR_RED); return 1; } if ( playersInTeam[TEAM_BLUE] == playersInTeam[TEAM_RED]) { SetSpawnInfo( playerid, 0, 154,-1033.7377,-650.6849,33.0270,0.0583,0,0,0,0,0,0 ); SpawnPlayer( playerid ); gTeam[playerid] = TEAM_BLUE; playersInTeam[TEAM_BLUE] += 1; SendClientMessage(playerid, 0xAA3333AA, "evenveel :D"); SetPlayerColor(playerid, COLOR_BLUE); return 1; } return 1; } public OnPlayerConnect(playerid) { printf("OnPlayerConnect(%d)", playerid); playerConnecting[playerid] = 1; return 1; }