From 8f51d4c964bed8d6875f40ebd1036b3d642f4128 Mon Sep 17 00:00:00 2001 From: shavit Date: Wed, 31 Jan 2018 05:48:59 +0200 Subject: [PATCH] Added `mouse[2]` to OnUserCmdPre. --- addons/sourcemod/scripting/include/shavit.inc | 3 ++- addons/sourcemod/scripting/shavit-core.sp | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/sourcemod/scripting/include/shavit.inc b/addons/sourcemod/scripting/include/shavit.inc index 116232a5..4a257b1c 100644 --- a/addons/sourcemod/scripting/include/shavit.inc +++ b/addons/sourcemod/scripting/include/shavit.inc @@ -297,9 +297,10 @@ stock void FormatSeconds(float time, char[] newtime, int newtimesize, bool preci * @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. + * @param mouse Mouse direction (x, y). * @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, int style, any stylesettings[STYLESETTINGS_SIZE]); +forward Action Shavit_OnUserCmdPre(int client, int &buttons, int &impulse, float vel[3], float angles[3], TimerStatus status, int track, int style, any stylesettings[STYLESETTINGS_SIZE], int mouse[2]); /** * Called just before shavit-core adds time to a player's timer. diff --git a/addons/sourcemod/scripting/shavit-core.sp b/addons/sourcemod/scripting/shavit-core.sp index 7a8cad5f..f8f592fe 100644 --- a/addons/sourcemod/scripting/shavit-core.sp +++ b/addons/sourcemod/scripting/shavit-core.sp @@ -203,7 +203,7 @@ public void OnPluginStart() gH_Forwards_OnStyleConfigLoaded = CreateGlobalForward("Shavit_OnStyleConfigLoaded", ET_Event, Param_Cell); gH_Forwards_OnDatabaseLoaded = CreateGlobalForward("Shavit_OnDatabaseLoaded", ET_Event); 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, Param_Cell, Param_Array); + 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, Param_Array); gH_Forwards_OnTimerIncrement = CreateGlobalForward("Shavit_OnTimeIncrement", ET_Event, Param_Cell, Param_Array, Param_CellByRef, Param_Array); gH_Forwards_OnTimerIncrementPost = CreateGlobalForward("Shavit_OnTimeIncrementPost", ET_Event, Param_Cell, Param_Cell, Param_Array); @@ -1814,7 +1814,7 @@ public void OnGameFrame() } } -public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3]) +public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon, int &subtype, int &cmdnum, int &tickcount, int &seed, int mouse[2]) { if(!IsPlayerAlive(client) || IsFakeClient(client)) { @@ -1846,6 +1846,7 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3 Call_PushCell(gI_Track[client]); Call_PushCell(gBS_Style[client]); Call_PushArray(gA_StyleSettings[gBS_Style[client]], STYLESETTINGS_SIZE); + Call_PushArrayEx(mouse, 2, SM_PARAM_COPYBACK); Call_Finish(result); if(result != Plugin_Continue && result != Plugin_Changed)