Raised This Month: $ Target: $400
 0% 

Memory access


Post New Thread Reply   
 
Thread Tools Display Modes
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
K1d0x
Senior Member
Join Date: Apr 2012
Location: Copenhagen, Denmark
Old 07-10-2012 , 09:11   Re: Memory access
Reply With Quote #2

Modify arrays in 33

ex:
new arayx[33]
K1d0x is offline
Send a message via Yahoo to K1d0x Send a message via Skype™ to K1d0x
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-10-2012 , 09:49   Re: Memory access
Reply With Quote #3

Quote:
Originally Posted by K1d0x View Post
Modify arrays in 33

ex:
new arayx[33]
what does it have to do with that?
The error is about fm_cs_reset_user_model
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive

Last edited by Diegorkable; 07-10-2012 at 09:49.
Diegorkable is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 07-10-2012 , 09:53   Re: Memory access
Reply With Quote #4

Why are you using Fakemeta instead of CStrike?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-10-2012 , 09:55   Re: Memory access
Reply With Quote #5

Quote:
Originally Posted by YamiKaitou View Post
Why are you using Fakemeta instead of CStrike?
Looks like code from here since cs_set_user_model() can cause problems.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-11-2012 , 06:39   Re: Memory access
Reply With Quote #6

Quote:
Originally Posted by Exolent[jNr] View Post
Looks like code from here since cs_set_user_model() can cause problems.
Yes, but what do I do to fix the errors? Its spamming my error logs with 40k lines a day
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive
Diegorkable 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 15:09.


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