Commit 86c48cf9 authored by Mikleo's avatar Mikleo
Browse files

Hopefully avoid captains being picked for the enemy team.

parent 97b7e28f
Pipeline #8594 passed with stages
in 17 seconds
......@@ -8,7 +8,7 @@
#include <empstats>
#include <updater>
#define PluginVersion "1.07"
#define PluginVersion "1.08"
#define UPDATE_URL "https://sourcemod.docs.empiresmod.com/DraftPick/dist/updater.txt"
......@@ -1527,6 +1527,13 @@ void SetCaptain(int client,origin)
GetClientName(client,clientName,sizeof(clientName));
PrintToChatAll("%s%s\x01 made Captain of %s%s",teamcolors[target],clientName,teamcolors[target],teamnames[target]);
if(stage != STAGE_GAME && squadLimit > 0)
{
// remove from existing squads
FakeClientCommand(client,"emp_squad_leave");
squads[client] = 0;
}
if(stage == STAGE_CAPTAINVOTE && AreCaptainsFull())
{
ChangeStage(STAGE_PICKWAIT);
......@@ -3875,12 +3882,13 @@ RemoveCaptainsFromSquads()
{
if(captains[0] != 0 && IsClientInGame(captains[0]))
{
FakeClientCommandEx(captains[0],"emp_squad_leave");
FakeClientCommand(captains[0],"emp_squad_leave");
}
if(captains[1] != 0 && IsClientInGame(captains[1]))
{
FakeClientCommandEx(captains[1],"emp_squad_leave");
FakeClientCommand(captains[1],"emp_squad_leave");
}
}
SquadModeSetup()
{
......@@ -4600,6 +4608,11 @@ public Action Command_Join_Squad_Draft(client, const String:command[], args)
PrintToChat(client,"\x04[DP] \x01Unable to join squad. The squad limit is:\x04%d",squadLimit);
return Plugin_Handled;
}
if(squadLimit > 0 && (captains[0] == client || captains[1] == client))
{
PrintToChat(client,"You can't join a squad as a captain");
return Plugin_Handled;
}
return Plugin_Continue;
}
......
......@@ -4,7 +4,7 @@
{
"Version"
{
"Latest" "1.07"
"Latest" "1.08"
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment