- twistedeuphoria
- jesuspunk
amx_maxjumps "1"
amx_mjadminonly 0/1
Code: Select all
#include <amxmodx>#include <engine>#include <reapi> #define ADMINACCESS ADMIN_LEVEL_B // for amxx 1.8.2 #if AMXX_VERSION_NUM < 183 #define MAX_CLIENTS 32#endif new pCvar_amx_maxjumps, pCvar_amx_mjadminonlynew jumpnum[MAX_CLIENTS] = 0new bool:g_isAdmin[MAX_CLIENTS] = false public plugin_init(){ register_plugin("MultiJump","1.4","twistedeuphoria/jesuspunk") pCvar_amx_maxjumps = register_cvar("amx_maxjumps","1") pCvar_amx_mjadminonly = register_cvar("amx_mjadminonly","0") RegisterHookChain(RG_CBasePlayer_Jump,"CBasePlayer_Jump")} public _isAdmin(id){ if(get_user_flags(id) & ADMINACCESS ) g_isAdmin[id] = true else g_isAdmin[id] = false} public client_putinserver(id){ jumpnum[id] = 0 _isAdmin(id)} public client_infochanged(id){ _isAdmin(id)} public client_disconnected(id){ jumpnum[id] = 0 g_isAdmin[id] = false} public CBasePlayer_Jump(id){ if(!is_user_alive(id)) return PLUGIN_HANDLED if(get_pcvar_num(pCvar_amx_mjadminonly) && !g_isAdmin[id]) return PLUGIN_HANDLED new obut = get_member(id,m_afButtonLast) if(!(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP) && jumpnum[id] < get_pcvar_num(pCvar_amx_maxjumps)) { static Float:velocity[3] get_entvar(id,var_velocity,velocity) velocity[2] = random_float(265.0,285.0) set_entvar(id,var_velocity,velocity) jumpnum[id]++ } else if(get_entity_flags(id) & FL_ONGROUND) { jumpnum[id] = 0 } return PLUGIN_CONTINUE}