Raised This Month: $ Target: $400
 0% 

Help with this error


Post New Thread Reply   
 
Thread Tools Display Modes
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
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 05-18-2013 , 11:50   Re: Help with this error
Reply With Quote #2

What is the complete error message? You are missing part of it
__________________
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
Balck
Senior Member
Join Date: Apr 2013
Location: Kosova-Mitrovica
Old 05-19-2013 , 03:27   Re: Help with this error
Reply With Quote #3

Quote:
Originally Posted by YamiKaitou View Post
What is the complete error message? You are missing part of it
Here is it


L 05/19/2013 - 0006: -------- Mapchange to deathrun_forest --------
L 05/19/2013 - 000:55: Invalid cellvector handle provided (1:-1:0)
L 05/19/2013 - 000:55: [AMXX] Displaying debug trace (plugin "Remove_forest_woods.amxx")
L 05/19/2013 - 000:55: [AMXX] Run time error 10: native error (native "ArrayGetCell")
L 05/19/2013 - 000:55: [AMXX] [0] Remove_forest_woods.sma::pfn_keyvalue (line 70)
__________________

Last edited by Balck; 05-19-2013 at 03:27.
Balck is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-19-2013 , 04:39   Re: Help with this error
Reply With Quote #4

Oh, pokemonmaster code lol.


Try this :

PHP Code:
#include < amxmodx >
#include < engine >
#include < fakemeta >

#pragma semicolon 1

#define PLUGIN ""
#define VERSION "0.0.1"

const matWood 1;

const 
XO_CBREAKABLE 4;
const 
m_Material 36;

public 
plugin_init()
{
    
register_pluginPLUGINVERSION"ConnorMcLeod" );

    new 
mapname[32];
    
get_mapname(mapnamecharsmax(mapname));

    if( 
equali(mapname"deathrun_forest") )
    {
        new 
ent;
        while( (
ent find_ent_by_class(ent"func_breakable")) )
        {
            if( ~
entity_get_int(entEV_INT_spawnflags) & SF_BREAK_TRIGGER_ONLY && get_pdata_int(entm_MaterialXO_CBREAKABLE) == matWood )
            {
                
remove_entity(ent);
            }
        }
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Balck
Senior Member
Join Date: Apr 2013
Location: Kosova-Mitrovica
Old 05-19-2013 , 06:22   Re: Help with this error
Reply With Quote #5

Quote:
Originally Posted by ConnorMcLeod View Post
Oh, pokemonmaster code lol.


Try this :

PHP Code:
#include < amxmodx >
#include < engine >
#include < fakemeta >

#pragma semicolon 1

#define PLUGIN ""
#define VERSION "0.0.1"

const matWood 1;

const 
XO_CBREAKABLE 4;
const 
m_Material 36;

public 
plugin_init()
{
    
register_pluginPLUGINVERSION"ConnorMcLeod" );

    new 
mapname[32];
    
get_mapname(mapnamecharsmax(mapname));

    if( 
equali(mapname"deathrun_forest") )
    {
        new 
ent;
        while( (
ent find_ent_by_class(ent"func_breakable")) )
        {
            if( ~
entity_get_int(entEV_INT_spawnflags) & SF_BREAK_TRIGGER_ONLY && get_pdata_int(entm_MaterialXO_CBREAKABLE) == matWood )
            {
                
remove_entity(ent);
            }
        }
    }

Thanks very much ConnorMcLeod it works perfectly
__________________
Balck is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-19-2013 , 17:13   Re: Help with this error
Reply With Quote #6

Answer to your PM :

Code:
// CBaseEntity -> CBaseDelay -> CBreakable
// Linux +4
stock const XO_CBREAKABLE = 4;

enum _:Explosions{ expRandom, expDirected}
enum _:Materials{ matGlass = 0, matWood, matMetal, matFlesh, matCinderBlock, matCeilingTile, matComputer, matUnbreakableGlass, matRocks, matNone, matLastMaterial }

stock const m_Material = 36; // Materials
stock const m_Explosion = 37; // Explosions
stock const m_idShard = 38;
stock const m_angle = 39;
stock const m_iszGibModel = 40;
stock const m_iszSpawnObject = 41;
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
darcadarca
Senior Member
Join Date: Feb 2012
Location: Romania
Old 05-20-2013 , 05:30   Re: Help with this error
Reply With Quote #7

or better you can use entity remover by exolent
edit : yes .. exolent , sorry about that , counfuse
__________________
hqqqqqqqq

Last edited by darcadarca; 05-20-2013 at 08:01.
darcadarca is offline
Send a message via Yahoo to darcadarca
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-20-2013 , 06:55   Re: Help with this error
Reply With Quote #8

Quote:
Originally Posted by darcadarca View Post
or better you can use entity remover by connor
You mean by xolent.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 05-20-2013 , 08:59   Re: Help with this error
Reply With Quote #9

Connor, if I can make use of the topic and dont make another one to ask you here if I want to remove something from surf_ski_2 how should i do it ?


Code:
Classnames :

func_button
trigger_teleport
trigger_teleport
Code:
Models :

*20
*22
*23
Lolz0r is offline
Reply


Thread Tools
Display Modes

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