Commit 54308848 authored by Mikleo's avatar Mikleo
Browse files

--

parent af968fd3
......@@ -8,7 +8,7 @@
#include <empstats>
#include <updater>
#define PluginVersion "v0.81"
#define PluginVersion "v0.82"
#define UPDATE_URL "https://sourcemod.docs.empiresmod.com/DraftPick/dist/updater.txt"
......@@ -38,6 +38,9 @@ public Plugin myinfo =
#define MODE_AUTOSQUADDRAFT 4
#define MODE_RANKEDMATCH 5
#define SPECMODE_FREELOOK 7
#define SPECMODE_NONE 0
#define RMINFOPAGE "http://forums.empiresmod.com/index.php?threads/sm-plugin-draft-pick.20937/page-2#post-545791"
......@@ -48,7 +51,7 @@ int stage = STAGE_DISABLED;
#define TEAM_BE 1;
ConVar cv_autobalance,cv_autoassign,cv_allowspectators,dp_draft,dp_captain_vote_time,dp_pick_wait_time,dp_pick_initial_multiplier,dp_time_increment,dp_in_draft,dp_maxpick,dp_squadlimitdefault,dp_autopick_randomizer,sc_showautoassign;
ConVar cv_autobalance,cv_autoassign,cv_allowspectators,dp_draft,dp_captain_vote_time,dp_pick_wait_time,dp_pick_initial_multiplier,dp_time_increment,dp_in_draft,dp_maxpick,dp_squadlimitdefault,dp_autopick_randomizer,sc_showautoassign,dp_use_teamswitch;
//sound convars
ConVar dp_music,dp_music_volume,dp_pick_music,dp_pick_music_repeat,dp_pick_end_sound,dp_join_music,dp_your_turn_sound,dp_opp_turn_sound,dp_min_players;
......@@ -249,7 +252,7 @@ public void OnPluginStart()
dp_autopick_randomizer = CreateConVar("dp_autopick_randomizer", "20.0", "");
dp_use_teamswitch = CreateConVar("dp_use_teamswitch", "1", "");
// create the directory for the teams
CreateDirectory("addons/sourcemod/data/draftpick/teams",3);
CreateDirectory("addons/sourcemod/data/draftpick/autopick",3);
......@@ -268,7 +271,7 @@ public void OnPluginStart()
g_DraftStart = CreateGlobalForward("OnDraftStart", ET_Ignore,Param_Cell);
g_DraftEnd = CreateGlobalForward("OnDraftEnd", ET_Ignore,Param_Cell,Param_Cell);
if (LibraryExists("updater"))
{
Updater_AddPlugin(UPDATE_URL);
......@@ -595,6 +598,8 @@ public Action Command_Join_Team(int client, const String:command[], args)
{
if(!enabled)
return Plugin_Continue;
GetCmdArg(1, arg1, sizeof(arg1));
int team = StringToInt(arg1);
......@@ -928,7 +933,7 @@ void ExecuteBatchJoin()
ForceSwitchTeam(client,teamToChoose + 2);
GetClientName(client,clientName,sizeof(clientName));
PrintToChatAll("%s supposed to join %s",clientName,teamnames[teamToChoose]);
//PrintToChatAll("%s supposed to join %s",clientName,teamnames[teamToChoose]);
joiningPlayers.Erase(bestClient);
}
}
......@@ -1133,8 +1138,7 @@ public Action Event_PlayerTeam(Event event, const char[] name, bool dontBroadcas
int gameTeam = GetDraftTeam(client);
if((stage == STAGE_CAPTAINVOTE || stage == STAGE_PICKWAIT) && team >= 2)
{
PrintToChat(client,"\x04[DP] \x01Draft Mode: Please wait to be drafted by a team captain." ,teamcolors[0]);
......@@ -2397,8 +2401,31 @@ int GetIdentity(int client)
}
void ForceTeam(int client,int team)
{
FakeClientCommandEx(client, "jointeam %d", team);
int oldTeam = GetClientTeam(client);
if(oldTeam == team)
return;
if(dp_use_teamswitch.IntValue == 1)
{
SetEntityMoveType(client, MOVETYPE_NONE);
if(team == 1)
{
FakeClientCommandEx(client, "jointeam %d", team);
}
else if(team >=2)
{
// set obsmode to none enables players to spawn
SetEntProp(client, Prop_Data, "m_iObserverMode", SPECMODE_NONE);
// forum guy said it could mess with physics also? just in case.
SetEntProp(client,Prop_Data,"m_afPhysicsFlags",GetEntProp(client,Prop_Data,"m_afPhysicsFlags") &~ 8);
ChangeClientTeam(client,team);
}
}
else
{
FakeClientCommandEx(client, "jointeam %d", team);
}
}
void ForceSwitchTeam(int client,int team)
......@@ -4167,7 +4194,7 @@ void SetupText()
else
{
SetHudTextParams(-1.0, 0.02, 6.5, 240, 255, 255, 255);
ShowHudTextAll(10,"Automatic Draft");
ShowHudTextAll(5,"Automatic Draft");
}
TextUpdateHandle = CreateTimer(6.0, Timer_DrawText);
......@@ -4420,7 +4447,8 @@ LoadMusic(char[] path,ArrayList list)
public Action Command_DraftMusic(int client, int args)
{
// allow no argument
if(!GetCmdArg(1, arg1, sizeof(arg1)))
{
arg1 = "1";
......
......@@ -4,7 +4,7 @@
{
"Version"
{
"Latest" "v0.81"
"Latest" "v0.82"
}
}
......
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