Raised This Month: $ Target: $400
 0% 

[SOLVED] Native error...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
5c0r-|3i0
Veteran Member
Join Date: Nov 2008
Location: Việt Nam
Old 05-17-2010 , 05:10   [SOLVED] Native error...
Reply With Quote #1

PHP Code:
public message_textmsg()
{
    static 
textmsg[27]
    
get_msg_arg_string(2,textmsg26)
// Block drop weapon related messages
if(equal(textmsg[1],"#Weapon_Cannot_Be_Dropped"))
    {
    return 
PLUGIN_HANDLED;
    }
        return 
PLUGIN_CONTINUE;

As you can see , i'm trying to block that "Weapon acnnot be dropped" messages...
And here is the errorlog:
Quote:
L 05/17/2010 - 16:04:49: [AMXX] Run time error 10: native error (native "get_msg_arg_string")
L 05/17/2010 - 16:04:49: Invalid message argument

Last edited by 5c0r-|3i0; 05-17-2010 at 07:46.
5c0r-|3i0 is offline
master4life
Senior Member
Join Date: Mar 2006
Location: Germany
Old 05-17-2010 , 05:53   Re: Native error...
Reply With Quote #2

why do you use Message ? use event

PHP Code:
register_event"TextMsg""EventTextMsg""a""2&#Weapon_Cannot_Be_Dropped" ); 
and then block you function with PLUGIN_HANDLED;
__________________


[img]http://img714.**************/img714/8612/33726.png[/img]
master4life is offline
Send a message via ICQ to master4life Send a message via MSN to master4life Send a message via Skype™ to master4life
5c0r-|3i0
Veteran Member
Join Date: Nov 2008
Location: Việt Nam
Old 05-17-2010 , 07:46   Re: Native error...
Reply With Quote #3

Thanks....Fixed
5c0r-|3i0 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-17-2010 , 10:02   Re: [SOLVED] Native error...
Reply With Quote #4

IIRC, you can't block events.

@OP
Your problem was that TextMsg can have a various number of arguments.
You should check get_msg_args() before getting the arg.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 03:24.


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