Raised This Month: $ Target: $400
 0% 

Ham_TakeDamage problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 07-07-2010 , 09:33   Ham_TakeDamage problem
Reply With Quote #1

Something is wrong here:

PHP Code:
public monster_damaged(id,Inflictor,Attacker,Float:Damage,DamageBits
{
    if(
hvm_skill8[id] > 0)
    {
        new 
Floatmultiplier
        
switch(hvm_skill8[id])
        {
            case 
1multiplier 1.1
            
case 2multiplier 1.2
            
case 3multiplier 1.3
            
default: multiplier 1.0
        
}
        
        
SetHamParamFloat(4Damage multiplier)
        
g_Damage[Attacker] += Damage multiplier
        
    
}
    else
        
g_Damage[Attacker] += Damage

Throws out index out of bounds error. What does it come from? g_Damage is a floating number. The damage is handled well (I think), but the g_Damage is not changed. It worked without the if(hvm_skill8[id] > 0) check.
Backstabnoob is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-07-2010 , 09:35   Re: Ham_TakeDamage problem
Reply With Quote #2

Make sure Attacker is a player.
__________________
Arkshine is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 07-07-2010 , 09:54   Re: Ham_TakeDamage problem
Reply With Quote #3

Fixed. Actually the issue was in [id], instead of [Attacker]. Lol.
Backstabnoob is offline
Flipper_SPb
Senior Member
Join Date: Jun 2009
Location: Worldspawn
Old 07-07-2010 , 10:10   Re: Ham_TakeDamage problem
Reply With Quote #4

What's the size of g_Damage array?
Flipper_SPb is offline
Send a message via ICQ to Flipper_SPb
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 07:12.


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