Raised This Month: $ Target: $400
 0% 

Memory access


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-10-2012 , 07:39   Memory access
Reply With Quote #1

Hey guys,

I have a plugin which gives me in 1 specific function tons of errors:

Code:
L 07/10/2012 - 07:32:35: [AMXX] Run time error 5: memory access
when its on debug mode, it says that the problem is here:

PHP Code:
public fwSetClientKeyValueid, const infobuffer[], const key[] )
{
    if ( (
<= id <= g_max_clients) && equalkey"model" ) && is_user_connected(id) )
    {
            
        if ( 
g_has_custom_model[id] )
        {
            static 
currentmodel[32]
            
            for ( new 
sizeof(currentmodel) ; i++ )
                
currentmodel[i] = EOS
                
            fm_cs_get_user_model
idcurrentmodelcharsmaxcurrentmodel ) )
            
            if ( !
equalcurrentmodelg_player_model[id] ) )
                
fm_cs_set_user_modelg_player_model[id], id+MODEL_TASKID )
        }
        
        else
        {
            
fm_cs_reset_user_modelid // line 1436
        
}
        
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;
}

stock fm_cs_reset_user_modelplayer )
{
    
g_has_custom_model[player] = false
    
    dllfunc
DLLFunc_ClientUserInfoChangedplayerengfuncEngFunc_GetInfoKeyBufferplayer ) )
}

// line 7243 doesn't exist.. =\ 
I want that no models will be allowed if you're not marked as having a custom model, so if you set a model it fm_cs_reset_user_model you, but if you're marked as one you'll be set the model you're supposed to be in another variable.

The 2nd part isn't relevant, cuz the error of the Memory access is showing on the line where's the "else", at the fm_cs_reset_user_model.

Code:
L 07/10/2012 - 05:42:47: [AMXX] Displaying debug trace (plugin "plugin.amxx")
L 07/10/2012 - 05:42:47: [AMXX] Run time error 5: memory access 
L 07/10/2012 - 05:42:47: [AMXX]    [0] plugin.sma::fm_cs_reset_user_model (line 7243)
L 07/10/2012 - 05:42:47: [AMXX]    [1] plugin.sma::fwSetClientKeyValue (line 1436)
L 07/10/2012 - 05:42:47: [AMXX] Displaying debug trace (plugin "plugin.amxx")
What is wrong?
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive
Diegorkable is offline
 


Thread Tools
Display Modes

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 15:09.


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