Raised This Month: $ Target: $400
 0% 

message_begin runtime error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 11-21-2010 , 13:43   message_begin runtime error
Reply With Quote #1

PHP Code:
public SpawnEffect(id){
    
//client_cmd(id, "stopsound")
    
client_cmd(id"spk ^"sound/misc/pickpower.wav^"" );
    
    
message_beginMSG_ONE_UNRELIABLEget_user_msgid("g_msgFade"), _, .player=id )
    
write_short(1<<);
    
write_short(FFADE_IN );
    
write_short0x0004 )
    
write_byte79 )
    
write_byte180 )
    
write_byte61 )
    
write_byte255 )
    
message_end( )
    
    
message_begin(MSG_ONEget_user_msgid("g_msgShake"), {0,0,0}, .player=id )
    
write_short(1<<14)
    
write_short(1<<14)
    
write_short(1<<14)
    
message_end()

Quote:
L 11/21/2010 - 19:58:19: Plugin called message_begin with an invalid message id (0).
L 11/21/2010 - 19:58:19: [AMXX] Displaying debug trace (plugin "vip4cs-games.amxx")
L 11/21/2010 - 19:58:19: [AMXX] Run time error 10: native error (native "message_begin")
L 11/21/2010 - 19:58:19: [AMXX] [0] vip4cs-games.sma::SpawnEffect (line 293)
Solutions please ?
reinert is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 11-21-2010 , 13:51   Re: message_begin runtime error
Reply With Quote #2

Get the right msgid like this:

PHP Code:
new g_MsgShake;  // gonna assume that this is screenshake.
 
public plugin_init()
{
    
g_MsgShake get_user_msgid("ScreenShake");
}
 
public 
somefunc(id)
{
    
message_begin(MSG_ONEg_MsgShake), _id);
    
// stuff.

__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
reinert
Veteran Member
Join Date: Feb 2007
Old 11-21-2010 , 14:20   Re: message_begin runtime error
Reply With Quote #3

Same with g_msgFade ?
reinert is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 11-22-2010 , 18:39   Re: message_begin runtime error
Reply With Quote #4

Yeah, it is like this every time you cache a msgid in a variable.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
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 11:20.


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