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

[TF2] Fading the screen slightly darker


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mecha the Slag
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 02-03-2010 , 10:29   [TF2] Fading the screen slightly darker
Reply With Quote #1

Hi. I'm making a plugin for TF2 where I need all client's screen to turn slightly darker.

I know there are some cheat overlay commands but I don't know which or how to use them. I know how to remove the cheat flag from them alright, I just don't know which commands to use. Anyone got any ideas? Cheers.
Mecha the Slag is offline
miniman
Senior Member
Join Date: Aug 2009
Location: Israel
Old 02-03-2010 , 11:00   Re: [TF2] Fading the screen slightly darker
Reply With Quote #2

PHP Code:
PerformBlind(clienttargetamount)
{
    new 
targets[2];
    
targets[0] = target;
    
    new 
Handle:message StartMessageEx(g_FadeUserMsgIdtargets1);
    
BfWriteShort(message1536);
    
BfWriteShort(message1536);
    
    if (
amount == 0)
    {
        
BfWriteShort(message, (0x0001 0x0010));
    }
    else
    {
        
BfWriteShort(message, (0x0002 0x0008));
    }
    
    
BfWriteByte(message0);
    
BfWriteByte(message0);
    
BfWriteByte(message0);
    
BfWriteByte(messageamount);
    
    
EndMessage();

    
LogAction(clienttarget"\"%L\" set blind on \"%L\", amount %d."clienttargetamount);

extracted from blind.sp its not completly blind u can set the ammount so thats all
miniman is offline
Mecha the Slag
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 02-03-2010 , 11:35   Re: [TF2] Fading the screen slightly darker
Reply With Quote #3

error 017: undefined symbol "g_FadeUserMsgId"

:O
Mecha the Slag is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 02-03-2010 , 11:38   Re: [TF2] Fading the screen slightly darker
Reply With Quote #4

Open up the file and find where that is defined.
pheadxdll is offline
Mecha the Slag
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 02-03-2010 , 11:53   Re: [TF2] Fading the screen slightly darker
Reply With Quote #5

I found it.

The only problem is that that script fades the screen over a period of time, and it takes too long to do so. I only need the darkening for a few seconds and that's not enough time for it to fade to the level I want (or even fade to a noticable level) D:

Last edited by Mecha the Slag; 02-03-2010 at 11:55.
Mecha the Slag is offline
miniman
Senior Member
Join Date: Aug 2009
Location: Israel
Old 02-03-2010 , 13:40   Re: [TF2] Fading the screen slightly darker
Reply With Quote #6

PHP Code:
FFADE_IN            0x0001        // Just here so we don't pass 0 into the function
FFADE_OUT           0x0002        // Fade out (not in)
FFADE_MODULATE      0x0004        // Modulate (don't blend)
FFADE_STAYOUT       0x0008        // ignores the duration, stays faded out until new ScreenFade message received
FFADE_PURGE         0x0010        // Purges all other fades, replacing them with this one 
found useful flags that you can replace with those
PHP Code:
    if (amount == 0
    { 
        
BfWriteShort(message, (0x0001 0x0010)); 
    } 
    else 
    { 
        
BfWriteShort(message, (0x0002 0x0008)); 
    } 

Last edited by miniman; 02-03-2010 at 13:42.
miniman is offline
=MaTi=
Member
Join Date: Jan 2008
Old 02-03-2010 , 14:35   Re: [TF2] Fading the screen slightly darker
Reply With Quote #7

I remember when I needed something similar, and I wasn't sure how to do this. Could somebody please explain these two parts?

PHP Code:
BfWriteShort(message1536); 
What does 1536 stand for?

Also:

PHP Code:
BfWriteByte(message0); 
BfWriteByte(message0); 
BfWriteByte(message0); 
BfWriteByte(messageamount
What's with the 0's?

Thanks in advance!
=MaTi= is offline
Mecha the Slag
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 02-03-2010 , 17:43   Re: [TF2] Fading the screen slightly darker
Reply With Quote #8

nevermind, found out I could achieve and instant effect using overlays
Mecha the Slag is offline
Reply



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 12:22.


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