Garry's Mod Wiki

hltv_changed_target

Description

Called when the HLTV observer target changes.

Members

number obs_target
The EntIndex of the new Target.
number old_target
The EntIndex of the old Target.

Examples

Example

This is a basic template with the purpose of including all arguments / table variables to make it easily known which values can be accessed.

gameevent.Listen( "hltv_changed_target" ) hook.Add( "hltv_changed_target", "hltv_changed_target_example", function( data ) local mode = data.mode -- The Observer mode local obs_target = data.obs_target -- Entity:EntIndex() of new Target local old_target = data.old_target -- Entity:EntIndex() of old Target -- Called when the HLTV observer target changes. end )