Raised This Month: $ Target: $400
 0% 

get native error in log


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Frostas
New Member
Join Date: Aug 2010
Old 08-18-2010 , 11:15   get native error in log
Reply With Quote #1

Event:
PHP Code:
public Ev_DeathMsg(id)
{
    new 
clipammoweapon get_user_weapon(idclipammo);

          new 
name[32];
          
get_user_name(idname31);

    if (
weapon == CSW_HEGRENADE)
    {
        
cs_set_user_money(idcs_get_user_money(id) + get_pcvar_num(reward_grenade))

              
set_hudmessage(25500, -1.00.312.02.0)
              
ShowSyncHudMsg(0g_msgHudSyncX"!!!ATTENTION!!! %s exploded Boss. He reward is %i$!"nameget_pcvar_num(reward_grenade))
    }

Logs:
Quote:
L 08/18/2010 - 18:11:42: Invalid player id 0
L 08/18/2010 - 18:11:42: [AMXX] Displaying debug trace (plugin "BMR.amxx")
L 08/18/2010 - 18:11:42: [AMXX] Run time error 10: native error (native "get_user_weapon")
L 08/18/2010 - 18:11:42: [AMXX] [0] BMR.sma::Ev_DeathMsg (line 35)
Frostas is offline
Send a message via Skype™ to Frostas
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 08-18-2010 , 11:18   Re: get native error in log
Reply With Quote #2

check if id is a player.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-18-2010 , 11:24   Re: get native error in log
Reply With Quote #3

If you are using the Event DeathMsg to trigger that function, id will always be 0 since it is never used. You need to use read_data() to get the passed values.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Frostas
New Member
Join Date: Aug 2010
Old 08-18-2010 , 13:57   Re: get native error in log
Reply With Quote #4

thank you for healping YamiKaitou can lock topic.
Frostas is offline
Send a message via Skype™ to Frostas
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 21:52.


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