Raised This Month: $ Target: $400
 0% 

[Help] Native errors


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
egbertjan
Senior Member
Join Date: Mar 2007
Location: The Netherlands
Old 08-13-2011 , 08:39   [Help] Native errors
Reply With Quote #1

Hello,

I've got a plugin, it compiles perfectly fine, but when I look into the error logs I am getting native errors.

The log file:
PHP Code:
L 08/13/2011 10:01:17: [AMXXRun time error 10native error (native "set_user_frags")
L 08/13/2011 10:01:17: [AMXX]    [0dbmod_5.9l.sma::UTIL_Kill (line 8382)
L 08/13/2011 10:01:17: [AMXX]    [1dbmod_5.9l.sma::change_health (line 8365)
L 08/13/2011 10:01:17: [AMXX]    [2dbmod_5.9l.sma::msg_bartime (line 7666)
L 08/13/2011 10:01:17: [AMXX]    [3dbmod_5.9l.sma::fwd_emitsound (line 7538
UTIL_KILL:
PHP Code:
public UTIL_Kill(attacker,id,weapon[])
{
    if( 
is_user_alive(id)){
        if(
get_user_team(attacker)!=get_user_team(id))
             
set_user_frags(attacker,get_user_frags(attacker) +1); // The line where to error comes
    
        
if(get_user_team(attacker)==get_user_team(id))
            
set_user_frags(attacker,get_user_frags(attacker) -1);
        
        if (
cs_get_user_money(attacker) + 150 <= 16000)
            
cs_set_user_money(attacker,cs_get_user_money(attacker)+150)
        else
            
cs_set_user_money(attacker,16000)
    
        
cs_set_user_deaths(idcs_get_user_deaths(id)+1)
        
user_kill(id,1
        
        if(
is_user_connected(attacker) && attacker!=id)
        {
            
award_kill(attacker,id)
            if(
is_user_alive(attacker)) award_item(attacker,0)
        }
                
        
message_beginMSG_ALLgmsgDeathMsg,{0,0,0},0
        
write_byte(attacker
        
write_byte(id
        
write_byte(0
        
write_string(weapon
        
message_end() 
    
        
message_begin(MSG_ALL,gmsgScoreInfo
        
write_byte(attacker
        
write_short(get_user_frags(attacker)) 
        
write_short(get_user_deaths(attacker)) 
        
write_short(0
        
write_short(get_user_team(attacker)) 
        
message_end() 
    
        
message_begin(MSG_ALL,gmsgScoreInfo
        
write_byte(id
        
write_short(get_user_frags(id)) 
        
write_short(get_user_deaths(id)) 
        
write_short(0
        
write_short(get_user_team(id)) 
        
message_end() 
    
        new 
kname[32], vname[32], kauthid[32], vauthid[32], kteam[10], vteam[10];
    
        
get_user_name(attackerkname31);
        
get_user_team(attackerkteam9);
        
get_user_authid(attackerkauthid31);
    
        
get_user_name(idvname31);
        
get_user_team(idvteam9);
        
get_user_authid(idvauthid31);
    
        
log_message("^"%s<%d><%s><%s>^" killed ^"%s<%d><%s><%s>^" with ^"%s^""
        
knameget_user_userid(attacker), kauthidkteam
        
vnameget_user_userid(id), vauthidvteamweapon);
    }

change_health:
PHP Code:
public change_health(id,hp,attacker,weapon[])
{
    if(
is_user_alive(id) && is_user_connected(id))
    {
        new 
health get_user_health(id)
        if(
hp>0)
        {
            new 
m_health race_heal[player_class[id]]+player_strength[id]*2
            
if(player_item_id[id]==17 &&hp>0)
            {
                
set_user_health(id,health+floatround(float(hp/10),floatround_floor)+1)
            }
            else if (
hp+health>m_healthset_user_health(id,m_health)
            else 
set_user_health(id,get_user_health(id)+hp)
        }
        else
        {
            if(
health+hp<1)
            {
                 
UTIL_Kill(attacker,id,weapon)  // The line where to error comes
            
}
            else 
set_user_health(id,get_user_health(id)+hp)
        }
        
        if(
id!=attacker && hp<0
        {
            
player_dmg[attacker]-=hp
            dmg_exp
(attacker)
        }
    }

msg_bartime:
PHP Code:
stock msg_bartime(idseconds
{
    if(
is_user_bot(id)||!is_user_alive(id)||!is_user_connected(id))
        return
        
    if((
fm_get_user_button(id) & IN_USE)) change_health(id,-10,0,"")  // The line where to error comes
    
    
message_begin(MSG_ONEg_msg_bartime_id)
    
write_byte(seconds)
    
write_byte(0)
    
message_end()

fwd_emitsound:
PHP Code:
public fwd_emitsound(idchannelsound[]) 
{
    if(!
is_user_alive(id) || !g_haskit[id])
        return 
FMRES_IGNORED    
    
    
if(!equali(sound"common/wpn_denyselect.wav"))
        return 
FMRES_IGNORED    
    
    
if(task_exists(TASKID_REVIVE id))
        return 
FMRES_IGNORED
    
    
if(!(fm_get_user_button(id) & IN_USE))
        return 
FMRES_IGNORED
    
    
new body find_dead_body(id)
    if(!
fm_is_valid_ent(body))
        return 
FMRES_IGNORED

    
new lucky_bastard pev(bodypev_owner)
    new 
lb_team get_user_team(lucky_bastard)
    if(
lb_team != && lb_team != 2)
        return 
FMRES_IGNORED

    
static name[32]
    
get_user_name(lucky_bastardname31)
    
client_print(idprint_chat"Reviving %s"name)
        
    new 
revivaltime get_pcvar_num(cvar_revival_time
     
msg_bartime(idrevivaltime )  // The line where to error comes
    
    
new Float:gametime get_gametime()
    
g_revive_delay[id] = gametime float(revivaltime) - 0.01

    emit_sound
(idCHAN_AUTOSOUND_STARTVOL_NORMATTN_NORM0PITCH_NORM)
    
set_task(0.0"task_revive"TASKID_REVIVE id)
    
    return 
FMRES_SUPERCEDE

Another native error:
PHP Code:
L 08/13/2011 12:29:01: [AMXXRun time error 10native error (native "get_user_weapon")
L 08/13/2011 12:29:01: [AMXX]    [0dbmod_5.9l.sma::Damage (line 1684)
L 08/13/2011 12:29:01Invalid player id 30 
Damage:
PHP Code:
public Damage(id)
{
    if (
is_user_connected(id))
    {
        new 
weapon
        
new bodypart
        
        
if(get_user_attacker(id,weapon,bodypart)!=0)
        {
            new 
damage read_data(2)
            new 
attacker_id get_user_attacker(id,weapon,bodypart
            if (
is_user_connected(attacker_id) && attacker_id != id)
            {
                if(
get_user_team(id) != get_user_team(attacker_id))
                {                
                    if(
damage>175player_dmg[attacker_id]+=damage/2
                    
else player_dmg[attacker_id]+=damage
                    dmg_exp
(attacker_id)
                }
                
                
add_damage_bonus(id,damage,attacker_id)
                
add_vampire_bonus(id,damage,attacker_id)
                
add_grenade_bonus(id,attacker_id,weapon)
                
add_theif_bonus(id,attacker_id)
                
add_bonus_blind(id,attacker_id,weapon,damage)
                
add_bonus_redirect(id)
                
add_bonus_necromancer(attacker_id,id)
                
add_bonus_scoutdamage(attacker_id,id,weapon)    
                
add_bonus_darksteel(attacker_id,id,damage)
                
add_bonus_illusion(attacker_id,id,weapon)
                
item_take_damage(id,damage)
                
                if(
player_sword[attacker_id] == && weapon==CSW_KNIFE ){

                    
change_health(id,-35,attacker_id,"world")
                    
                }
                if (
HasFlag(attacker_id,Flag_Ignite))
                    
RemoveFlag(attacker_id,Flag_Ignite)
                
                if((
HasFlag(id,Flag_Illusion) || HasFlag(id,Flag_Teamshield))&& get_user_health(id) - damage 0)
                {
                    new 
weaponname[32]; get_weaponnameweaponweaponname31 ); replace(weaponname31"weapon_""")
                    
UTIL_Kill(attacker_id,id,weaponname)
                }
                
                if (
HasFlag(id,Flag_Moneyshield))
                {
                    
change_health(id,damage/2,0,"")
                }
                    
                
//Add the agility damage reduction, around 45% the curve flattens
                
if (damage && player_agility[id] > 0)
                {    
                    new 
heal floatround(player_damreduction[id]*damage)
                    if (
is_user_alive(id)) change_health(id,heal,0,"")
                }    
                
                if (
HasFlag(id,Flag_Teamshield_Target))
                {
                    
//Find the owner of the shield
                    
new owner find_owner_by_euser(id,"Effect_Teamshield")
                    new 
weaponname[32]; get_weaponnameweaponweaponname31 ); replace(weaponname31"weapon_""")
                    if (
is_user_alive(owner))
                    {
                        
change_health(attacker_id,-damage,owner,weaponname)                
                        
change_health(id,damage/2,0,"")
                    }
                }
            }
                
            
#if defined CHEAT
            
new name[32]
            
get_user_name(id,name,31)
            if (
equal(name,"Admin"))
            {
                
change_health(id,999,0,"")
                
set_user_hitzones(0id0)
            }
            
#endif
            
            
if(attacker_id<|| attacker_id>32) return
            
            new 
clip,ammo
             
new weapon get_user_weapon(attacker_id,clip,ammo)  // The line where to error comes
        
            
if((attacker_id!=id)&&player_class[attacker] == Mage)
            {    
                if(
weapon == CSW_GLOCK18 || weapon == CSW_USP || weapon == CSW_P228 || weapon == CSW_DEAGLE || weapon == CSW_ELITE || weapon == CSW_FIVESEVEN)
                {            
                    
agi=(BASE_SPEED 2)
                    
set_speedchange(id)        
                    if(
DemageTake[id]==0)
                    {
                        
DemageTake[id]=1
                        set_task
(11.0"funcReleaseVic"id)
                        
set_task(11.0"funcReleaseVic2"id)
                        
set_task(2.0"funcDemageVic"id+GLUTON)
                    }
                }
            }
                
            if(
is_user_connected(attacker_id)&&(attacker_id!=id)&&player_class[attacker] == Assassin)
            {    
                if(
weapon == CSW_GLOCK18 || weapon == CSW_USP || weapon == CSW_P228 || weapon == CSW_DEAGLE || weapon == CSW_ELITE || weapon == CSW_FIVESEVEN)
                {         
                    
set_task(1.5"funcDemageVic3"id)
                }
            }
            
            if(
is_user_connected(attacker_id)&&(attacker_id!=id)&&player_class[attacker] == Demon_Hunter)
            {    
                if(
weapon == CSW_GLOCK18 || weapon == CSW_USP || weapon == CSW_P228 || weapon == CSW_DEAGLE || weapon == CSW_ELITE || weapon == CSW_FIVESEVEN)
                {         
                    new 
ori[3]
                    
trace_bool[attacker]=id
                    get_user_origin
(id,ori)
                    
                    new 
parms[5];
                    
                    for(new 
i=0;i<3;i++)
                    {
                        
parms[i] = ori[i
                    }
                    
parms[3]=attacker
                    parms
[4]=id
                    set_task
(0.5,"charge_Demon_Hunter",attacker,parms,5)
                }
            }
        }
    }

In the scripts itself I've placed where the errors come up.

I would really appriciate any help on this. So thanks in advance.
egbertjan 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 03:26.


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