AlliedModders

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

hellraser 09-21-2004 17:26

ScreenFade
 
Hey once again in need of help :)
So i'm using this,it works correctly but what i wanna do is fade to black (0,0,0) like the cvar (mp_fadetoblack) and this code doesn't exactly do that...why? :)
Code:

public nvg1(id) {
    new all[32], all_num
    get_players(all,all_num,"a")
    for (new i=0;i<all_num;i++) {

    new gMsgScreenFade = get_user_msgid("ScreenFade")
    message_begin(MSG_ONE,gMsgScreenFade,{0,0,0},all[i])
    write_short( 1<<14 )
    write_short( 1<<14 )
    write_short( 1<<12 )
    write_byte( 0 )
    write_byte( 0 )
    write_byte( 0 )
    write_byte( 0 )
    message_end()
        }
}

Thanks,

malex 09-21-2004 18:57

That last write_byte sets the alpha for the fade. I'm guessing alpha = 0 means fully transparent fade, i.e. no fade at all. In my plugin, I use alpha of 255, and it works.

\malex\

johnjg75 09-21-2004 18:59

yeh the last is alpha n if u want it to be completely black then u use this:
Code:
public nvg1(id) {     new all[32], all_num     get_players(all,all_num,"a")     for (new i=0;i<all_num;i++) {     new gMsgScreenFade = get_user_msgid("ScreenFade")     message_begin(MSG_ONE,gMsgScreenFade,{0,0,0},all[i])     write_short( 1<<14 )     write_short( 1<<14 )     write_short( 1<<12 )     write_byte( 0 )     write_byte( 0 )     write_byte( 0 )     write_byte( 255 )     message_end()    } }

hellraser 09-22-2004 08:35

Thx guys :)

hellraser 09-30-2004 01:44

what would i have to do to make it last for ever?
Thx,

Votorx 09-30-2004 13:07

Call it each round?

hellraser 09-30-2004 14:37

nah,its a function that is called when an amount of frags has been reached...i dont know exactly how to play around with the write_short etc..
Thx,

Votorx 09-30-2004 18:42

Well if that's the case, then you should have no problem. That stays on untill the player dies.

hellraser 10-01-2004 01:38

well actually it doesnt...it fades & stays black for about 5s then it comes back to normal...
[EDIT] : Nevermind i was calling another function just after .. ;)

Thx


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

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