AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help with fade to black (https://forums.alliedmods.net/showthread.php?t=319130)

sekac 10-13-2019 10:22

Help with fade to black
 
Why can't I set a long hold time with this stock? It only lasts maximum 10 seconds.

Code:

stock fadeToBlack(duration, holdTime) {
        message_begin(MSG_BROADCAST, get_user_msgid("ScreenFade"));
        write_short((1<<12) * duration);
        write_short((1<<12) * holdTime);
        write_short(0x0001);
        write_byte(0);
        write_byte(0);
        write_byte(0);
        write_byte(255);
        message_end();
}


LearninG 10-13-2019 10:45

Re: Help with fade to black
 
you can use this
Code:
stock ScreenFade(plr, Float:fDuration, red, green, blue, alpha) {     new i = plr ? plr : get_maxplayers();     if( !i )     {         return 0;     }         message_begin(plr ? MSG_ONE : MSG_ALL, get_user_msgid( "ScreenFade"), {255, 255, 0}, plr);     write_short(floatround(4096.0 * fDuration, floatround_round));     write_short(floatround(4096.0 * fDuration, floatround_round));     write_short(4096);     write_byte(red);     write_byte(green);     write_byte(blue);     write_byte(alpha);     message_end();         return 1; }

exapmle
Code:
ScreenFade(id, 5.0, 255, 255, 0, 0)

sekac 10-13-2019 11:23

Re: Help with fade to black
 
Thanks, but I wanted to have it fade slowly in the beginning and then hold it like in the one I used.


All times are GMT -4. The time now is 17:44.

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