Raised This Month: $ Target: $400
 0% 

[CS:S] Screen Fade


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Caldeum
Senior Member
Join Date: Jul 2010
Location: United Kingdom
Old 06-23-2012 , 18:15   [CS:S] Screen Fade
Reply With Quote #1

Is it posible in SourceMod? Can enyone give me example with screen fade? i need it in green color on every respawn.
__________________
Of all the things I lost, I miss my brain the most.
Caldeum is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 06-23-2012 , 20:00   Re: [CS:S] Screen Fade
Reply With Quote #2



PHP Code:
stock bool:Client_ScreenFade(clientdurationmodeholdtime=-1r=0g=0b=0a=255bool:reliable=true); 
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0

Last edited by berni; 06-23-2012 at 20:00.
berni is offline
Caldeum
Senior Member
Join Date: Jul 2010
Location: United Kingdom
Old 06-24-2012 , 03:47   Re: [CS:S] Screen Fade
Reply With Quote #3

Something like that?

PHP Code:
stock bool:Client_ScreenFade(clientdurationmodeholdtime=-1r=100g=250b=100a=255bool:reliable=true)
{
    new 
Handle:msg;
    
    
msg StartMessageOne("Fade"client);
    
BfWriteShort(msg255);
    
BfWriteShort(msgduration);
    
BfWriteShort(msgmode);
    
BfWriteByte(msgr);
    
BfWriteByte(msgg);
    
BfWriteByte(msgb);
    
BfWriteByte(msga);
    
EndMessage();

__________________
Of all the things I lost, I miss my brain the most.

Last edited by Caldeum; 06-24-2012 at 03:47.
Caldeum is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 06-24-2012 , 08:02   Re: [CS:S] Screen Fade
Reply With Quote #4

uhm, yes ?
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
Caldeum
Senior Member
Join Date: Jul 2010
Location: United Kingdom
Old 06-24-2012 , 08:25   Re: [CS:S] Screen Fade
Reply With Quote #5

uhm.. doesn't work can you help me? What i'm doing wrong?


PHP Code:
Client_ScreenFadeclient3.53.5 );

stock Client_ScreenFade(clientdurationmodeholdtime=-1r=100g=250b=100a=255bool:reliable=true)
{
    if ( 
client && IsClientInGameclient ) )
    {
        new 
Handle:msg;
        
        
msg StartMessageOne("Fade"client);
        
BfWriteShort(msg255);
        
BfWriteShort(msgduration);
        
BfWriteShort(msgmode);
        
BfWriteByte(msgr);
        
BfWriteByte(msgg);
        
BfWriteByte(msgb);
        
BfWriteByte(msga);
        
        
EndMessage();
    }
    return 
Plugin_Continue;

__________________
Of all the things I lost, I miss my brain the most.
Caldeum is offline
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 06-24-2012 , 13:15   Re: [CS:S] Screen Fade
Reply With Quote #6

I'm not sure what the mode is, maybe try to put it at a bigger value, like 7.

Also duration and mode don't seem to be Float, try to put integer instead.

Last edited by Mathias.; 06-24-2012 at 13:16.
Mathias. is offline
RedSword
SourceMod Plugin Approver
Join Date: Mar 2006
Location: Quebec, Canada
Old 06-24-2012 , 13:28   Re: [CS:S] Screen Fade
Reply With Quote #7

Quote:
Originally Posted by Caldeum View Post
uhm.. doesn't work can you help me? What i'm doing wrong?


PHP Code:
Client_ScreenFadeclient3.53.5 );

stock Client_ScreenFade(clientdurationmodeholdtime=-1r=100g=250b=100a=255bool:reliable=true)
{
    if ( 
client && IsClientInGameclient ) )
    {
        new 
Handle:msg;
        
        
msg StartMessageOne("Fade"client);
        
BfWriteShort(msg255);
        
BfWriteShort(msgduration);
        
BfWriteShort(msgmode);
        
BfWriteByte(msgr);
        
BfWriteByte(msgg);
        
BfWriteByte(msgb);
        
BfWriteByte(msga);
        
        
EndMessage();
    }
    return 
Plugin_Continue;

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
When using flags, don't put floats.

Also berni, I believe you should put a default fade-in or default fade-out in your smlib.
__________________
My plugins :
Red Maze
Afk Bomb
RAWR (per player/rounds Awp Restrict.)
Kill Assist
Be Medic

You can also Donate if you appreciate my work

Last edited by RedSword; 06-24-2012 at 13:30.
RedSword is offline
andi67
Veteran Member
Join Date: Mar 2007
Location: Somewhere near you!!!
Old 06-24-2012 , 14:08   Re: [CS:S] Screen Fade
Reply With Quote #8

I used this in one of my plugins modify it to your settings.....

Quote:
stock Vision(const any:client)
{
new Handle:message = StartMessageOne("Fade", client, 1);

if(IsClientInGame(client) && IsClientConnected(client) && IsPlayerAlive(client))
{
//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


BfWriteShort(message, 585);
BfWriteShort(message, 585);
BfWriteShort(message, (0x000); //Fade out
BfWriteByte(message, 0); //fade red
BfWriteByte(message, 200); //fade green
BfWriteByte(message, 0); //fade blue
BfWriteByte(message, 15); //fade alpha
EndMessage();
}
}
__________________
Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
>>You need Models for DODS/CSS/CSGO , than click here!!!<<

Last edited by andi67; 06-24-2012 at 14:10.
andi67 is offline
Caldeum
Senior Member
Join Date: Jul 2010
Location: United Kingdom
Old 06-24-2012 , 14:35   Re: [CS:S] Screen Fade
Reply With Quote #9

hmz doesn't work.

PHP Code:
stock ScreenFade( const any:client )
{
    new 
Handle:message StartMessageOne("Fade"client1);

    if ( 
IsClientInGameclient ) && IsClientConnectedclient ) && IsPlayerAliveclient ) )
    {
        
BfWriteShort(message585);
        
BfWriteShort(message585);
        
BfWriteShort(message, (0x0008)); //Fade out
        
BfWriteByte(message0); //fade red
        
BfWriteByte(message200); //fade green
        
BfWriteByte(message0); //fade blue
        
BfWriteByte(message20); //fade alpha
        
        
EndMessage( );
    }

i call it with
PHP Code:
ScreenFadeclient ); 

with this code i get errors
PHP Code:
Client_ScreenFadeclient3.53.5 );

stock Client_ScreenFade(clientdurationmodeholdtime=-1r=100g=250b=100a=255bool:reliable=true)
{
    if ( 
client && IsClientInGameclient ) )
    {
        new 
Handle:msg;
        
        
msg StartMessageOne("Fade"client);
        
BfWriteShort(msg255);
        
BfWriteShort(msgduration);
        
BfWriteShort(msgmode);
        
BfWriteByte(msgr);
        
BfWriteByte(msgg);
        
BfWriteByte(msgb);
        
BfWriteByte(msga);
        
        
EndMessage();
    }
    return 
Plugin_Continue;


PHP Code:
Client_ScreenFadeclient3.53.5 );

warning 213tag nismatch.
warning 213tag nismatch

PHP Code:
stock Client_ScreenFade(clientdurationmodeholdtime=-1r=100g=250b=100a=255bool:reliable=true)

error 025: function heading differs from prototype 

PHP Code:
stock Client_ScreenFade(clientdurationmodeholdtime=-1r=100g=250b=100a=255bool:reliable=true)
{
error 021symbol already defined "Client_ScreenFade" 
PHP Code:
return Plugin_Continue;

error 217loose indentation
warning 213
tag nismatch 
__________________
Of all the things I lost, I miss my brain the most.

Last edited by Caldeum; 06-24-2012 at 16:03.
Caldeum is offline
Zylius
SourceMod Donor
Join Date: Nov 2009
Old 06-24-2012 , 15:28   Re: [CS:S] Screen Fade
Reply With Quote #10

Quote:
Originally Posted by Caldeum View Post
hmz doesn't work.

PHP Code:
stock ScreenFade( const any:client )
{
    new 
Handle:message StartMessageOne("Fade"client1);

    if ( 
IsClientInGameclient ) && IsClientConnectedclient ) && IsPlayerAliveclient ) )
    {
        
BfWriteShort(message585);
        
BfWriteShort(message585);
        
BfWriteShort(message, (0x000)); //Fade out
        
BfWriteByte(message0); //fade red
        
BfWriteByte(message200); //fade green
        
BfWriteByte(message0); //fade blue
        
BfWriteByte(message20); //fade alpha
        
        
EndMessage( );
    }

i call it with
PHP Code:
ScreenFadeclient ); 
with this code i get errors
PHP Code:
Client_ScreenFadeclient3.53.5 );

stock Client_ScreenFade(clientdurationmodeholdtime=-1r=100g=250b=100a=255bool:reliable=true)
{
    if ( 
client && IsClientInGameclient ) )
    {
        new 
Handle:msg;
        
        
msg StartMessageOne("Fade"client);
        
BfWriteShort(msg255);
        
BfWriteShort(msgduration);
        
BfWriteShort(msgmode);
        
BfWriteByte(msgr);
        
BfWriteByte(msgg);
        
BfWriteByte(msgb);
        
BfWriteByte(msga);
        
        
EndMessage();
    }
    return 
Plugin_Continue;

PHP Code:
Client_ScreenFadeclient3.53.5 );

warning 213tag nismatch.
warning 213tag nismatch
PHP Code:
stock Client_ScreenFade(clientdurationmodeholdtime=-1r=100g=250b=100a=255bool:reliable=true)

error 025: function heading differs from prototype 
PHP Code:
stock Client_ScreenFade(clientdurationmodeholdtime=-1r=100g=250b=100a=255bool:reliable=true)
{
error 021symbol already defined "Client_ScreenFade" 
PHP Code:
return Plugin_Continue;

error 217loose indentation
warning 213
tag nismatch 
1. Duration isn't a float.
2. Disable SMLIB if you are going to use its function names.
Zylius 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 15:33.


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