tmp64 / BugfixedHL-Rebased

Bugfixed and improved Half-Life
GNU General Public License v3.0
108 stars 22 forks source link

Multi Jump plugin fail using new client.dll #150

Closed Verculaz closed 1 year ago

Verculaz commented 1 year ago

Everything is great except Multi Jump plugin (amx) on New client.dll failed to work

Spoiler ```sp #include #include #include #define ADMINACCESS ADMIN_CHAT new jumpnum[33] = 0 new bool:dojump[33] = false public plugin_init() { register_plugin("MultiJump","1.1","twistedeuphoria") register_cvar("amx_maxjumps","11") register_cvar("amx_mjadminonly","0") } public client_putinserver(id) { jumpnum[id] = 0 dojump[id] = false } public client_disconnect(id) { jumpnum[id] = 0 dojump[id] = false } public client_PreThink(id) { if(!is_user_alive(id)) return PLUGIN_CONTINUE if(get_cvar_num("amx_mjadminonly") && (!access(id,ADMINACCESS))) return PLUGIN_CONTINUE new nbut = get_user_button(id) new obut = get_user_oldbutton(id) if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP)) { if(jumpnum[id] < get_cvar_num("amx_maxjumps")) { dojump[id] = true jumpnum[id]++ return PLUGIN_CONTINUE } } if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND)) { jumpnum[id] = 0 return PLUGIN_CONTINUE } return PLUGIN_CONTINUE } public client_PostThink(id) { if(!is_user_alive(id)) return PLUGIN_CONTINUE if(get_cvar_num("amx_mjadminonly") && (!access(id,ADMINACCESS))) return PLUGIN_CONTINUE if(dojump[id] == true) { new Float:velocity[3] entity_get_vector(id,EV_VEC_velocity,velocity) velocity[2] = random_float(265.0,285.0) entity_set_vector(id,EV_VEC_velocity,velocity) dojump[id] = false return PLUGIN_CONTINUE } return PLUGIN_CONTINUE } ```
tmp64 commented 1 year ago

This is caused by cl_jumptype 1. In this mode, the jump command is only sent the exact frame that the player touches the ground. It provides jump input buffering to make manual bhop easier. cl_jumptype 0 will fix the problem.