Код
#include <sourcemod>
#include <cstrike>
public Plugin:myinfo =
{
name = "CT-T",
author = "DRoN4Ik",
description = "",
version = "1.5",
url = ""
};
public OnPluginStart()
{
HookEvent("round_end", Event_RoundEnd);
}
public Action:Event_RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
{
for (new i = 1; i <= MaxClients; i++)
{
if(IsClientInGame(i) && GetClientTeam(i) == CS_TEAM_CT && GetEventInt(event, "winner") == CS_TEAM_T)
{
CS_SwitchTeam(i, CS_TEAM_T);
}
}
new target = GetRandomClient(true, false, 2)
if (target != -1)
{
CS_SwitchTeam(target, CS_TEAM_CT);
}
}
Вот код...
А это я убрал т.к не помогло...
Код
GetRandomClient(bool:no_bot = true, bool:alive = false, team = 0)
{
new num = 0, players[MaxClients];
for (new i = 1; i <= MaxClients; i++)
{
if (!IsClientInGame(i) || (no_bot && IsFakeClient(i))) continue;
if ((alive && !IsPlayerAlive(i)) || (0 < team < 4 && GetClientTeam(i) != team)) continue;
players[num++] = i;
}
if (num > 0) return players[GetRandomInt(0, num - 1)];
return -1;
}