Raised This Month: $ Target: $400
 0% 

Ham_Item_Holster : Bad arg count.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-14-2009 , 04:24   Ham_Item_Holster : Bad arg count.
Reply With Quote #1

[HAMSANDWICH] Bad arg count. Expected 3, got 2.

That's the runtime error i got (WIN32, listenserver).

My code :
Code:
ExecuteHam(Ham_Item_Holster, pActiveItem)
HLSDK code :
Code:
m_pActiveItem->Holster( );
ham_const description :
Code:
	/**
	 * Description:		Whether or not the entity (usually weapon) can be holstered.
	 * Forward params:	function(this)
	 * Return type:		Integer (boolean).
	 * Execute params:	ExecuteHam(Ham_Item_Holster, this);
	 */
	Ham_Item_Holster,
hamdata.ini is default one, last amxx release.

Any idea ? hamdata.ini would be false for win32 ? listenserver related ?


If someone wnat to try out the code :
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN "Strip"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"

//#define WEAPON_ALLWEAPONS        (~(1<<WEAPON_SUIT))

const MAX_ITEM_TYPES 6
const MAX_AMMO_SLOTS 14 // real is 32 but cs uses only 14

const m_rgpPlayerItems_Slot0 367
const m_pActiveItem 373
const m_pLastItem 375
const m_rgAmmo_Slot0 376

const EXTRAOFFSET_WEAPONS 4
const m_pNext 42

new gmsgCurWeapon

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
gmsgCurWeapon get_user_msgid("CurWeapon")

    
register_clcmd("drop""drop")
}

public 
dropid )
{
    
RemoveAllItems(id)
    return 
PLUGIN_HANDLED
}

RemoveAllItems(id/*, bool: removeSuit*/)
{
    new 
pActiveItem get_pdata_cbase(idm_pActiveItem)
    if(
pActiveItem 0)
    {
        
ExecuteHam(Ham_Item_HolsterpActiveItem)
        
set_pdata_cbase(idm_pActiveItem, -1)
    }

    
set_pdata_cbase(idm_pLastItem, -1)
    
//set_pdata_int(id, m_pLastItem, 0) ?

    
new rgpPlayerItemspPendingItem;
    for(
rgpPlayerItems m_rgpPlayerItems_Slot0rgpPlayerItems m_rgpPlayerItems_Slot0 MAX_ITEM_TYPESrgpPlayerItems++)
    {
        
pActiveItem get_pdata_cbase(idrgpPlayerItems)
        while(
pActiveItem)
        {
            
pPendingItem get_pdata_cbase(pActiveItemm_pNextEXTRAOFFSET_WEAPONS)
            
ExecuteHam(Ham_Item_DroppActiveItem)
            
pActiveItem pPendingItem
        
}
        
set_pdata_cbase(idrgpPlayerItems, -1)
    }
    
//m_pActiveItem = NULL;

    
set_pev(idpev_viewmodel0)
    
set_pev(idpev_weaponmodel0)
    
/*    if ( removeSuit )
    {
*/    
set_pev(idpev_weapons0)
/*    }
    else
    {
        set_pev(id, pev_weapons, pev(id, pev_weapons) & ~WEAPON_ALLWEAPONS)
    }
*/
    
for(new m_rgAmmo m_rgAmmo_Slot0m_rgAmmo m_rgAmmo_Slot0 MAX_AMMO_SLOTSm_rgAmmo++)
    {
        
set_pdata_int(idm_rgAmmo0)
    }

//    ExecuteHamB(Ham_Player_UpdateClientData, id) // crash ?
    
dllfunc(DLLFunc_UpdateClientDataid)

    
message_begin(MSG_ONE_UNRELIABLEgmsgCurWeapon_id)
    
write_byte(0)
    
write_byte(0)
    
write_byte(0)
    
message_end()

__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 02:27.


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