Raised This Month: $ Target: $400
 0% 

screen fade


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Intouchable
Senior Member
Join Date: Mar 2012
Old 04-15-2013 , 12:37   screen fade
Reply With Quote #1

On start round on player puts red screen.So before ending round if player gets other screen - green and when round starts disappears black screen. How to fix that on round stars always puts the black screen if in the end of round you get other screen?

Last edited by Intouchable; 04-15-2013 at 12:38.
Intouchable is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 04-15-2013 , 12:39   Re: screen fade
Reply With Quote #2

Show your code.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Intouchable
Senior Member
Join Date: Mar 2012
Old 04-15-2013 , 12:53   Re: screen fade
Reply With Quote #3

PHP Code:
public hPlayerSpawn(id)
{
   new 
iDuration = (get_pcvar_num(cScreenTime) + get_pcvar_num(cFreezeTime)) - iScreenTimeiHoldTime
  
    
if(iScreenTime 0iHoldTime 0
    
else iHoldTime get_pcvar_num(cFreezeTime) + (get_pcvar_num(cScreenTime) / 2)
    
    
message_begin(MSG_ONEmsgScreenFade_id)
    
write_short(SPECIAL_UNIT iDuration// duration
    
write_short(SPECIAL_UNIT iHoldTime// hold time
    
write_short(FFADE_IN// flags
    
write_byte(0// color r
    
write_byte(0// color g
    
write_byte(0// color b
    
write_byte(255// alpha
    
message_end()


Last edited by Intouchable; 04-15-2013 at 12:53.
Intouchable is offline
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 04-15-2013 , 13:43   Re: screen fade
Reply With Quote #4

We need more information, especially about cScreenTime, cFreezeTime and iScreenTime

Last edited by didoWEE; 04-15-2013 at 13:44.
didoWEE is offline
Intouchable
Senior Member
Join Date: Mar 2012
Old 04-15-2013 , 14:25   Re: screen fade
Reply With Quote #5

PHP Code:
(get_pcvar_num(cScreenTime) + get_pcvar_num(cFreezeTime)) - iScreenTime

cScreenTime   
=  register_cvar("creenfadetime""5")
cFreezeTime 1

iScreenTime 


Last edited by Intouchable; 04-15-2013 at 14:25.
Intouchable is offline
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 04-15-2013 , 14:49   Re: screen fade
Reply With Quote #6

Can you explain again what's the problem, please. I didn't understand it.

BTW
cFreezeTime
= 1
why you use get_pcvar_num, it's not cvar.
Why you decrease the value with 0
iScreenTime = 0
(get_pcvar_num(cScreenTime) + get_pcvar_num(cFreezeTime)) - iScreenTime
Also you use ( ) for addition and subtraction, why ?

Last edited by didoWEE; 04-15-2013 at 14:53.
didoWEE is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 04-16-2013 , 01:02   Re: screen fade
Reply With Quote #7

Sorry, I fell asleep after I posted my first message.

Do you mean something like this?

Code:
#include <amxmodx> #include <hamsandwich> new g_msgScreenFade, bool:g_bGetBlackScreen[ 33 ]; public plugin_init() {     RegisterHam( Ham_Spawn, "player", "CBase_PlayerSpawn_Post", 1 );         register_logevent( "Event_RoundEnd", 2, "1=Round_End" );         g_msgScreenFade = get_user_msgid( "ScreenFade" );   } public CBase_PlayerSpawn_Post( id ) {     if( is_user_alive( id ) )     {         if( g_bGetBlackScreen[ id ] )         {             Message_ScreenFade( id, 0, 0, 1<<2, 0, 0, 0, 255 );             g_bGetBlackScreen[ id ] = false;         }         else    Message_ScreenFade( id, 6<<12, 0, 0, 255, 0, 0, 255 );      } } public Event_RoundEnd() {     new Players[ 32 ], iNum;     get_players( Players, iNum, "ach" );         for( new i ; i < iNum ; i ++ )     {         //if get green screen         {             Message_ScreenFade( Players[ i ], 6<<12, 0, 0, 0, 155, 0, 255 );             g_bGetBlackScreen[ Players[ i ] ] = true;         }     } } public Message_ScreenFade( id, iDuration, iHold, FadeMode, iRed, iGreen, iBlue, iAlpha ) {     message_begin( MSG_ONE_UNRELIABLE, g_msgScreenFade,{ 0, 0, 0 }, id );     write_short( iDuration );     write_short( iHold );     write_short( FadeMode );     write_byte( iRed );     write_byte( iGreen );     write_byte( iBlue );     write_byte( iAlpha );     message_end(); }
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Intouchable
Senior Member
Join Date: Mar 2012
Old 05-25-2013 , 00:37   Re: screen fade
Reply With Quote #8

sorry for writing too late but that doesn't work. I mean still bugging.

Last edited by Intouchable; 05-25-2013 at 00:38.
Intouchable is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 05-25-2013 , 03:52   Re: screen fade
Reply With Quote #9

Try explaining again. Shouldn't be anything wrong with the code provided - only flaw is the understanding of your question.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet 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 16:22.


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