AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Ham_TakeDamage problem (https://forums.alliedmods.net/showthread.php?t=131650)

Backstabnoob 07-07-2010 09:33

Ham_TakeDamage problem
 
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.

Arkshine 07-07-2010 09:35

Re: Ham_TakeDamage problem
 
Make sure Attacker is a player.

Backstabnoob 07-07-2010 09:54

Re: Ham_TakeDamage problem
 
Fixed. Actually the issue was in [id], instead of [Attacker]. Lol.

Flipper_SPb 07-07-2010 10:10

Re: Ham_TakeDamage problem
 
What's the size of g_Damage array?


All times are GMT -4. The time now is 07:12.

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