Can some one help me to fix this code
L 05/18/2013 - 00:17:45: [AMXX] Run time error 10: native error (native "ArrayGetCell")
L 05/18/2013 - 00:17:45: [AMXX] [0] Remove_forest_woods.sma::pfn_keyvalue (line 70)
PHP Code:
#include <amxmodx>
#include <engine>
new Array:g_hMaterial, Array:g_hModels, Array:g_hEnts, g_iLastEnt, g_iArraySize = -1, bool:g_bCheck = true
public plugin_precache()
{
new szMapName[32]; get_mapname(szMapName, 31)
if(!equali(szMapName, "deathrun_forest"))
{
set_fail_state("Plugin only works on deathrun_forest")
}
g_hMaterial = ArrayCreate(1, 1)
g_hModels = ArrayCreate(3, 1)
g_hEnts = ArrayCreate(1, 1)
}
public plugin_init()
{
register_plugin("Remove W00D", "1.0", "Khalid :)")
g_bCheck = false
new iModel, iEnts = 0
for(new i; i < g_iArraySize; i++)
{
iModel = ArrayGetCell(g_hModels, i)
if(iModel < 41 /* Explosion box trap model num */)
{
remove_entity(ArrayGetCell(g_hEnts, i))
iEnts++
server_print("Removed")
}
}
ArrayDestroy(g_hMaterial)
ArrayDestroy(g_hModels)
ArrayDestroy(g_hEnts)
if(iEnts == 6)
{
set_fail_state("Removed ALL (6) func_breakable wood")
}
}
public pfn_keyvalue(iEnt)
{
if(!g_bCheck)
{
return;
}
new szClassName[31], szKeyName[31], szValue[5]
copy_keyvalue(szClassName, 30, szKeyName, 30, szValue, 4)
if(!equal(szClassName, "func_breakable"))
{
return;
}
if(iEnt != g_iLastEnt)
{
g_iLastEnt = iEnt
}
if(equal(szKeyName, "material") && szValue[0] == '1' && szValue[1] == EOS)
{
g_iArraySize++
ArrayPushCell(g_hMaterial, str_to_num(szValue))
ArrayPushCell(g_hEnts, iEnt)
return;
}
if(equal(szKeyName, "model") && ArrayGetCell(g_hMaterial, g_iArraySize))
{
replace(szValue, 4, "*", "")
ArrayPushCell(g_hModels, str_to_num(szValue))
}
}
https://forums.alliedmods.net/showthread.php?t=216162

Help is some one can
__________________