Raised This Month: $51 Target: $400
 12% 

Need help on error plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
asdfdsdf
AlliedModders Donor
Join Date: Aug 2010
Location: Belgium
Old 11-11-2013 , 18:49   Need help on error plugin
Reply With Quote #1

I have an error on my pluing but i dont know how to fix it anyone can help me ty

This is the error

PHP Code:
[AMXXRun time error 4index out of bounds 
L 11
/12/2013 00:11:45: [AMXX]    [0Jailbreak_Shop.sma::Ham_Damage (line 518
Heres the code

PHP Code:
public Ham_DamageiVictimiAttackerFloat:flDamageFloat:fVecDir[3], tr ) {
    if( 
iVictim != iAttacker && is_user_alive(iAttacker) && is_user_alive(iVictim) && get_user_teamiVictim ) != get_user_teamiAttacker )
    && 
bItems[iAttacker][1]) {
        
SetHamParamFloat(3flDamage 2.0)
    }
    if( 
bItems[iAttacker][8])
    {
        if(
cs_get_user_team(iVictim) == CS_TEAM_CT)
        {
            new 
Float:vec[3];
            new 
Float:oldvelo[3];
            
get_user_velocity(iVictimoldvelo);
            
create_velocity_vector(iVictim iAttacker vec);
            
vec[0] += oldvelo[0];
            
vec[1] += oldvelo[1];
            
set_user_velocity(iVictim vec);
        }
    }
    return 
HAM_IGNORED;

This is line 518 ;
PHP Code:
if( bItems[iAttacker][8]) 
asdfdsdf is offline
baneado
Veteran Member
Join Date: Dec 2012
Location: amxmodx-es.com
Old 11-12-2013 , 16:17   Re: Need help on error plugin
Reply With Quote #2

The victim shouldn't be checked, it's unnecessary.

Show how do you create the variable bItems

edit, with the mobile, sorry if I explain bad.
you must check and return and the the other
PHP Code:
if (iVictim == iAttacker || !is_user_alive(iAttacker))
    return 
HAM_IGNORED;

if (
bItems[iAttacker][1])
    
//continue your code...
else if (bItems[iAttacker][8])
    
//continue... 

Last edited by baneado; 11-12-2013 at 16:28.
baneado 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 07:06.


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