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

Make a player jump on a ball (NBA Jam Mod)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mabaclu
Senior Member
Join Date: Jun 2010
Location: Portugal
Old 03-27-2011 , 10:32   Make a player jump on a ball (NBA Jam Mod)
Reply With Quote #1

Hello,
I've finished a CS mod called NBAJam where people can play basketball. Players can dribble the ball by throwing it to the ground and jumping over it (ball hop).
The problem is that when I transfered the plugin from my local dedicated server to a public one I noticed that sometimes (maybe 1 in each 6 dribbles) the player isn't able to jump over the ball.
I've stolen the jump code from a bunnyhop plugin:
PHP Code:
if ( !(flags FL_ONGROUND) )
                return 
PLUGIN_CONTINUE
static iOwneriOwner pevg_iBallpev_iuser1 );
                
                new 
Float:velocity[3]
                
entity_get_vector(idEV_VEC_velocityvelocity)
                
velocity[2] += 250.0
                entity_set_vector
(idEV_VEC_velocityvelocity)
                
entity_set_int(idEV_INT_gaitsequence6)    // Play the Jump Animation 
I don't know if this is a lag problem but please help me to solve it. If you didn't understand what I wrote please PM me and I'll give you my server IP so you can test it yourself. Thanks.
__________________

Last edited by mabaclu; 04-10-2011 at 06:57. Reason: Change title
mabaclu is offline
mabaclu
Senior Member
Join Date: Jun 2010
Location: Portugal
Old 04-11-2011 , 09:26   Re: Make a player jump on a ball (NBA Jam Mod)
Reply With Quote #2

bump
__________________
mabaclu is offline
kotinha
Senior Member
Join Date: Jun 2009
Location: Alentejo, Portugal :)
Old 04-12-2011 , 07:06   Re: Make a player jump on a ball (NBA Jam Mod)
Reply With Quote #3

Help him, this mod looks nice, I want to play it
__________________
"If God exists, I hope he has a good excuse." - Woody Allen
kotinha is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-12-2011 , 09:09   Re: Make a player jump on a ball (NBA Jam Mod)
Reply With Quote #4

r u using client_prethink?
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
mabaclu
Senior Member
Join Date: Jun 2010
Location: Portugal
Old 04-12-2011 , 11:14   Re: Make a player jump on a ball (NBA Jam Mod)
Reply With Quote #5

I have already used client_prethink but then I changed to:
register_forward(FM_PlayerPreThink, "PlayerPreThink", 0)

And it still didn't work.
__________________
mabaclu is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-12-2011 , 12:04   Re: Make a player jump on a ball (NBA Jam Mod)
Reply With Quote #6

try it with Ham_Player_Jump.

idk if this helps but i had the same problem with prethink.

i hope it helps.
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
mabaclu
Senior Member
Join Date: Jun 2010
Location: Portugal
Old 04-12-2011 , 12:09   Re: Make a player jump on a ball (NBA Jam Mod)
Reply With Quote #7

Thanks, I'm going to try it now. Anyway I must say that I've made some more tests in my dedicated server and I had the problem. So it seems the bug also occurs in my local server.
__________________
mabaclu is offline
mabaclu
Senior Member
Join Date: Jun 2010
Location: Portugal
Old 04-12-2011 , 12:37   Re: Make a player jump on a ball (NBA Jam Mod)
Reply With Quote #8

It's still not working.

Here's the ball brain (coded by xPaw):
PHP Code:
// BALL BRAIN :)
////////////////////////////////////////////////////////////
public FwdThinkBalliEntity ) {
if( !
is_valid_entg_iBall ) )
    return 
PLUGIN_HANDLED;

entity_set_floatiEntityEV_FL_nextthinkhalflife_time( ) + 0.001 ); // o original dizia 0.05

static Float:vOrigin], Float:vBallVelocity];
entity_get_vectoriEntityEV_VEC_originvOrigin );
entity_get_vectoriEntityEV_VEC_velocityvBallVelocity );

static 
iOwneriOwner peviEntitypev_iuser1 );
static 
iSolidiSolid peviEntitypev_solid );

// Trail --- >
static Float:flGametimeFloat:flLastThink;
flGametime get_gametime( );

if( 
flLastThink flGametime ) {
    if( 
floatroundvector_lengthvBallVelocity ) ) > 10 ) {
        
message_beginMSG_BROADCASTSVC_TEMPENTITY );
        
write_byteTE_KILLBEAM );
        
write_shortg_iBall );
        
message_end( );
        
        
message_beginMSG_BROADCASTSVC_TEMPENTITY );
        
write_byteTE_BEAMFOLLOW );
        
write_shortg_iBall );
        
write_shortg_iTrailSprite );
        
write_byte10 );
        
write_byte10 );
        
write_byte);
        
write_byte50 );
        
write_byte255 );
        
write_byte200 );
        
message_end( );
    }
    
    
flLastThink flGametime 3.0;
}
// Trail --- <

if( iOwner ) {
    static 
Float:vOwnerOrigin];
    
entity_get_vectoriOwnerEV_VEC_originvOwnerOrigin );
    
    static const 
Float:vVelocity] = { 1.01.00.0 };
    
    if( !
is_user_aliveiOwner ) ) {
        
entity_set_intiEntityEV_INT_iuser1);
        
        
vOwnerOrigin] += 5.0;
        
        
entity_set_originiEntityvOwnerOrigin );
        
entity_set_vectoriEntityEV_VEC_velocityvVelocity );
        
        return 
PLUGIN_CONTINUE;
    }
    
    if( 
iSolid != SOLID_NOT )
        
set_peviEntitypev_solidSOLID_NOT );
    
    static 
Float:vAngles], Float:vReturn];
    
entity_get_vectoriOwnerEV_VEC_v_anglevAngles );
    
    
vReturn] = ( floatcosvAngles], degrees ) * 55.0 ) + vOwnerOrigin];
    
vReturn] = ( floatsinvAngles], degrees ) * 55.0 ) + vOwnerOrigin];
    
vReturn] = vOwnerOrigin];
    
vReturn] -= ( entity_get_intiOwnerEV_INT_flags ) & FL_DUCKING ) ? 10 30;
    
    
entity_set_vectoriEntityEV_VEC_velocityvVelocity );
    
entity_set_originiEntityvReturn );
    } else {
    if( 
iSolid != SOLID_BBOX )
        
set_peviEntitypev_solidSOLID_BBOX );
    
    static 
Float:flLastVerticalOrigin;
    
    if( 
vBallVelocity] == 0.0 ) {
        static 
iCounts;
        
        if( 
flLastVerticalOrigin vOrigin] ) {
            
iCounts++;
            
            if( 
iCounts 10 ) {
                
iCounts 0;
                
                
UpdateBall);
            }
            } else {
            
iCounts 0;
            
            if( 
PointContentsvOrigin ) != CONTENTS_EMPTY )
                
UpdateBall);
        }
        
        
flLastVerticalOrigin vOrigin];
    }
}

return 
PLUGIN_CONTINUE;

__________________
mabaclu is offline
mabaclu
Senior Member
Join Date: Jun 2010
Location: Portugal
Old 06-25-2012 , 17:33   Re: Make a player jump on a ball (NBA Jam Mod)
Reply With Quote #9

bump
__________________
mabaclu 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 12:26.


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