bunny hop solo amin
#1
buenas me ayudan a poner el bunny hop solo para admin este plugins lo consegui en esta misma pagina

Código PHP:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

new const PLUGIN[] = "Bunny Hop"
new const VERSION[] = "1.1"
new const AUTOR[] = "zoolk"

new cvar_bunnyhop_on


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTOR)
    
    
cvar_bunnyhop_on register_cvar("amx_bunnyhop_on""1")
    
    
RegisterHam(Ham_Player_Jump"player""ham_PlayerJump")
}

public 
ham_PlayerJump(id)
{
    
// Ignoramos si la cvar del bunnyhop esta en 0
    
if(!get_pcvar_num(cvar_bunnyhop_on))
        return 
HAM_IGNORED;
    
    
// Eliminamos la desaceleracion despues de saltar
    
pev(idpev_fuser20.0)
    
    static 
flags
    flags 
pev(idpev_flags)
    
    
// No realice bunny hop sobre el agua
    
if((flags FL_WATERJUMP) || !(flags FL_ONGROUND) || pev(idpev_waterlevel) >= 2)
        return 
HAM_IGNORED;
    
    
// Obtenemos el vector de la velocidad
    
static velocity[3]
    
pev(idpev_velocityvelocity)
    
    
// Seteamos el nuevo vector de la velocidad
    
velocity[2] += 250.0
    set_pev
(idpev_velocityvelocity)
    
    return 
HAM_HANDLED;

Responder
#2
Prueba
Código PHP:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>

new const PLUGIN[] = "Bunny Hop"
new const VERSION[] = "1.1"
new const AUTOR[] = "zoolk"

new cvar_bunnyhop_oncvar_bunnyhop_admin


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTOR)
    
    
cvar_bunnyhop_on register_cvar("amx_bunnyhop_on""1")
    
cvar_bunnyhop_admin register_cvar("amx_bunnyhop_admin""1")
    
    
RegisterHam(Ham_Player_Jump"player""ham_PlayerJump")
}

public 
ham_PlayerJump(id)
{
    
// Ignoramos si la cvar del bunnyhop esta en 0
    
if(!get_pcvar_num(cvar_bunnyhop_on))
        return 
HAM_IGNORED;

    
// Ignoramos si el usuario no es admin y es exclusivo de admin
    
if (get_pcvar_num(cvar_bunnyhop_admin) && !is_user_admin(id))
        return 
HAM_IGNORED;
    
    
// Eliminamos la desaceleracion despues de saltar
    
pev(idpev_fuser20.0)
    
    static 
flags
    flags 
pev(idpev_flags)
    
    
// No realice bunny hop sobre el agua
    
if((flags FL_WATERJUMP) || !(flags FL_ONGROUND) || pev(idpev_waterlevel) >= 2)
        return 
HAM_IGNORED;
    
    
// Obtenemos el vector de la velocidad
    
static velocity[3]
    
pev(idpev_velocityvelocity)
    
    
// Seteamos el nuevo vector de la velocidad
    
velocity[2] += 250.0
    set_pev
(idpev_velocityvelocity)
    
    return 
HAM_HANDLED;

“Quien te quiere en su vida, volverá a buscarte”
Qué frase más estúpida
Porque quien te quiere en su vida, jamás se iría.
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)