Skip to content

Commit

Permalink
1.16.3
Browse files Browse the repository at this point in the history
Fixes #7
Added event hooks for tf2 win panel.
Deleted native votes (broken).
  • Loading branch information
caxanga334 committed Mar 12, 2019
1 parent e0f27e9 commit a6cc5ee
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2,611 deletions.
48 changes: 43 additions & 5 deletions addons/sourcemod/scripting/customvotes.sp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

// ====[ DEFINES ]=============================================================
#define PLUGIN_NAME "Custom Votes"
#define PLUGIN_VERSION "1.16.3U-dev"
#define PLUGIN_VERSION "1.16.3U"
#define MAX_VOTE_TYPES 32
#define MAX_VOTE_MAPS 1024
#define MAX_VOTE_OPTIONS 32
Expand Down Expand Up @@ -102,7 +102,7 @@ public Plugin:myinfo =
/* Special thanks to afk manager ( https://forums.alliedmods.net/showthread.php?p=708265 ) and sourcecmod anti-cheat developers.
I looked at their's plugin in order to learn how to add file logging. */
// Special thanks for those who contributed on github
// sneak-it ( https://github.com/caxanga334/cvreduxmodified/pull/1 || https://github.com/caxanga334/cvreduxmodified/pull/3 )
// sneak-it ( https://github.com/caxanga334/cvreduxmodified/pulls?utf8=%E2%9C%93&q=is%3Apr+user%3Asneak-it )
}

// ====[ FUNCTIONS ]===========================================================
Expand Down Expand Up @@ -147,7 +147,9 @@ public OnPluginStart()
if(IsTF2 == true)
{
HookEvent("mvm_wave_failed", TF_WaveFailed);
HookEvent("teamplay_game_over", TF_TeamPlayerGameOver);
HookEvent("teamplay_win_panel", TF_TeamPlayWinPanel);
HookEvent("arena_win_panel", TF_ArenaWinPanel);
HookEvent("pve_win_panel", TF_MVMWinPanel);
}
if(IsCSGO == true)
{
Expand Down Expand Up @@ -1944,7 +1946,7 @@ public Action:TF_WaveFailed(Handle:event, const String:name[], bool:dontBroadcas
}
}
// Cancel votes on Game Over (TF2)
public Action:TF_TeamPlayerGameOver(Handle:event, const String:name[], bool:dontBroadcast)
public Action:TF_TeamPlayWinPanel(Handle:event, const String:name[], bool:dontBroadcast)
{
if(bCancelVoteGameEnd)
{
Expand All @@ -1959,7 +1961,43 @@ public Action:TF_TeamPlayerGameOver(Handle:event, const String:name[], bool:dont
if(bDebugMode) // If debug is enabled, log events
{
LogToFileEx(g_sLogPath,
"[Custom Votes] DEBUG: Event TF_TeamPlayerGameOver.");
"[Custom Votes] DEBUG: Event TF_TeamPlayWinPanel.");
}
}
public Action:TF_ArenaWinPanel(Handle:event, const String:name[], bool:dontBroadcast)
{
if(bCancelVoteGameEnd)
{
if(IsVoteInProgress()) // is vote in progress?
{
CancelVote(); // cancel any running votes on map end.
LogToFileEx(g_sLogPath,
"[Custom Votes] Map end while a vote was in progress, canceling vote.");
}
}

if(bDebugMode) // If debug is enabled, log events
{
LogToFileEx(g_sLogPath,
"[Custom Votes] DEBUG: Event TF_ArenaWinPanel.");
}
}
public Action:TF_MVMWinPanel(Handle:event, const String:name[], bool:dontBroadcast)
{
if(bCancelVoteGameEnd)
{
if(IsVoteInProgress()) // is vote in progress?
{
CancelVote(); // cancel any running votes on map end.
LogToFileEx(g_sLogPath,
"[Custom Votes] Map end while a vote was in progress, canceling vote.");
}
}

if(bDebugMode) // If debug is enabled, log events
{
LogToFileEx(g_sLogPath,
"[Custom Votes] DEBUG: Event TF_MVMWinPanel.");
}
}
// Cancel votes on round end (CSGO)
Expand Down

0 comments on commit a6cc5ee

Please sign in to comment.