AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   User Msg ScreenFade (https://forums.alliedmods.net/showthread.php?t=64730)

taheri6 12-22-2007 20:02

User Msg ScreenFade
 
Hey guys,

Im getting a wierd error and then my server shuts down, Ive never seen the error before and was wondering if some one could assist me.

Code:

FATAL ERROR (shutting down): User Msg 'ScreenFade': 12 bytes written, expected 10
There is only one place in my code that I am using that.

Code:


new gMsgScreenFade;
gMsgScreenFade                = get_user_msgid ( "ScreenFade" );


        message_begin( MSG_ONE, gMsgScreenFade, { 0, 0, 0 }, id );
        write_short( 1<<15 );
        write_short( 1<<10 );
        write_short( 1<<12 );
        write_byte( 255 );
        write_byte( 255 );
        write_byte( 255 );
        write_byte( 255 );
        message_end();

        message_begin(MSG_ONE,gmsgShake,{0,0,0},id);
        write_short( 255<< 14 ); //ammount
        write_short( 10 << 14 ); //lasts this long
        write_short( 255<< 14 ); //frequency
        message_end();

Any ideas?

ConnorMcLeod 12-22-2007 20:19

Re: User Msg ScreenFade
 
May be the flag is wrong.
Code:
write_short( 1<<12 );

Try one of those :
Quote:

FFADE_IN 0x0000 // Just here so we don't pass 0 into the function
FFADE_OUT 0x0001 // Fade out (not in)
FFADE_MODULATE 0x0002 // Modulate (don't blend)
FFADE_STAYOUT 0x0004 // ignores the duration, stays faded out until new ScreenFade message received
http://wiki.amxmodx.org/index.php/Ha...nts#HideWeapon

taheri6 12-22-2007 21:10

Re: User Msg ScreenFade
 
So you are suggesting:

Code:

new gMsgScreenFade;
gMsgScreenFade                = get_user_msgid ( "ScreenFade" );


        message_begin( MSG_ONE, gMsgScreenFade, { 0, 0, 0 }, id );
        write_short( 1<<15 );
        write_short( 1<<10 );
        write_short( FFADE_IN );
        write_byte( 255 );
        write_byte( 255 );
        write_byte( 255 );
        write_byte( 255 );
        message_end();

        message_begin(MSG_ONE,gmsgShake,{0,0,0},id);
        write_short( 255<<14 ); //ammount
        write_short( 10<<14 ); //lasts this long
        write_short( 255<<14 ); //frequency
        message_end();

instead?

ConnorMcLeod 12-22-2007 22:03

Re: User Msg ScreenFade
 
I suggest 0, but it depends on what you want to do.

taheri6 12-22-2007 22:20

Re: User Msg ScreenFade
 
I am trying to have the screen flash and then slowly fade into normal.

Alka 12-23-2007 04:20

Re: User Msg ScreenFade
 
Code:

FFADE_OUT 0x0001 // Fade out (not in)
Put in plugin #define FFADE_OUT 0x0001 then write_short(FADE_OUT) or you can put 0, like connorr says.

taheri6 12-23-2007 06:56

Re: User Msg ScreenFade
 
Thank you both for your assistance, I will try it out tomorrow :)


All times are GMT -4. The time now is 11:01.

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