Ich hab 2 Teams erstellt, und ein Team balancer, aber wenn man spawnt, egal welchen skin man weahlt, den jenigen wird immer das erste Team zugewiesen.
Und das 2 problem wenn ich jetzt F4, /kill mache, und spawnen will, sagt der Team balancer das beide Teams voll sind o.o
#define TEAM_ONE 0
#define TEAM_TWO 1
new kc1,kc2;
new RoundTime = 60000*11;
CMD:kill(playerid,params[])return SetPlayerHealth(playerid,0.0);
new count1,count2;
static gTeam[MAX_PLAYERS];
main(){}
public OnGameModeInit()
{
kc1 = 0;
kc2 = 0;
AddPlayerClassEx(0,147, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
AddPlayerClassEx(1,189, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 373.5325,185.8794,1008.8679);
SetPlayerCameraPos(playerid,375.3890,182.6208,1010.0334);
SetPlayerInterior(playerid,3);
SetPlayerFacingAngle(playerid,1008.8679);
SetPlayerCameraLookAt(playerid, 373.5325,185.8794,1008.8679);
switch(classid)
{
case 147: gTeam[playerid] = TEAM_ONE;
case 189: gTeam[playerid] = TEAM_TWO;
}
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(gTeam[playerid]==TEAM_ONE) count1--;
else if (gTeam[playerid]==TEAM_TWO) count2--;
return 1;
}
stock SpawnRed(playerid)
{
new rand = random(sizeof(SpawnsRed));
SetPlayerPos(playerid,SpawnsRed[rand][0],SpawnsRed[rand][1],SpawnsRed[rand][2]);
GivePlayerWeapon(playerid,24,150);
GivePlayerWeapon(playerid,29,570);
GivePlayerWeapon(playerid,25,150);
return 1;
}
stock SpawnBlue(playerid)
{
new rand = random(sizeof(SpawnsBlue));
SetPlayerPos(playerid,SpawnsBlue[rand][0],SpawnsBlue[rand][1],SpawnsBlue[rand][2]);
GivePlayerWeapon(playerid,24,150);
GivePlayerWeapon(playerid,29,570);
GivePlayerWeapon(playerid,25,150);
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerInterior(playerid,INTERIOR);
if (gTeam[playerid] == TEAM_ONE) { count1++; SetPlayerColor(playerid,0xFF0000FF); SpawnRed(playerid); }
else if (gTeam[playerid] == TEAM_TWO) { count2++; SetPlayerColor(playerid,0x0000FFFF); SpawnBlue(playerid); }
TextDrawHideForPlayer(playerid,Textdraw4);
TextDrawHideForPlayer(playerid,Textdraw5);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(gTeam[killerid]==TEAM_ONE) { kc1++; }
if(gTeam[killerid]==TEAM_TWO) { kc2++; }
if(gTeam[playerid]==TEAM_ONE) count1--;
else if (gTeam[playerid]==TEAM_TWO) count2--;
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
if ((count1 > count2) && gTeam[playerid] == TEAM_ONE)
{
SendClientMessage(playerid,0xFF000000, "[BALANCER]==[ Team voll, bitte das andere Team beitreten ]==");
return 0;
}
else if ((count2 > count1) && gTeam[playerid] == TEAM_TWO)
{
SendClientMessage(playerid,0xFF000000, "[BALANCER]==[ Team voll, bitte das andere Team beitreten ]==");
return 0;
}
return 1;
}
// Ich erkenne den fehler hier wirklich nicht kann mir keiner helfen?