Raised This Month: $12 Target: $400
 3% 

Help with fade to black


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sekac
Senior Member
Join Date: Nov 2016
Old 10-13-2019 , 10:22   Help with fade to black
Reply With Quote #1

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(); 
}
sekac is offline
LearninG
Senior Member
Join Date: Apr 2019
Location: Iran
Old 10-13-2019 , 10:45   Re: Help with fade to black
Reply With Quote #2

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)
LearninG is offline
sekac
Senior Member
Join Date: Nov 2016
Old 10-13-2019 , 11:23   Re: Help with fade to black
Reply With Quote #3

Thanks, but I wanted to have it fade slowly in the beginning and then hold it like in the one I used.
sekac 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 07:28.


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