Raised This Month: $ Target: $400
 0% 

[INC] ScreenFade Util [RAGE Supported]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-14-2009 , 14:49   [INC] ScreenFade Util [RAGE Supported]
Reply With Quote #1

Rage version of this : - Clic on me -


Two stocks :

Code:
// Main util
UTIL_ScreenFade(id=0,iColor[3]={0,0,0},Float:flFxTime=-1.0,Float:flHoldTime=0.0,iAlpha=0,iFlags=FFADE_IN,bool:bReliable=false,bool:bExternal=false)

// Util from main util
UTIL_FadeToBlack(id,Float:fxtime=3.0,bool:bReliable=false,bool:bExternal=false)
Details :
  • fxtime and time in seconds (that's the main idea of this util).
  • Color, type : {0-255,0-255,0-255}
  • Alpha, type : 0-255
  • bReliable : if true, uses MSG_ONE or MSG_ALL, if false uses MSG_ONE_UNRELIABLE or MSG_BROADCAST
  • bExternal : if true uses emessage


How to use this stock with a cvar that handle color ?

Cvar should be like this :

Code:
    cvar_pointer = register_cvar("cvar_color", "RRRGGGBBB")
Even if some values are less than 100, you should put the 3 digits, aka 10 -> 010


Then to retrieve the color use :

PHP Code:
get_cvar_colorg_pCvar )
{
    new 
Color[3]

    new 
iTemp get_pcvar_num(g_pCvar)
    
Color[0] = iTemp 1000000
    iTemp 
%= 1000000
    Color
[1] = iTemp 1000
    Color
[2] = iTemp 1000

    
return Color

Example with 2 other ways (less efficient) to handle colors by cvars : -link-
Attached Files
File Type: inc screenfade_util.inc (2.0 KB, 4094 views)
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 03-24-2012 at 08:11.
ConnorMcLeod 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 17:18.


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