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 fwSetClientKeyValue( id, const infobuffer[], const key[] )
{
if ( (1 <= id <= g_max_clients) && equal( key, "model" ) && is_user_connected(id) )
{
if ( g_has_custom_model[id] )
{
static currentmodel[32]
for ( new i ; i < sizeof(currentmodel) ; i++ )
currentmodel[i] = EOS
fm_cs_get_user_model( id, currentmodel, charsmax( currentmodel ) )
if ( !equal( currentmodel, g_player_model[id] ) )
fm_cs_set_user_model( g_player_model[id], id+MODEL_TASKID )
}
else
{
fm_cs_reset_user_model( id ) // line 1436
}
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
stock fm_cs_reset_user_model( player )
{
g_has_custom_model[player] = false
dllfunc( DLLFunc_ClientUserInfoChanged, player, engfunc( EngFunc_GetInfoKeyBuffer, player ) )
}
// 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?
__________________