Added mouse[2] to OnUserCmdPre.

This commit is contained in:
shavit 2018-01-31 05:48:59 +02:00
parent 1d34b310d1
commit 8f51d4c964
2 changed files with 5 additions and 3 deletions

View File

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

View File

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