AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need help on error plugin (https://forums.alliedmods.net/showthread.php?t=229662)

asdfdsdf 11-11-2013 18:49

Need help on error plugin
 
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]) 


baneado 11-12-2013 16:17

Re: Need help on error plugin
 
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... 



All times are GMT -4. The time now is 23:21.

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