Raised This Month: $ Target: $400
 0% 

message_begin crashes server


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
genesis
Senior Member
Join Date: Oct 2004
Location: CALIFORNIA, USA
Old 10-18-2004 , 01:45   message_begin crashes server
Reply With Quote #1

I'm not sure what I'm doing wrong here:
NOTE: using amx 0.20 RC6
Code:
new gmsgFade // this is at the very beginning of my plugin message_begin(MSG_ONE, gmsgFade, {0,0,0}, player) write_short(1<<12) write_short(1<<8) write_byte(0) write_byte(0) write_byte(0) write_byte(255) message_end()

when this part of the code is run my server crashes and I get the following message

tried to create a message with a bogus message type ( 0 )
__________________
CS 1.6 cali.radclan.net:27015
I have a feeling we're not in cs anymore.
I take pride that all my AMXX plugins were writen in notepad.
genesis is offline
DS
SourceMod Developer
Join Date: Sep 2004
Location: WI, USA
Old 10-18-2004 , 01:58  
Reply With Quote #2

That's probably because gmsgFade is never set to anything. Just creating the variable will automatically initialize it to 0. You need to get the message ID of the fade message before you can use it. So what you need to do is put something like this in plugin_init like this:

Code:
public plugin_init() {     gmsgFade = get_user_msgid("ScreenFade") }

or you could also get rid of gmsgFade variable and make the message_begin like this:
Code:
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, player)

Either way should work, but I don't know if that variable gmsgFade is used elsewhere within your plugin or not.
DS is offline
genesis
Senior Member
Join Date: Oct 2004
Location: CALIFORNIA, USA
Old 10-19-2004 , 01:41   ty
Reply With Quote #3

yep that was it, thanks.

on a small continuation note though ... this only fades to black for a second then goes back to normal. how can i get it to stay black
__________________
CS 1.6 cali.radclan.net:27015
I have a feeling we're not in cs anymore.
I take pride that all my AMXX plugins were writen in notepad.
genesis is offline
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 17:25.


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