Skip to content

Commit

Permalink
v1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
WessTorn committed Jul 12, 2023
1 parent 743c48c commit da2a111
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 2 deletions.
19 changes: 19 additions & 0 deletions scripting/include/jumpstats/forwards.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
new g_hResetBugForward;
public plugin_init() {
g_hResetBugForward = CreateMultiForward("fwResetBug", ET_IGNORE, FP_CELL);
}
public bug() {
new iReturn;
ExecuteForward(g_hResetBugForward, iReturn, id); // Если нам нужно зафейлить жамп
}
*/

forward fwResetBug(id); // Get reset

public fwResetBug(id) {
reset_stats(id);
g_eFailJump[id] = fj_notshow;
}
1 change: 1 addition & 0 deletions scripting/include/jumpstats/index.inc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <jumpstats/global>
#include <jumpstats/cvars>
#include <jumpstats/cmds>
#include <jumpstats/forwards>
#include <jumpstats/menus>
#include <jumpstats/utils>
#include <jumpstats/prespeed>
Expand Down
4 changes: 2 additions & 2 deletions scripting/jumpstats.sma
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include <jumpstats/index>

public plugin_init() {
register_plugin("HNS JumpStats", "v1.0.3", "WessTorn");
register_plugin("HNS JumpStats", "v1.0.4", "WessTorn");

init_cvars();
init_cmds();

RegisterHookChain(RG_CBasePlayer_Spawn, "rgPlayerSpawn", true);
RegisterHookChain(RG_PM_Move, "rgPM_Move");
RegisterHookChain(RG_PM_Move, "rgPM_Move", true);
RegisterHookChain(RG_PM_AirMove, "rgPM_AirMove", true);

g_hudStrafe = CreateHudSyncObj();
Expand Down
45 changes: 45 additions & 0 deletions scripting/resetbugs.sma
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#include <amxmodx>

new g_hResetBugForward;

new g_szBadCmds[][] = {
"tele", "tp",
"gocheck", "gc",
"stuck", "unstuck",
"start", "reset",
"restart", "spawn", "respawn"
};

public plugin_init() {
register_plugin("Reset jump bugs", "1.0", "WessTorn");

g_hResetBugForward = CreateMultiForward("fwResetBug", ET_IGNORE, FP_CELL);
}

public client_command(id) {
if(is_user_alive(id)) {
new szCommand[32];
read_argv(0, szCommand, charsmax(szCommand));

if(equali(szCommand, "say")) {
read_args(szCommand, charsmax(szCommand));
remove_quotes(szCommand);
}

if(equali(szCommand, "+hook") || equali(szCommand, "-hook")) {
new iReturn;
ExecuteForward(g_hResetBugForward, iReturn, id);
} else if(szCommand[0] == '/' || szCommand[0] == '.') {
copy(szCommand, charsmax(szCommand), szCommand[1]);

for(new i ; i < sizeof(g_szBadCmds) ; i++) {
if(equali(szCommand, g_szBadCmds[i])) {
new iReturn;
ExecuteForward(g_hResetBugForward, iReturn, id);

break;
}
}
}
}
}

0 comments on commit da2a111

Please sign in to comment.