Raised This Month: $51 Target: $400
 12% 

[ERROR] - Run time error 10: native erro


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 08-30-2016 , 12:17   [ERROR] - Run time error 10: native erro
Reply With Quote #1

Code:
L 08/30/2016 - 19:06:28: [CSTRIKE] Non-player entity 3 out of range
L 08/30/2016 - 19:06:28: [AMXX] Displaying debug trace (plugin "HumansGuns.amxx")
L 08/30/2016 - 19:06:28: [AMXX] Run time error 10: native error (native "cs_get_weapon_id")
L 08/30/2016 - 19:06:28: [AMXX]    [0] HumansGuns.sma::fHam_TakeDmgPost
PHP Code:
RegisterHamHam_TakeDamage"player""fHam_TakeDmgPost", .Post true ); 
Code:
public fHam_TakeDmgPost(iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits )
{
    if(!is_user_alive(iAttacker) || !is_user_alive(iVictim) || iVictim == iAttacker) 
        return HAM_IGNORED;
    
    static iWeaponInf, WeaponPrim, WeaponSEC;
    iWeaponInf = cs_get_weapon_id( iAttacker );
    
    WeaponPrim = g_szWeaponsPrim[ g_szWeaponSelected[ iAttacker ][ PRIM ] ][ WEAPON_CSW ];
    WeaponSEC = g_szWeaponsSec[ g_szWeaponSelected[ iAttacker ][ SEC ] ][ WEAPON_CSW ];
    
    if( iWeaponInf == WeaponPrim )
    {
        SetHamParamFloat( 4, fDamage * g_szWeaponsPrim[ g_szWeaponSelected[ iAttacker ][ PRIM ] ][ fDMG ] );
    }
    if( iWeaponInf == WeaponSEC )
    {
        SetHamParamFloat( 4, fDamage * g_szWeaponsSec[ g_szWeaponSelected[ iAttacker ][ SEC ] ][ fDMG ] );
    }
    
    return HAM_IGNORED;
}
__________________
Қазақстан Республикасы
Snitch is offline
Send a message via Skype™ to Snitch
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-30-2016 , 12:37   Re: [ERROR] - Run time error 10: native erro
Reply With Quote #2

http://amxmodx.org/api/cstrike/cs_get_weapon_id
__________________
HamletEagle is offline
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 08-30-2016 , 15:36   Re: [ERROR] - Run time error 10: native erro
Reply With Quote #3

Quote:
Originally Posted by HamletEagle View Post
and? i did everything good
__________________
Қазақстан Республикасы
Snitch is offline
Send a message via Skype™ to Snitch
SpannerSpammer
Member
Join Date: Mar 2006
Old 08-31-2016 , 00:39   Re: [ERROR] - Run time error 10: native erro
Reply With Quote #4

/Sigh

The function cs_get_weapon_id( ) takes the entity index of a WEAPON, Not a player index.

In your code iInflictor is the WEAPON index. Use it.
__________________
[NeoTF|DEV]SpannerSpammer-[AoE]-
NeoTF Development Team.
http://steamcommunity.com/groups/neotf
SpannerSpammer is offline
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 08-31-2016 , 03:00   Re: [ERROR] - Run time error 10: native erro
Reply With Quote #5

Quote:
Originally Posted by SpannerSpammer View Post
/Sigh

The function cs_get_weapon_id( ) takes the entity index of a WEAPON, Not a player index.

In your code iInflictor is the WEAPON index. Use it.
alr, so i just have to change this line:

iAttacker > iInflictor
Code:
iWeaponInf = cs_get_weapon_id( iInflictor );
__________________
Қазақстан Республикасы
Snitch is offline
Send a message via Skype™ to Snitch
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 09-04-2016 , 02:22   Re: [ERROR] - Run time error 10: native erro
Reply With Quote #6

bump?
__________________
Қазақстан Республикасы
Snitch is offline
Send a message via Skype™ to Snitch
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 09-04-2016 , 02:45   Re: [ERROR] - Run time error 10: native erro
Reply With Quote #7

This works?

Code:
public fHam_TakeDmgPost(iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits ) {     if(!is_user_alive(iAttacker) || iVictim == iAttacker)         return HAM_SUPERCEDE;         static iWeaponInf, WeaponPrim, WeaponSEC;     iWeaponInf = cs_get_weapon_id( iInflictor );         WeaponPrim = g_szWeaponsPrim[ g_szWeaponSelected[ iAttacker ][ PRIM ] ][ WEAPON_CSW ];     WeaponSEC = g_szWeaponsSec[ g_szWeaponSelected[ iAttacker ][ SEC ] ][ WEAPON_CSW ];         if( iWeaponInf == WeaponPrim )     {         SetHamParamFloat( 4, fDamage * g_szWeaponsPrim[ g_szWeaponSelected[ iAttacker ][ PRIM ] ][ fDMG ] );     }     else if( iWeaponInf == WeaponSEC )     {         SetHamParamFloat( 4, fDamage * g_szWeaponsSec[ g_szWeaponSelected[ iAttacker ][ SEC ] ][ fDMG ] );     }     else         return HAM_IGNORED;           return HAM_IGNORED; }
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 09-04-2016 , 08:02   Re: [ERROR] - Run time error 10: native erro
Reply With Quote #8

Quote:
Originally Posted by SpannerSpammer View Post
In your code iInflictor is the WEAPON index. Use it.
In most cases inflictor is equal attacker.
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 09-05-2016 , 02:25   Re: [ERROR] - Run time error 10: native erro
Reply With Quote #9

If he just use get_user_weapon( attacker .. is not better?
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 09-05-2016 , 05:48   Re: [ERROR] - Run time error 10: native erro
Reply With Quote #10

Quote:
Originally Posted by Craxor View Post
If he just use get_user_weapon( attacker .. is not better?
He also need check for grenade.
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
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 23:01.


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