Hi all,
I need a plugin to give multijump to a player with level B access flag
I found this code but I do not know how I can do it to give access only to the players with admin level b
PHP Code:
// Admin access flag(s) required if "mp_multijumps_adminonly" greater than 0
#define ADMIN_MULTIJUMP ADMIN_ADMIN
#include amxmod
#include amxmisc
#include VexdUM
#define MAX_PLAYERS 32
#define m_afButtonPressed 246
#define m_flFallVelocity 251
new g_iJumpCount[MAX_PLAYERS+1]
new g_pCvarMultiJumps, g_pCvarTeamAllowed, g_pCvarOnlyAdmins, g_pCvarMaxFallVelocity, g_pCvarJumpVelocity
public plugin_init() {
register_plugin("Multi Jumps", "0.0.7", "ConnorMcLeod")
g_pCvarMultiJumps = register_cvar("mp_multijumps", "1") // number of jumps
g_pCvarTeamAllowed = register_cvar("mp_multijumps_team", "3") // 0: Nobody, 1: TERRORISTS, 2: CTs, 3: ALL
g_pCvarOnlyAdmins = register_cvar("mp_multijumps_adminonly", "0") // 0: by team, 1: admins with ADMIN_MULTIJUMP access
g_pCvarMaxFallVelocity = register_cvar("mp_multijump_maxfallvelocity", "500") // max fall velocity to make work multijump
g_pCvarJumpVelocity = register_cvar("mp_multijumps_jumpvelocity", "268.328157") // jump velocity
}
public client_prethink(id) {
if(!is_user_alive(id) || !(entity_get_int(id, EV_INT_button) & IN_JUMP))
return
new fFlags = entity_get_int(id, EV_INT_flags)
if(fFlags & FL_ONGROUND) {
g_iJumpCount[id] = 0
return
}
if(fFlags & FL_WATERJUMP
|| entity_get_int(id, EV_INT_waterlevel) >= 2
|| !(get_offset_int(id, m_afButtonPressed) & IN_JUMP))
return
new iMulti = get_cvarptr_num(g_pCvarMultiJumps)
if(iMulti > 0) {
if((get_cvarptr_num(g_pCvarOnlyAdmins) <= 0 || access(id, ADMIN_MULTIJUMP))
&& get_cvarptr_num(g_pCvarTeamAllowed) & get_offset_int(id, 114)) {
/*if((iOnlyAdmins = get_cvarptr_num(g_pCvarOnlyAdmins)) <= 0 && get_cvarptr_num(g_pCvarTeamAllowed) & get_offset_int(id, 114)
|| iOnlyAdmins > 0 && access(id, ADMIN_MULTIJUMP)) {*/
if(get_offset_float(id, m_flFallVelocity) < get_cvarptr_float(g_pCvarMaxFallVelocity)
&& ++g_iJumpCount[id] <= iMulti) {
new Float:fVelocity[3]
entity_get_vector(id, EV_VEC_velocity, fVelocity)
fVelocity[2] = get_cvarptr_float(g_pCvarJumpVelocity)
entity_set_vector(id, EV_VEC_velocity, fVelocity)
}
}
}
}