Hi guys, im getting Index out of bounds, but i cant see any error/warning in the code, could be that a enum problem?
Code:
Code:
enum _:eModels
{
MODEL_NAME[100],
MODEL_LOCATION[100],
MODEL_COST
}
new const ModelItems[][ eModels ] =
{
{ "Default", "gign", 0 },
{ "Agent Smith", "agent", 1000 },
{ "Terminator", "terminator", 1500 }
}
public fwSpawn_Post( id )
{
if( is_user_bot( id ) || is_user_hltv( id ) )
return
if( is_user_alive( id ) )
{
set_task( 0.1, "check_model", id + 234 ) //pretty sure set task is not needed, but same error both situations
}
}
public check_model( task )
{
new id = task - 234
if( cs_get_user_team( id ) == CS_TEAM_CT )
{
if( g_iModelSelected[ id ] > 0 )
cs_set_user_model( id, ModelItems[ g_iModelSelected[ id ] ][ MODEL_LOCATION ] ) //this line is giving the warning
}
else if( cs_get_user_team( id ) == CS_TEAM_T )
cs_set_user_model( id, "richtr" )
}
public client_putinserver( id )
{
g_iModelSelected[ id ] = 0
}
public client_disconnedted( id )
{
g_iModelSelected[ id ] = 0
}
Thanks in advance
__________________