Difference between revisions of "Half-Life 1 Game Events"
(→WeapPickup) |
(→WeapPickup) |
||
Line 428: | Line 428: | ||
Fired on weapon select.(?) | Fired on weapon select.(?) | ||
{{begin-hl1msg|WeaponList|byte}} | {{begin-hl1msg|WeaponList|byte}} | ||
+ | {{hl1msg|string|Weapon Name}} | ||
{{hl1msg|byte|Ammo1 ID}} | {{hl1msg|byte|Ammo1 ID}} | ||
{{hl1msg|byte|Ammo1 Max}} | {{hl1msg|byte|Ammo1 Max}} |
Revision as of 11:30, 12 January 2007
Contents
- 1 Half-Life Events
- 1.1 ADStop
- 1.2 AllowSpec
- 1.3 AmmoPickup
- 1.4 AmmoX
- 1.5 BarTime
- 1.6 BarTime2
- 1.7 Battery
- 1.8 BlinkAcct
- 1.9 BombDrop
- 1.10 BombPickup
- 1.11 BotProgress
- 1.12 BotVoice
- 1.13 Brass
- 1.14 BuyClose
- 1.15 ClCorpse
- 1.16 Crosshair
- 1.17 CurWeapon
- 1.18 CZCareer
- 1.19 CZCareerHUD
- 1.20 Damage
- 1.21 DeathMsg
- 1.22 FlashBat
- 1.23 Flashlight
- 1.24 Fog
- 1.25 ForceCam
- 1.26 HostageK
- 1.27 HostagePos
- 1.28 Money
- 1.29 NVGToggle
- 1.30 ResetHUD
- 1.31 RoundTime
- 1.32 SayText
- 1.33 Scenario
- 1.34 ScoreAttrib
- 1.35 ShowMenu
- 1.36 StatusIcon
- 1.37 StatusText
- 1.38 StatusValue
- 1.39 TaskTime
- 1.40 TeamInfo
- 1.41 TeamScore
- 1.42 TextMsg
- 1.43 Train
- 1.44 TutorClose
- 1.45 TutorLine
- 1.46 TutorState
- 1.47 TutorText
- 1.48 VGUIMenu
- 1.49 ViewMode
- 1.50 VoiceMask
- 1.51 WeapPickup
- 1.52 WeaponList
Half-Life Events
In Pawn you are able to hook in-game events with register_event. Here are the list of the standard Half-Life 1 and Counter-Strike events and their parameters which can be read with read_data
See the Advanced Scripting article for more on events and messages.
ADStop
Note: No Information available for this event
Name: | ADStop | |
Structure: |
|
AllowSpec
Changes whether or not "SPECTATE" appears on the change team menu. Called whenever the allow_spectators cvar is changed, with its new value sent as the byte.
Note: This changes how the change team menu appears, but spectating functionality is based off of the actual cvar value.
Name: | AllowSpec | ||
Structure: |
|
AmmoPickup
Temporarily draws HUD the ammo amount and ammo type HUD icon in the middle of the right side of the screen.
Note: Draw time is dependent on the hud_drawhistory_time client CVAR value
Name: | AmmoPickup | ||||
Structure: |
|
AmmoX
Updates green bar indicator in the HUD weapons-list. Also updates HUD backpack ammo number in the lower right corner of the screen in case the given ammo type are compatible with the current weapon.
Name: | AmmoX | ||||
Structure: |
|
BarTime
Draws a HUD progress bar which is filled from 0% to 100% for the time Duration seconds and then disappeared.
Note: Set Duration to 0 to hide the bar.
Name: | BarTime | ||
Structure: |
|
BarTime2
The same as BarTime but StartPC is specify how many per cents of the bar are (already) filled.
Note: Display time can be calculated with this formula: (1 - StartPC/100) / Duration
Name: | BarTime2 | ||||
Structure: |
|
Battery
Updates the icon and number of the armor on the HUD.
Name: | Battery | ||
Structure: |
|
BlinkAcct
Makes a player's money display flash rapidly, until it flashes a total of BlinkAmt times.
Name: | BlinkAcct | ||
Structure: |
|
BombDrop
The first three arguments are the origin of the dropped bomb. The last argument is set to 1 if the bomb has been planted. It is 0 if the bomb was dropped due to voluntary dropping or death/disconnect. Setting the last argument 1, will also trigger the round timer to hide. It also will show the dropped bomb on the Terrorist team's radar in the location specified by the first three arguments.
Name: | BombDrop | ||||||||
Structure: |
|
BombPickup
This message just tells the game that the bomb has been picked up. It will cause the dropped/planted bomb to disappear from the Terrorist team's radar.
Name: | BombPickup | |
Structure: |
|
BotProgress
Used by CZ's bots when learning a new map. Displays a progress bar in the middle of the screen, with some header text. The bar doesn't move, and you can't do anything while the bar is displayed. This is a different style of progress bar than from the BarTime event. This really doesn't display well in CS.
Note: Flag can be 0 (update bar), 1 (create new bar), or 2 (remove bar). When using flag 0, send all arguments. When using flag 1, send only Flag and Header. When using flag 2, send only Flag.
Name: | BotProgress | ||||||
Structure: |
|
BotVoice
Displays (or hides) the voice icon above a user's head and the talking icon on the right side of the screen. This is called by CZ for bots; it's not called by regular players, although you can specify a regular player (non-bot) for the playerIndex. Status is 1 for talking, or 0 for not talking.
Name: | BotVoice | ||||
Structure: |
|
Brass
Creates a brass shell. Used, for example, by the AWP, after firing.
Name: | Brass | ||||||||||||||||||||||||||||||
Structure: |
|
BuyClose
Forces the buy menu to close. This is not called when the player closes the buy menu by himself; it's only called when the game forces him to do so (ie: he walks outside of the buy zone, gets killed, etcetera).
Name: | BuyClose | |
Structure: |
|
ClCorpse
Spawns a player's corpse. Model is the player's model, for example: "leet". Delay is the delay before animation plaback, can be negative value.
Note: The Origin and Delay is in non-standard format.
Name: | ClCorpse | ||||||||||||||||||||||||
Structure: |
|
Crosshair
Draws/removes the crosshair. If Flag is set to 1 the crosshair will be drawn.
Name: | Crosshair | ||
Structure: |
|
CurWeapon
Updates the clip ammo number and weapon's corresponding ammo type icon on the HUD.
Name: | CurWeapon | ||||||
Structure: |
|
CZCareer
Supplies certain updates to the player regarding Condition Zero singleplayer missions.
Note: See the CZCareer page for more information.
Note: Using an invalid type has no repercussions whatsoever. Therefore, you can use this to make your own custom communications (you can send any number of arguments of any type after the first string).
Note: The Type argument is case-sensitive.
Note: This event does nothing in CS and CZ multiplayer.
Name: | CZCareer | ||||
Structure: |
|
CZCareerHUD
Displays certain HUD elements regarding Condition Zero singleplayer missions.
Note: See the CZCareerHUD page for more information.
Note: Using an invalid type has no repercussions whatsoever. Therefore, you can use this to make your own custom communications (you can send any number of arguments of any type after the first string).
Note: The Type argument is case-sensitive.
Note: This event has some limited functionality in CS and CZ multiplayer (albeit better in CZ).
Name: | CZCareerHUD | ||||
Structure: |
|
Damage
Called when a player takes damage, to display the red locational indicators.
Name: | Damage | ||||||||||||
Structure: |
|
DeathMsg
Fired to all players (MSG_ALL or MSG_BROADCAST) to notify them of a death. This generates the HUD message the client sees in the upper right corner of their screen.
Also prints the console text message "KillerName killed VictimName with WeaponName" or "*** KillerName killed VictimName with a headshot from WeaponName ***"
Name: | DeathMsg | ||||||||
Structure: |
|
FlashBat
Updates the flashlight battery charge on the HUD. ChargePC is in per cents.
Name: | FlashBat | ||
Structure: |
|
Flashlight
Updates the flashlight state and battery charge on the HUD. If Flag is set to 1 the flashlight HUD icon will be shown as active.
Name: | Flashlight | ||||
Structure: |
|
Fog
Note: No Information available for this event
Name: | Fog | |
Structure: |
|
ForceCam
Called whenever mp_forcecam or mp_forcechasecam are changed, with their new values passed. There is assumedly a third cvar that this tracks, but it is yet unknown. Note that this message doesn't actually change any of the spectating rules for the client.
Note: Even if mp_forcechasecam is set to 2, it is sent by this message as 1.
Name: | ForceCam | ||||||
Structure: |
|
HostageK
Temporary draws a blinking red dot on the CT players' radar when hostage is killed.
Name: | HostageK | ||
Structure: |
|
HostagePos
Draws/updates the blue mark on the CT players' radar which represents the corresponding hostage's position.
Name: | HostagePos | ||||||||||
Structure: |
|
Money
Updates the Amount of money on the HUD. If the Flag is 1, the additional new-old HUD money amount difference will be also displayed.
Name: | Money | ||||
Structure: |
|
NVGToggle
Toggles night vision mode. For Flag: 1 is on, 0 is off.
Name: | NVGToggle | ||
Structure: |
|
ResetHUD
Resets the HUD.
Name: | ResetHUD | |
Structure: |
|
RoundTime
Updates the round timer on the HUD. Time is in seconds.
Name: | RoundTime | ||
Structure: |
|
SayText
Prints say HUD text. Second parameter can be a predefined string or a custom one. In the last case the last two parameters isn't required.
Some values of the predifined string: #Cstrike_Chat_AllDead, #Cstrike_Chat_All
Name: | SayText | ||||||||
Structure: |
|
Scenario
If Active is 0, this display will be hidden. If Active is 1, displays Sprite (valid names listed in sprites/hud.txt) to the right of the round timer with an alpha value of Alpha (100-255). If flashRate is nonzero, then the sprite will flash from given the given alpha to an alpha of 100, at a rate of flashRate (measured in ???). This is used by CZ to display how many hostages remain unrescued, and also to display the ticking bomb when it is planted.
Note: If Active is 0, don't send any other arguments afterwards. Also, you don't need to send either short if flashRate is just going to be 0.
Note: Works in both CS and CZ!
Note: In CZ (and possibly CS), if someone respawns after the bomb has been planted, their Scenario event will not work at all until the next round.
Name: | Scenario | ||||||||||
Structure: |
|
ScoreAttrib
Updates the scoreboard's attribute for the specified player. For the 2nd argument, 0 is nothing, 1 is dead, 2 is bomb, 4 is VIP.
Note: Flag is a bitwise value so if VIP player dying with the bomb the Flag will be 7
Name: | ScoreAttrib | ||||
Structure: |
|
ShowMenu
Displays a "menu" to a player (text on the left side of the screen). Acts like AMXX's show_menu (in fact, this is how AMXX shows a menu).
Note: Multipart should be 1 if your menu takes up multiple messages (ie: string is too big to fit into one). On the final message, Multipart should be 0.
Name: | ShowMenu | ||||||||
Structure: |
|
StatusIcon
Draws/removes the specified status HUD icon. For Status, 0 is Hide Icon, 1 is Show Icon, 2 is Flash Icon. Red, Green and Blue arguments is optional and is specified only when Status are not 0.
Name: | StatusIcon | ||||||||||
Structure: |
|
StatusText
Specifies the status text format.
Name: | StatusText | ||||
Structure: |
|
StatusValue
Sends/updates the status values. For the Flag 1 the Value is TeamRelation, for 2 is PlayerID, for 3 is Health. For TeamRelation, 1 is Teammate player, 2 is Non-Teammate player, 3 is Hostage. If TeamRelation is the Hostage, PlayerID will be always 0.
Note: Usually is fired as a triple message, for example:
(1, 2) - non-teammate player
(2, 7) - player index is 7
(3, 59) - health is 59
Name: | StatusValue | ||||
Structure: |
|
TaskTime
Displays a secondary timer above the round timer. Used for Condition Zero singleplayer missions.
If Time is -1, timer dissappears. If Time is any other negative value, it is displayed as green instead of yellow, and considered positive.
If Active is true, timer counts down. Otherwise, it is paused.
If Fade is above zero, the timer will slowly fade out after that many seconds have passed (even if the timer is inactive).
Note: This event can only be used on missions that have an objective requiring a secondary timer!
Name: | TaskTime | ||||||
Structure: |
|
TeamInfo
TeamName is either "UNASSIGNED", "TERRORIST" or "CT".
Name: | TeamInfo | ||||
Structure: |
|
TeamScore
Updates the team score on the score board. TeamName is either "TERRORIST" or "CT".
Name: | TeamScore | ||||
Structure: |
|
TextMsg
Note: There does not necessarily have to be a total of 6 arguments, there could be as little as 2. For example you can send a message with the following:
Arg1: 1
Arg2: #Game_join_ct
Arg3: 4HM
Name: | TextMsg | ||||||||||||
Structure: |
|
Train
Displays the speed bar used for controlling a train.
Note: Speed is as follows: 0 (disable display), 1 (reverse), 2 (neutral), 3 (slow speed), 4 (medium speed), 5 (maximum speed)
Name: | Train | ||
Structure: |
|
TutorClose
Closes all CZ-style tutor popups.
Name: | TutorClose | |
Structure: |
|
TutorLine
Note: No Information available for this event
Name: | TutorLine | |
Structure: |
|
TutorState
Note: No Information available for this event
Name: | TutorState | |
Structure: |
|
TutorText
Used to display a CZ-style tutor popup.
Name: | TutorText | ||||||||||
Structure: |
|
VGUIMenu
Displays a predefined VGUI menu. Keys is a keys bit sum.
Name: | VGUIMenu | ||||||||||
Structure: |
|
ViewMode
Note: No Information available for this event (HLSDK says this switches to first-person view, but it doesn't seem to function as so)
Name: | ViewMode | |
Structure: |
|
VoiceMask
Used to tell a client who he can hear over the microphone.
Name: | VoiceMask | ||||
Structure: |
|
WeapPickup
Fired right before weapon is picked up.
Note: Notice: "right before".
Name: | WeapPickup | ||
Structure: |
|
WeaponList
Fired on weapon select.(?)
Name: | WeaponList | ||||||||||||||||||
Structure: |
|