Raised This Month: $ Target: $400
 0% 

black screen fade function


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
n0br41ner
Senior Member
Join Date: May 2012
Location: Planet Earth
Old 06-18-2012 , 08:38   black screen fade function
Reply With Quote #1

i want to fade a players screen to black (just like fade to black)

i know i have to use this
so i wrote these functions

PHP Code:
g_MsgFade get_user_msgid("ScreenFade");

public 
BlackOutSameIPs() {
    
g_iDeadPlayer read_data(2);
    
    if(!
is_user_alive(g_iDeadPlayer) && g_bSameIPs[g_iDeadPlayer]) {
        
message_begin(MSG_ONEg_MsgFade, {0,0,0}, g_iDeadPlayer);
        
write_short(4096);
        
write_short(4096);
        
write_short(4096);
        
write_byte(0);
        
write_byte(0);
        
write_byte(0);
        
write_byte(255);
        
message_end();
    } 

and the one that removes his black screen (back to normal)
PHP Code:
g_MsgFade get_user_msgid("ScreenFade");

public 
ResetScreen(iPlayerID) {
    if(
is_user_alive(iPlayerID)) {
        
message_begin(MSG_ONEg_MsgFade, {0,0,0}, iPlayerID);
        
write_short(1<<12);
        
write_short(1<<8);
        
write_short(1<<1);
        
write_byte(0);
        
write_byte(0);
        
write_byte(0);
        
write_byte(255);
        
message_end();
    }

i have no idea what these mean
PHP Code:
        write_short(1<<12);
        
write_short(1<<8);
        
write_short(1<<1); 
or these
PHP Code:
        write_short(4096);
        
write_short(4096);
        
write_short(4096); 
sometime you write numbers and others you write 1>>3 or w/e that means
can you please explain?

also i want that the first function blacks it out infinitly until i call the second function that removes the black screen

EDIT: i just noticed
Note: Duration and HoldTime is in special units. 1 second is equal to (1<<12) i.e. 4096 units.
so lets say i want it for 2 seconds, i do 4096*2 ?? bu ti want it not to stop

any help??

thank you in advance

Last edited by n0br41ner; 06-18-2012 at 08:41.
n0br41ner is offline
 



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 06:05.


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