Raised This Month: $ Target: $400
 0% 

Invalid player id 0


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 12-20-2014 , 12:50   Re: Invalid player id 0
Reply With Quote #1

Quote:
Originally Posted by Bugsy View Post
I'm not sure what conditions you are checking, I just took a guess here.
PHP Code:
//If attacker is dead or attacker hurt himself, return.
if( !is_user_aliveidattacker ) || ( this == idattacker ) )
        return 
HAM_IGNORED
I think there should be:
PHP Code:
//If attacker is dead or attacker hurt himself, return.
if( !is_user_aliveidattacker ) && ( this == idattacker ) )
        return 
HAM_IGNORED
I just want to increase or decrease taken damage from knife, weapon or fall.

This is the whole code:
PHP Code:
public fw_PlayerTakeDamage(thisidinflictoridattackerFloat:damagedamagebits)
{
    if(!
is_user_alive(idattacker) || this == idattacker)
        return 
HAM_IGNORED;
    
    if(
get_user_weapon(idattacker) != CSW_KNIFE
    { 
        
damage += // here we increase damage by shooting
    
}
    else
    {
        
damage += // here we increase damage by knife
    
}
    
    
damage -= // here we reduce damage from shooting
        
    
SetHamParamFloat(4damage);
    
    if(
damagebits DMG_FALL)
    {
        
damage -= // here we reduce damage from falling
        
        
SetHamParamFloat(4damage);
    }

Could I detected using the damagebits parameter when damage is caused by a knife and when a weapon?

Last edited by KiLLeR.; 12-20-2014 at 13:02.
KiLLeR. 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 15:18.


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