Added style/stylesttings to OnUserCmdPre. (#458)

* Shavit_OnUserCmdPre - the prefix didn't fit to the title.
This commit is contained in:
shavitush 2017-08-02 21:32:26 +03:00
parent 3ac9e6c9bf
commit ba6be29b5d
2 changed files with 6 additions and 2 deletions

View File

@ -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.

View File

@ -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)