From ba6be29b5d1605e05b1e774417147a57b88ec2e0 Mon Sep 17 00:00:00 2001 From: shavitush Date: Wed, 2 Aug 2017 21:32:26 +0300 Subject: [PATCH] Added style/stylesttings to OnUserCmdPre. (#458) * Shavit_OnUserCmdPre - the prefix didn't fit to the title. --- scripting/include/shavit.inc | 4 +++- scripting/shavit-core.sp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripting/include/shavit.inc b/scripting/include/shavit.inc index dc5c5a6d..8d02ef6d 100644 --- a/scripting/include/shavit.inc +++ b/scripting/include/shavit.inc @@ -285,9 +285,11 @@ stock void FormatSeconds(float time, char[] newtime, int newtimesize, bool preci * @param angles The player's requested viewangles. They will not necessarily be applied as SRCDS itself won't accept every value. * @param status The player's timer status. * @param track The player's timer track. + * @param style The player's bhop style. + * @param stylesettings An array that contains the player's bhop style's settings. * @return Plugin_Continue to let shavit-core keep doing what it does, Plugin_Changed to pass different values. */ -forward Action Shavit_OnUserCmdPre(int client, int &buttons, int &impulse, float vel[3], float angles[3], TimerStatus status, int track); +forward Action Shavit_OnUserCmdPre(int client, int &buttons, int &impulse, float vel[3], float angles[3], TimerStatus status, int track, int style, any stylesttings[STYLESETTINGS_SIZE]); /** * Called when a player's timer starts. diff --git a/scripting/shavit-core.sp b/scripting/shavit-core.sp index f0695ab2..849c1d11 100644 --- a/scripting/shavit-core.sp +++ b/scripting/shavit-core.sp @@ -193,7 +193,7 @@ public void OnPluginStart() gH_Forwards_OnStyleConfigLoaded = CreateGlobalForward("Shavit_OnStyleConfigLoaded", ET_Event, Param_Cell); gH_Forwards_OnDatabaseLoaded = CreateGlobalForward("Shavit_OnDatabaseLoaded", ET_Event, Param_Cell); gH_Forwards_OnChatConfigLoaded = CreateGlobalForward("Shavit_OnChatConfigLoaded", ET_Event); - gH_Forwards_OnUserCmdPre = CreateGlobalForward("Shavit_OnUserCmdPre", ET_Event, Param_Cell, Param_CellByRef, Param_CellByRef, Param_Array, Param_Array, Param_Cell, Param_Cell); + gH_Forwards_OnUserCmdPre = CreateGlobalForward("Shavit_OnUserCmdPre", ET_Event, Param_Cell, Param_CellByRef, Param_CellByRef, Param_Array, Param_Array, Param_Cell, Param_Cell, Param_Cell, Param_Array); LoadTranslations("shavit-core.phrases"); @@ -1747,6 +1747,8 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3 Call_PushArrayEx(angles, 3, SM_PARAM_COPYBACK); Call_PushCell(GetTimerStatus(client)); Call_PushCell(gI_Track[client]); + Call_PushCell(gBS_Style[client]); + Call_PushArray(gA_StyleSettings[gBS_Style[client]], STYLESETTINGS_SIZE); Call_Finish(result); if(result != Plugin_Continue && result != Plugin_Changed)