Raised This Month: $ Target: $400
 0% 

Help with this error


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Balck
Senior Member
Join Date: Apr 2013
Location: Kosova-Mitrovica
Old 05-18-2013 , 05:01   Help with this error
Reply With Quote #1

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_hEntsg_iLastEntg_iArraySize = -1bool:g_bCheck true

public plugin_precache()
{
    new 
szMapName[32]; get_mapname(szMapName31)
    if(!
equali(szMapName"deathrun_forest"))
    {
        
set_fail_state("Plugin only works on deathrun_forest")
    }
    
    
g_hMaterial ArrayCreate(11)
    
g_hModels ArrayCreate(31)
    
g_hEnts ArrayCreate(11)
}

public 
plugin_init()
{
    
register_plugin("Remove W00D""1.0""Khalid :)")
    
    
g_bCheck false
    
new iModeliEnts 0
    
for(new ig_iArraySizei++)
    {
        
iModel ArrayGetCell(g_hModelsi)
        
        if(
iModel 41 /* Explosion box trap model num */)
        {
            
remove_entity(ArrayGetCell(g_hEntsi))
            
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(szClassName30szKeyName30szValue4)
    
    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_hMaterialstr_to_num(szValue))
        
ArrayPushCell(g_hEntsiEnt)
        return;
    }
    
    if(
equal(szKeyName"model") && ArrayGetCell(g_hMaterialg_iArraySize))
    {
        
replace(szValue4"*""")
        
        
ArrayPushCell(g_hModelsstr_to_num(szValue))
    }

https://forums.alliedmods.net/showthread.php?t=216162

Help is some one can
__________________
Balck is offline
 



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 16:25.


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