Raised This Month: $ Target: $400
 0% 

Editing damage dealt by custom weapons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DeLiriuM
Senior Member
Join Date: Dec 2006
Old 07-26-2011 , 05:32   Re: Editing damage dealt by custom weapons
Reply With Quote #1

Quote:
Originally Posted by Hunter-Digital View Post
Test on non-armored players and print some debug messages to be sure they get damaged by the right values...

Also, alot of wasted calls there, consider this instead:
Code:
    if (get_user_weapon(attacker) == CSW_KNIFE && !IsGrenade(inflictor))
    {
        new Float:fDamage = 0.0

        if(g_Chain[attacker])
           fDamage = 500.0
        else if(g_Electro[attacker])
           fDamage = 80.0
        else if(g_CrowBar[attacker] && get_user_team(attacker) != get_user_team(victim))
           fDamage = 50.0

        if(fDamage > 0.0)
        {
           SetHamParamFloat(4, fDamage)
           client_print(attacker, print_chat, "[debug] Damage changed to %.1f", fDamage)
        }
        else
           client_print(attacker, print_chat, "[debug] No damage change!")
    }
And why are you checking for friendlyfire only on crowbar ?
Thanks!

The plugins isn't mine, but yeah. That's strange, will fix that
__________________
DeLiriuM is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-26-2011 , 17:06   Re: Editing damage dealt by custom weapons
Reply With Quote #2

Also, you were setting integer values into a function that accepts floats.
When the integer is casted into the float value, it isn't the same value anymore.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 01:10.


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