Raised This Month: $ Target: $400
 0% 

My game crash it when i hit a player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nax0ne
Senior Member
Join Date: Jul 2011
Location: Chile
Old 05-01-2016 , 17:40   My game crash it when i hit a player
Reply With Quote #1

My problem is when i hit a player, my game crash it and I discovered that the problem comes from these two forwards:

PHP Code:
public ham_TakeDamage_PreiVictimiInflictoriAttackerFloat:flDamageiBits )
{
    if ( !
is_user_aliveiAttacker ) )
        return 
HAM_IGNORED;
        
    static 
Float:flPlayerDmgPower;
    
flPlayerDmgPower flDamage g_flDamagePoweriAttacker ];
    
    if ( 
get_user_weaponiAttacker ) == CSW_KNIFE )
        
SetHamParamFloat4g_bPlayerIsZombieiAttacker ] ? random_float4.08.0 ) : 2.0 flPlayerDmgPower ); 
        
    if ( !
g_bPlayerIsZombieiAttacker ] && iBits & ( << 24 ) )    
    {
        if( 
iAttacker == iVictim ) return HAM_IGNORED;
        
        
SetHamParamFloat43.0 flPlayerDmgPower );
        return 
HAM_HANDLED;
    }
    
    if ( !
g_bPlayerIsZombieiAttacker ] )    
        
SetHamParamFloat4flPlayerDmgPower );    
    
    return 
HAM_IGNORED;

PHP Code:
public ham_TakeDamage_PostiVictimiInflictoriAttackerFloat:flDamageiBits )
{
    if ( !
is_user_aliveiAttacker ) )
        return 
HAM_IGNORED;    
    
    if ( 
g_bPlayerIsZombieiVictim ] )    
        
set_pdata_floatiVictim1080.9 );
    else
        
set_pdata_floatiVictim1081.0 );
    
    return 
HAM_IGNORED;

Something I doing wrong in those codes? I don't get it.
__________________

Last edited by Nax0ne; 05-01-2016 at 17:41.
Nax0ne is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-01-2016 , 20:08   Re: My game crash it when i hit a player
Reply With Quote #2

What is this supposed to do..what is the 108 offset?
Code:
public ham_TakeDamage_Post( iVictim, iInflictor, iAttacker, Float:flDamage, iBits ) {     if ( !is_user_alive( iAttacker ) )         return HAM_IGNORED;             if ( g_bPlayerIsZombie[ iVictim ] )             set_pdata_float( iVictim, 108, 0.9 );     else         set_pdata_float( iVictim, 108, 1.0 );         return HAM_IGNORED; }

Do some debugging. Put some logs\server_prints() in line by line. See how far it gets before throwing an error and you will find the culprit.
__________________

Last edited by Bugsy; 05-01-2016 at 20:12.
Bugsy is offline
Nax0ne
Senior Member
Join Date: Jul 2011
Location: Chile
Old 05-01-2016 , 21:08   Re: My game crash it when i hit a player
Reply With Quote #3

@Bugsy

the 108 offset modify the player velocity.

Anyway, I solved the problem. Thanks for reply.

Close the thread please.
__________________
Nax0ne is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-01-2016 , 21:22   Re: My game crash it when i hit a player
Reply With Quote #4

Glad you were able to solve your problem on your own. Please post your solution to help others who may have the same issue.
__________________

Last edited by Bugsy; 05-01-2016 at 21:23.
Bugsy is offline
Nax0ne
Senior Member
Join Date: Jul 2011
Location: Chile
Old 05-01-2016 , 21:40   Re: My game crash it when i hit a player
Reply With Quote #5

Quote:
Originally Posted by Bugsy View Post
Glad you were able to solve your problem on your own. Please post your solution to help others who may have the same issue.
It sounds strange, but I thought that the problem came from those two forwards ... but then I realized that the problem came from one of my zombie classes.

Hehehehe

Sorry for wasting your time. I swear I didn't know.
__________________
Nax0ne is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 05-02-2016 , 04:03   Re: My game crash it when i hit a player
Reply With Quote #6

Bugsy, by the way, 108 should be m_flPainShock if you haven't found it out yet. Just so other people reading this topic don't get confused.
klippy is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 05-02-2016 , 08:06   Re: My game crash it when i hit a player
Reply With Quote #7

Quote:
Originally Posted by KliPPy View Post
Bugsy, by the way, 108 should be m_flPainShock if you haven't found it out yet. Just so other people reading this topic don't get confused.
Real name seems to be m_flVelocityModifier.
__________________

Last edited by HamletEagle; 05-02-2016 at 08:07.
HamletEagle is offline
Reply


Thread Tools
Display Modes

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 18:34.


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