Raised This Month: $ Target: $400
 0% 

Double Jump Not Working


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
proffs
Senior Member
Join Date: Jul 2013
Old 03-11-2014 , 05:17   Double Jump Not Working
Reply With Quote #1

I want to have Double Jump only when I start a "Game" on the server.

PHP Code:
public client_putinserver(id)
{
     if( 
GAME_FURIEN == g_iCurrentGame )
     {
        
g_doublejump[id] = true
     
}
}

public 
fw_PlayerPreThink(id)
{
    if (
g_iCurrentGame != GAME_FURIEN)
        return 
FMRES_IGNORED
    
if(!is_user_alive(id) || !g_doublejump[id]) return FMRES_IGNORED
    
new nbut pev(id,pev_button);
    new 
obut pev(id,pev_oldbuttons);
    if((
nbut IN_JUMP) && !(pev(id,pev_flags) & FL_ONGROUND) && !(obut IN_JUMP))
    {
        if(
jumpnum[id] < 1)
        {
            
dojump[id] = true;
            
jumpnum[id]++;
            return 
FMRES_IGNORED
        
}
    }
    if((
nbut IN_JUMP) && (pev(id,pev_flags) & FL_ONGROUND))
    {
        
jumpnum[id] = 0;
        return 
FMRES_IGNORED
    
}
    return 
FMRES_IGNORED
}

public 
fw_PlayerPostThink(id)
{
    if (
g_iCurrentGame != GAME_FURIEN)
        return 
FMRES_IGNORED
    
if(!is_user_alive(id) || !g_doublejump[id]) return FMRES_IGNORED
    
if(dojump[id] == true)
    {
        new 
Float:velocity[3];
        
pev(id,pev_velocity,velocity);
        
velocity[2] = random_float(265.0,285.0);
        
set_pev(id,pev_velocity,velocity)
        
dojump[id] = false
        
return FMRES_IGNORED
    
}
    return 
FMRES_IGNORED

Doesn't work, You can only jump 1 time.

I took it from this: https://forums.alliedmods.net/showthread.php?t=90430

Last edited by proffs; 03-11-2014 at 05:17.
proffs 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 05:58.


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