Raised This Month: $ Target: $400
 0% 

Run time error 5: memory access


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
taheri6
Member
Join Date: Mar 2006
Old 01-05-2008 , 23:05   Re: Run time error 5: memory access
Reply With Quote #3

spacing got a little wierd in the paste, so forgive that.

PHP Code:
//Called during plugin init 
public Initialize_CLCMD ( )
{
   [...
blah...]
    
register_clcmd "wcentangle""Ult_Entangle",    -1"-Entangle Ultimate" );
   [...
blah...]
}

//Ran when client commands
public Ult_Entangle id )
{

    if ( !
Ult_Can_Use idSKILLIDX_ENTANGLE ) )
    {
        return 
PLUGIN_HANDLED;
    }

    if ( 
is_user_alive id ) && is_user_connectedid ) && !issearching[id] && !ultimateused[id] )
    {
        new 
parm[2];
        
parm[0] = id;
        
parm[1] = ULTIMATESEARCHTIME;
        
Task_Search_Event_Entangle parm );
    }

    return 
PLUGIN_CONTINUE;
}

//Client command function calls this and loops through it on occassion until a match is found
//This is where it errors out in the logs
public Task_Search_Event_Entangle parm[2] )
{
    new 
waitparm[6];
    new 
iparm[2];
    new 
id parm[0];
    new 
enemyzbody;
    new 
counter;

    if ( !
is_user_connectedid ) )
    {
        
icon_controller id );
        return 
PLUGIN_CONTINUE;
    }

    
get_user_aiming id,enemyzbody );

    if ( ( 
get_user_team enemyz ) == SPEC ) || !is_user_connectedenemyz ) )
    {
        
icon_controller id );
        return 
PLUGIN_CONTINUE;
    }

    if ( !
p_resists[enemyz][RESISTIDX_MAGIC])
    {
        
p_resists[enemyz][RESISTIDX_MAGIC] = 0;
    }

    if ( ( 
enemyz <= 32 ) && ( p_resists[enemyz][RESISTIDX_MAGIC] >= RESIST_MAX_VALUE ) || ( !temp_immunity[enemyz] && magic_saving_throw enemyz ) ) )
    {
        
temp_immunity[enemyz] = true;

        if ( 
is_user_connectedenemyz ) && !is_user_botenemyz ) )
        {
            
client_print enemyzprint_chat"%L"enemyz"ULTIMATE_ENGANGLE_RESISTANT"MOD );
        }
        
        
iparm[0] = enemyz;
        
formatiparm[1], 31"%s""Entangling roots" );
        
set_task 5.0"Task_Reset_Immunity"TASK_RESET_IMMUNITY idiparm);
    }

    if ( 
0<enemyz<=32 && !stunned[enemyz] && get_user_team id )!=get_user_team enemyz ) && playeritem[enemyz]!=IMMUNITY && !hasblink[enemyz] && is_user_alive id ) && is_user_alive enemyz ) && !temp_immunity[enemyz] )
    {
        
issearching[id] = false;
        
ultimateused[id] = true;
        
icon_controller id );

        if ( 
is_user_connectedenemyz ) && !is_user_botenemyz ) )
        {
            if ( 
file_exists "sound/warcraft3/entanglingrootstarget1.wav" ) == )
            {
                
emit_sound idCHAN_ITEM"warcraft3/entanglingrootstarget1.wav"1.0ATTN_NORM0PITCH_NORM );
            }
            else
            {
                if ( 
file_exists "sound/weapons/cbar_hitbod3.wav" ) == )
                {
                    
emit_sound id,CHAN_ITEM"weapons/cbar_hitbod3.wav"1.0ATTN_NORM0PITCH_NORM );
                }
            }
        }
        
        
waitparm[0] = enemyz;
        
waitparm[1] = 100;
        
waitparm[5] = floatround get_user_maxspeed enemyz ) );
        
set_user_maxspeed enemyz,1.0 );
        
Task_Entangle_Stop waitparm );

        
stunned[enemyz] = true;
        new 
cooldownparm[1];
        
cooldownparm[0] = id;
        
set_task CVAR_ENTANGLE_COOLDOWN"cooldown"50 idcooldownparm);
    }
    else
    {
        
issearching[id] = true;
        
icon_controller id );
        
counter parm[1];

        while ( 
counter >= )
        {
            
counter -= 10;
            if ( 
counter == )
            {
                
emit_sound idCHAN_ITEM"turret/tu_ping.wav"1.0ATTN_NORM0PITCH_NORM );
            }
        }
        --
parm[1];

        if ( 
parm[1]>&& get_user_health id ) > )
        {
            
set_task 0.1"Task_Search_Event_Entangle"TASK_ULTIMATE_ENTANGLE_SEARCH idparm);
        }
        else
        {
            
issearching[id] = false;
            
icon_controller id );
        }
    }

    return 
PLUGIN_CONTINUE;



Last edited by taheri6; 01-06-2008 at 01:55.
taheri6 is offline
 



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 11:11.


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