was checking for the wrong team and also made autism bots use joinclass and zspawn
This commit is contained in:
parent
bb7c7f8549
commit
d476d8c8bd
@ -372,6 +372,7 @@ public Action check_team(Handle timer, any data)
|
||||
if (specific_bot_player[client] != -1 && GetClientTeam(client) <= CS_TEAM_SPECTATOR)
|
||||
{
|
||||
ChangeClientTeam(client, CS_TEAM_T);
|
||||
CreateTimer(1.0, zspawn, GetClientSerial(client));
|
||||
continue;
|
||||
}
|
||||
if (specific_bot_player[client] != -1)
|
||||
@ -386,7 +387,7 @@ public Action check_team(Handle timer, any data)
|
||||
for (int client = 1; client <= MaxClients; client++)
|
||||
{
|
||||
if (!IsValidClient(client)) continue;
|
||||
if (specific_bot_player[client] == -1 && GetClientTeam(client) > CS_TEAM_SPECTATOR && IsPlayerAlive(client))
|
||||
if (specific_bot_player[client] == -1 && GetClientTeam(client) > CS_TEAM_T && IsPlayerAlive(client))
|
||||
{
|
||||
found_valid_ct = true;
|
||||
break;
|
||||
@ -406,6 +407,21 @@ public Action check_team(Handle timer, any data)
|
||||
return Plugin_Continue;
|
||||
}
|
||||
|
||||
public Action zspawn(Handle hTimer, int Serial)
|
||||
{
|
||||
int client;
|
||||
if ((client = GetClientFromSerial(Serial)) == 0)
|
||||
{
|
||||
return Plugin_Handled;
|
||||
}
|
||||
if (IsValidClient(client))
|
||||
{
|
||||
FakeClientCommandEx(client, "joinclass");
|
||||
FakeClientCommandEx(client, "say /zspawn");
|
||||
}
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
stock bool IsValidClient(int client)
|
||||
{
|
||||
if (client > 0 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user