Raised This Month: $305 Target: $400
 76%   Almost there!

Stack error problem [SOLVED]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 02-19-2012 , 09:52   Stack error problem [SOLVED]
Reply With Quote #1

I'm getting this error
Code:
 [AMXX] Run time error 3: stack error
and if i remove this line
Code:
engclient_cmd ( id, "drop", gs_WeaponsName[ i_Index ] );
it works fine

here's the code
PHP Code:
#include < amxmodx >
#include < engine >
#include < fakemeta >

#define PLUGIN "New Plug-In"
#define VERSION "0.1"
#define AUTHOR "Author"

new const gs_Weapons[ ] =
{
    
CSW_AK47,
    
CSW_M4A1,
    
CSW_MP5NAVY
};

new const 
gs_WeaponsName[ ][ ] =
{
    
"weapon_ak47",
    
"weapon_m4a1",
    
"weapon_mp5navy"
};

new 
gi_MaxPlayers;

public 
plugin_init ( )
{
    
register_plugin PLUGINVERSIONAUTHOR );
    
gi_MaxPlayers get_maxplayers ( );

    new 
s_Map32 ];
    
get_mapname s_Map31 );
    
    if ( 
containi s_Map"awp_bycastor" ) > -)
        
register_event "CurWeapon","HookCurWeapon""be""1=1" );
}

public 
HookCurWeapon id )
{
    if ( ! 
is_user_alive id ) )
        return 
0;
    
    static 
i_CurWeaponi_Boxi_Weapon;
    
i_CurWeapon read_data );
    
    for ( new 
i_Indexi_Index sizeof gs_Weaponsi_Index++ )
    {
        if ( 
i_CurWeapon == gs_Weaponsi_Index ] )
        {
            
engclient_cmd id"drop"gs_WeaponsNamei_Index ] );
            
            
i_Weapon find_ent_by_class ( -1gs_WeaponsNamei_Index ] );
            
i_Box pev i_Weaponpev_owner );
            
            if ( 
i_Weapon && i_Box gi_MaxPlayers )
                
dllfunc DLLFunc_Thinki_Box );
        }
    }
    
    return 
0;

__________________


Last edited by anakin_cstrike; 02-19-2012 at 11:34.
anakin_cstrike is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-19-2012 , 10:04   Re: Stack error problem
Reply With Quote #2

Declare this plugin in configs/maps/plugins-apw_bycastor.ini :

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

#define VERSION "0.0.1"
#define PLUGIN "awp_bycastor"

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")

    new 
entm_iItem 34XO_ARMOURY 4CSA_AWP 10
    
while( ( ent engfunc(EngFunc_FindEntityByStringent"classname""armoury_entity") ) )
    {
        if( 
get_pdata_int(entm_iItemXO_ARMOURY)!= CSA_AWP )
        {
            
engfunc(EngFunc_RemoveEntityent)
        }
    }

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 02-19-2012 at 10:05.
ConnorMcLeod is offline
Old 02-19-2012, 10:06
lucas_7_94
This message has been deleted by lucas_7_94. Reason: nvm
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 02-19-2012 , 11:34   Re: Stack error problem
Reply With Quote #3

works, thanks

EDIT: where can i find the whole list with these constants? like CSA_AWP
__________________


Last edited by anakin_cstrike; 02-19-2012 at 11:51.
anakin_cstrike is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-19-2012 , 11:53   Re: Stack error problem [SOLVED]
Reply With Quote #4

You can get results converted to CSW_*** consts if you use cs_get_armoury_type( armoury_entity_index )

But if you want those consts :

In cs16expert-hex805.fgd :
Code:
@PointClass base(Angles) iconsprite("sprites/CS/Armoury.spr") size(-16 -16 0, 16 16 16) = armoury_entity : "Items in the armoury" 
[
	item(choices)  : "Item" : "" = 
	[
		"": "weapon_mp5navy"
		1: "weapon_tmp"
		2: "weapon_p90"
		3: "weapon_mac10"
		4: "weapon_ak47"
		5: "weapon_sg552"
		6: "weapon_m4a1"
		7: "weapon_aug"
		8: "weapon_scout"
		9: "weapon_g3sg1"
		10: "weapon_awp"
		11: "weapon_m3"
		12: "weapon_xm1014"
		13: "weapon_m249"
		14: "weapon_flashbang"
		15: "weapon_hegrenade"
		16: "item_kevlar"
		17: "item_assaultsuit"
		18: "weapon_smokegrenade"
	]
//*
//*note: count always resets to only one item after first round
//*
	count(integer) : "Count" : 1
]
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 02-19-2012 at 11:54.
ConnorMcLeod 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 19:59.


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