Raised This Month: $51 Target: $400
 12% 

[Help] edit wall jump


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mikaeel123
Senior Member
Join Date: Oct 2018
Old 06-22-2019 , 10:14   [Help] edit wall jump
Reply With Quote #1

Hi all . i want only vips have wall jump to this plugin . ( ADMIN_RESERVATION )
HOw Do this ?
PHP Code:
#include <amxmodx>
#include <engine>

new bool:caughtJump[33]
new 
bool:doJump[33]
new 
Float:jumpVeloc[33][3]
new 
newButton[33]
new 
numJumps[33]
new 
wallteam

//====================================================================================================
static const TITLE[] = "Wall Jump"
static const VERSION[] = "0.6"
static const AUTHOR[] = "OneEyed"
//====================================================================================================

public plugin_init()
{
    
register_plugin(TITLE,VERSION,AUTHOR)
    
    
register_cvar("walljump_str","300.0")
    
register_cvar("walljump_num","3")
    
register_cvar("walljump_team""0")
    
    
register_touch("player""worldspawn""Touch_World")
    
register_touch("player""func_wall""Touch_World")
    
register_touch("player""func_breakable""Touch_World")


public 
client_disconnect(id) {
    
caughtJump[id] = false
    doJump
[id] = false
    
for(new x=0;x<3;x++)
        
jumpVeloc[id][x] = 0.0
    newButton
[id] = 0
    numJumps
[id] = 0
}

public 
client_PreThink(id)
{
    
wallteam get_cvar_num("walljump_team")
    new 
team get_user_team(id)
    if(
is_user_alive(id) && (!wallteam || wallteam == team)) 
    {
        
newButton[id] = get_user_button(id)
        new 
oldButton get_user_oldbutton(id)
        new 
flags get_entity_flags(id)
        
        
//reset if we are on ground
        
if(caughtJump[id] && (flags FL_ONGROUND)) 
        {
            
numJumps[id] = 0
            caughtJump
[id] = false
        
}
        
        
//begin when we jump
        
if((newButton[id] & IN_JUMP) && (flags FL_ONGROUND) && !caughtJump[id] && !(oldButton IN_JUMP) && !numJumps[id]) 
        {
            
caughtJump[id] = true
            entity_get_vector
(id,EV_VEC_velocity,jumpVeloc[id])
            
jumpVeloc[id][2] = get_cvar_float("walljump_str")
        }
    }
}

public 
client_PostThink(id
{
    if(
is_user_alive(id)) 
    {
        
//do velocity if we walljumped
        
if(doJump[id]) 
        {
            
entity_set_vector(id,EV_VEC_velocity,jumpVeloc[id])
            
            
doJump[id] = false
            
            
if(numJumps[id] >= get_cvar_num("walljump_num")) //reset if we ran out of jumps
            
{
                
numJumps[id] = 0
                caughtJump
[id] = false
            
}
        }
    }
}

public 
Touch_World(idworld
{
    if(
is_user_alive(id)) 
    {
        
//if we touch wall and have jump pressed, setup for jump
        
if(caughtJump[id] && (newButton[id] & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND)) 
        {
            
            
//reverse velocity
            
for(new x=0;x<2;x++)
                
jumpVeloc[id][x] *= -1.0
                
            numJumps
[id]++
            
doJump[id] = true
        
}    
    }


Last edited by Mikaeel123; 06-22-2019 at 10:14.
Mikaeel123 is offline
wilianmaique
BANNED
Join Date: Nov 2016
Old 06-22-2019 , 11:55   Re: [Help] edit wall jump
Reply With Quote #2

Try:

PHP Code:
#include <amxmodx>
#include <engine>

new bool:caughtJump[33]
new 
bool:doJump[33]
new 
Float:jumpVeloc[33][3]
new 
newButton[33]
new 
numJumps[33]
new 
wallteam

//====================================================================================================
static const TITLE[] = "Wall Jump"
static const VERSION[] = "0.6"
static const AUTHOR[] = "OneEyed"
//====================================================================================================

public plugin_init()
{
    
register_plugin(TITLE,VERSION,AUTHOR)
    
    
register_cvar("walljump_str","300.0")
    
register_cvar("walljump_num","3")
    
register_cvar("walljump_team""0")
    
    
register_touch("player""worldspawn""Touch_World")
    
register_touch("player""func_wall""Touch_World")
    
register_touch("player""func_breakable""Touch_World")


public 
client_disconnect(id) {
    
caughtJump[id] = false
    doJump
[id] = false
    
for(new x=0;x<3;x++)
        
jumpVeloc[id][x] = 0.0
    newButton
[id] = 0
    numJumps
[id] = 0
}

public 
client_PreThink(id)
{
    
wallteam get_cvar_num("walljump_team")
    new 
team get_user_team(id)
    if(
is_user_alive(id) && (!wallteam || wallteam == team) && (get_user_flags(id) & ADMIN_RESERVATION)) 
    {
        
newButton[id] = get_user_button(id)
        new 
oldButton get_user_oldbutton(id)
        new 
flags get_entity_flags(id)
        
        
//reset if we are on ground
        
if(caughtJump[id] && (flags FL_ONGROUND)) 
        {
            
numJumps[id] = 0
            caughtJump
[id] = false
        
}
        
        
//begin when we jump
        
if((newButton[id] & IN_JUMP) && (flags FL_ONGROUND) && !caughtJump[id] && !(oldButton IN_JUMP) && !numJumps[id]) 
        {
            
caughtJump[id] = true
            entity_get_vector
(id,EV_VEC_velocity,jumpVeloc[id])
            
jumpVeloc[id][2] = get_cvar_float("walljump_str")
        }
    }
}

public 
client_PostThink(id
{
    if(
is_user_alive(id) && (get_user_flags(id) & ADMIN_RESERVATION)) 
    {
        
//do velocity if we walljumped
        
if(doJump[id]) 
        {
            
entity_set_vector(id,EV_VEC_velocity,jumpVeloc[id])
            
            
doJump[id] = false
            
            
if(numJumps[id] >= get_cvar_num("walljump_num")) //reset if we ran out of jumps
            
{
                
numJumps[id] = 0
                caughtJump
[id] = false
            
}
        }
    }
}

public 
Touch_World(idworld
{
    if(
is_user_alive(id) && (get_user_flags(id) & ADMIN_RESERVATION)) 
    {
        
//if we touch wall and have jump pressed, setup for jump
        
if(caughtJump[id] && (newButton[id] & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND)) 
        {
            
            
//reverse velocity
            
for(new x=0;x<2;x++)
                
jumpVeloc[id][x] *= -1.0
                
            numJumps
[id]++
            
doJump[id] = true
        
}    
    }

wilianmaique is offline
Send a message via Skype™ to wilianmaique
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 06-22-2019 , 12:51   Re: [Help] edit wall jump
Reply With Quote #3

wilianmaique that's super bad.
__________________
Relaxing is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:51.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode