Raised This Month: $ Target: $400
 0% 

Ham_TakeDamage Error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bloody806
Member
Join Date: Jun 2012
Location: Czech Republic
Old 04-17-2013 , 13:48   Ham_TakeDamage Error
Reply With Quote #1

Hi i need help with error. Plugin can normal compile but dont work Item on this function.
Please help

Here are errors:

L 04/17/2013 - 19:414: [AMXX] Run time error 4: index out of bounds
L 04/17/2013 - 19:414: [AMXX] [0] KnifeShoppp.sma::takeDamage_pre (line 219
)

Code:
PHP Code:
new bool:g_bActived_SuperKnife[33]; 
PHP Code:
RegisterHam(Ham_TakeDamage"player","takeDamage_pre"
PHP Code:
public takeDamage_pre(victimIDinflictorattackerIDFloat:flDmgdmgBits)
{
    if(
g_bActived_SuperKnife[attackerID]) // -------- Here is error --------
    
{
    new 
iTempiWepId;
    
iWepId get_user_weapon(attackerIDiTempiTemp);

    if(
cs_get_user_team(attackerID) == CS_TEAM_T && iWepId == CSW_KNIFE)
    {
        
SetHamParamFloat(4flDmg get_pcvar_float(cvar_dmg))
    }
}
    return 
HAM_IGNORED

__________________

Last edited by bloody806; 04-17-2013 at 13:58.
bloody806 is offline
Send a message via Skype™ to bloody806
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 04-17-2013 , 13:58   Re: Ham_TakeDamage Error
Reply With Quote #2

Add
PHP Code:
if (!is_user_connected(attackerID) || victimID == attackerID) return HAM_IGNORED
baneado is offline
bloody806
Member
Join Date: Jun 2012
Location: Czech Republic
Old 04-17-2013 , 14:12   Re: Ham_TakeDamage Error
Reply With Quote #3

This way?

PHP Code:
public takeDamage_pre(victimIDinflictorattackerIDFloat:flDmgdmgBits)
{
if(
g_bActived_SuperKnife[attackerID] && !is_user_connected(attackerID) || victimID == attackerID) return HAM_IGNORED;  
{
new 
iTempiWepId;
iWepId get_user_weapon(attackerIDiTempiTemp);

if(
cs_get_user_team(attackerID) == CS_TEAM_T && iWepId == CSW_KNIFE)
{
SetHamParamFloat(4flDmg get_pcvar_float(cvar_dmg))
}
}
return 
HAM_IGNORED

__________________

Last edited by bloody806; 04-17-2013 at 14:13.
bloody806 is offline
Send a message via Skype™ to bloody806
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 04-17-2013 , 15:34   Re: Ham_TakeDamage Error
Reply With Quote #4

no,
public takeDamage_pre(victimID, inflictor, attackerID, Float:flDmg, dmgBits)
{
if(
!is_user_connected(attackerID) || victimID == attackerID) return HAM_IGNORED;

if(g_bActived_SuperKnife[attackerID])
{
........
didoWEE is offline
bloody806
Member
Join Date: Jun 2012
Location: Czech Republic
Old 04-18-2013 , 11:51   Re: Ham_TakeDamage Error
Reply With Quote #5

Thanks for all Now dont show any errors.
__________________
bloody806 is offline
Send a message via Skype™ to bloody806
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 10:56.


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