This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

runtime error (cs_get_weapon_id)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 09-05-2010 , 17:34   runtime error (cs_get_weapon_id)
Reply With Quote #1

hey, could someone help me with this error ?

L 09/06/2010 - 00:26:01: [CSTRIKE] Non-player entity -1 out of range
L 09/06/2010 - 00:26:01: [AMXX] Displaying debug trace (plugin "xx.amxx")
L 09/06/2010 - 00:26:01: [AMXX] Run time error 10: native error (native "cs_get_weapon_id")
L 09/06/2010 - 00:26:01: [AMXX] [0] vipas.sma::WeaponBox_Touch (line 199)

Code:

PHP Code:
public WeaponBox_Touch(iWpnBxid)
{
    if(
is_user_alive(id) && entity_get_int(iWpnBxEV_INT_flags) & FL_ONGROUND)
    {
        const 
XTRA_OFS_WEAPONBOX 4
        
const m_rgpPlayerItems_wpnbx_slot1 35

        
static iWeapon
        iWeapon 
get_pdata_cbase(iWpnBxm_rgpPlayerItems_wpnbx_slot1XTRA_OFS_WEAPONBOX)
        new 
wpnid cs_get_weapon_id(iWeapon)
        if(
A_Snaiperio_Ginklai[id] == false){
        if(
iWeapon && (wpnid == CSW_AWP || wpnid == CSW_G3SG1 || wpnid == CSW_SG550))
        {
            if(
g_iLastTouchedBox[id] != iWpnBx )
            {
                if(!
user_has_weapon(idCSW_AWP || CSW_G3SG1 || CSW_SG550))
                {
                    
Message_No_Awp(id)
                }
                
g_iLastTouchedBox[id] = iWpnBx;
            }
            return 
PLUGIN_HANDLED
        
}
        }
        if(
A_Peilio_Galia[id] == true){
        if(
iWeapon && (wpnid == CSW_P228 || wpnid == CSW_SCOUT || wpnid == CSW_XM1014 || wpnid == CSW_MAC10 || wpnid == CSW_AUG || wpnid == CSW_ELITE || wpnid == CSW_FIVESEVEN || wpnid == CSW_UMP45 || wpnid == CSW_SG550 || wpnid == CSW_GALIL || wpnid == CSW_FAMAS || wpnid == CSW_USP
 
|| wpnid == CSW_GLOCK18 || wpnid == CSW_AWP || wpnid == CSW_MP5NAVY || wpnid == CSW_M249 || wpnid == CSW_M3 || wpnid == CSW_M4A1 || wpnid == CSW_TMP || wpnid == CSW_G3SG1 || wpnid == CSW_DEAGLE || wpnid == CSW_SG552 || wpnid == CSW_AK47 || wpnid == CSW_P90))
        {
            if(
g_iLastTouchedBox2[id] != iWpnBx )
            {
                
Message_Peilio_Galia(id)
                
g_iLastTouchedBox2[id] = iWpnBx;
            }
            return 
PLUGIN_HANDLED
        
}
        }
    }
    return 
PLUGIN_CONTINUE

Line 199:

new wpnid = cs_get_weapon_id(iWeapon)
reinert is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-05-2010 , 17:48   Re: runtime error (cs_get_weapon_id)
Reply With Quote #2

Where have you founded that code ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 09-05-2010 , 18:41   Re: runtime error (cs_get_weapon_id)
Reply With Quote #3

Post the original unmodified code (I know you didn't write that) and explain what you want to do. Someone will provide a more efficient and correct way to do it.
__________________
Bugsy is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 09-08-2010 , 14:02   Re: runtime error (cs_get_weapon_id)
Reply With Quote #4

fixed with another code. with fwd_touch. its much easier p
reinert is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-08-2010 , 17:15   Re: runtime error (cs_get_weapon_id)
Reply With Quote #5

fwd_touch doesn't exist unless you create it or copy it from another plugin
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply



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 12:59.


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