Permalink
Browse files

Add requested forward: TTT_OnRoundSlay

This forward was requested a few days after round slays was added to TTT.
  • Loading branch information...
Bara committed Nov 24, 2018
1 parent 3645b3b commit 031f25c8702f603efb5d093c28f9f2428a504ef5
@@ -504,6 +504,15 @@ native bool TTT_DisableRounds(bool status);
*/
native RoundStatus TTT_GetRoundStatus();
/**
* Called after a player was round slayed.
*
* @param client The client index.
* @param remaining Amount of rounds left
*/
native int TTT_OnRoundSlay(int client, int remaining);
stock void TTT_GetRoleNameByID(int role, char[] name, int length = ROLE_LENGTH)
{
if (role == TTT_TEAM_INNOCENT)
@@ -116,6 +116,7 @@ Handle g_hOnDetectiveMenu = null;
Handle g_hOnCheckCommandAccess = null;
Handle g_hOnPlayerRespawn = null;
Handle g_hOnVersionCheck = null;
Handle g_hOnRoundSlay = null;
bool g_bSourcebans = false;
bool g_bGhostDM = false;
@@ -20,6 +20,7 @@ void InitForwards()
g_hOnCheckCommandAccess = CreateGlobalForward("TTT_OnCheckCommandAccess", ET_Event, Param_Cell, Param_String, Param_String, Param_CellByRef);
g_hOnPlayerRespawn = CreateGlobalForward("TTT_OnPlayerRespawn", ET_Ignore, Param_Cell);
g_hOnVersionCheck = CreateGlobalForward("TTT_OnLatestVersion", ET_Ignore, Param_String);
g_hOnRoundSlay = CreateGlobalForward("TTT_OnRoundSlay", ET_Ignore, Param_Cell, Param_Cell);
}
void InitNatives()
@@ -917,6 +917,11 @@ public Action Timer_Selection(Handle hTimer)
ForcePlayerSuicide(i);
g_iRoundSlays[i]--;
Call_StartForward(g_hOnRoundSlay);
Call_PushCell(i);
Call_PushCell(g_iRoundSlays[i]);
Call_Finish();
// Players was slain, so we should decrease iPlayers by one. Otherwise the balance isn't really correct
iPlayers--;

0 comments on commit 031f25c

Please sign in to comment.