Difference between revisions of "User Messages"
(→Fade Function) |
(→Fade Function) |
||
| Line 45: | Line 45: | ||
=== Fade Function === | === Fade Function === | ||
| − | Example Fade function (be sure to define the Fade Flags! | + | Example Fade function (be sure to define the Fade Flags!) |
This Fades the clients screen to a specified color, and stays until you reset the color to {0,0,0,0} | This Fades the clients screen to a specified color, and stays until you reset the color to {0,0,0,0} | ||
Revision as of 11:32, 9 August 2009
This is just a dump of some stuff for now, needs a complete revamp later.
Counter-Strike: Source User Messages
List obtained by using 'meta game' in the console
User Messages: Name Index Size
Geiger 0 1
Train 1 1
HudText 2 -1
SayText 3 -1
SayText2 4 -1
TextMsg 5 -1
HudMsg 6 -1
ResetHUD 7 1
GameTitle 8 0
ItemPickup 9 -1
ShowMenu 10 -1
Shake 11 13
Fade 12 10
VGUIMenu 13 -1
CloseCaption 14 7
SendAudio 15 -1
RawAudio 16 -1
VoiceMask 17 17
RequestState 18 0
BarTime 19 -1
Damage 20 -1
RadioText 21 -1
HintText 22 -1
ReloadEffect 23 2
PlayerAnimEvent 24 -1
AmmoDenied 25 2
UpdateRadar 26 -1
KillCam 27 -1
28 user messages in total
Fade Flags
These may not be correct...
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
Fade Function
Example Fade function (be sure to define the Fade Flags!)
This Fades the clients screen to a specified color, and stays until you reset the color to {0,0,0,0}
To modify it to Fade the screen for a certain amount of time, remove the STAYOUT flag, and pass a value to "fade & hold"
PerformFade(target, 500, {0, 128, 255, 51})
PerformFade(client, duration, const color[4]) {
new Handle:hFadeClient=StartMessageOne("Fade",client)
BfWriteShort(hFadeClient,duration) // FIXED 16 bit, with SCREENFADE_FRACBITS fractional, seconds duration
BfWriteShort(hFadeClient,0) // FIXED 16 bit, with SCREENFADE_FRACBITS fractional, seconds duration until reset (fade & hold)
BfWriteShort(hFadeClient,(FFADE_PURGE|FFADE_OUT|FFADE_STAYOUT)) // fade type (in / out)
BfWriteByte(hFadeClient,color[0]) // fade red
BfWriteByte(hFadeClient,color[1]) // fade green
BfWriteByte(hFadeClient,color[2]) // fade blue
BfWriteByte(hFadeClient,color[3]) // fade alpha
EndMessage()
}