This is a stock from superhero
Code:
stock setScreenFlash(id, red, green, blue, decisecs, alpha)
{
if (!is_user_connected(id)) return
message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},id)
write_short( 1<<decisecs ) // fade lasts this long duration
write_short( 1<<decisecs ) // fade lasts this long hold time
write_short( 1<<12 ) // fade type (in / out)
write_byte( red ) // fade red
write_byte( green ) // fade green
write_byte( blue ) // fade blue
write_byte( alpha ) // fade alpha
message_end()
}
and here is an example of it being used
Code:
new alphanum = damage * 2
if (alphanum > 200) alphanum = 200
else if (alphanum < 40) alphanum = 40
setScreenFlash(attacker, 255, 10, 10, 10, alphanum ) //Red Screen Flash
this ends up being a pretty quick red flash with a varying alpha ammount.
Some colors are not allowed so you might want to try another color first (like the one I use here works for sure). Another option would be to use a message logger and then enable that cvar "fadetoblack". Catch that message and then replicate it.
__________________