Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
sourcemod
DraftPick
Commits
86c48cf9
Commit
86c48cf9
authored
Feb 02, 2020
by
Mikleo
Browse files
Hopefully avoid captains being picked for the enemy team.
parent
97b7e28f
Pipeline
#8594
passed with stages
in 17 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
dist/addons/sourcemod/plugins/draftpick.smx
View file @
86c48cf9
No preview for this file type
dist/addons/sourcemod/scripting/draftpick.sp
View file @
86c48cf9
...
...
@@ -8,7 +8,7 @@
#include <empstats>
#include <updater>
#define PluginVersion "1.0
7
"
#define PluginVersion "1.0
8
"
#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]))
{
FakeClientCommand
Ex
(captains[0],"emp_squad_leave");
FakeClientCommand(captains[0],"emp_squad_leave");
}
if(captains[1] != 0 && IsClientInGame(captains[1]))
{
FakeClientCommand
Ex
(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;
}
...
...
dist/updater.txt
View file @
86c48cf9
...
...
@@ -4,7 +4,7 @@
{
"Version"
{
"Latest" "1.0
7
"
"Latest" "1.0
8
"
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment