# hltv\_changed\_target

- **Ortam:** İstemci, Menü
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/gameevent/hltv_changed_target
- **Çeviri tarihi:** 2025-09-08

## Description

Called when the HLTV observer target changes.

## Members

- [number](https://gmod.tr/wiki/number) **mode**

  The [OBS_MODE](https://gmod.tr/wiki/Enums/OBS_MODE).

- [number](https://gmod.tr/wiki/number) **obs_target**

  The [EntIndex](https://gmod.tr/wiki/Entity.EntIndex) of the new Target.

- [number](https://gmod.tr/wiki/number) **old_target**

  The [EntIndex](https://gmod.tr/wiki/Entity.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.

```lua
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 )
```

- [GMod Wiki ana sayfası](https://gmod.tr/wiki)

---

[Tüm sunucular](https://gmod.tr/) · [GmodTR Launcher](https://gmod.tr/launcher) · [Rehber](https://gmod.tr/rehber) · [GMod Wiki](https://gmod.tr/wiki) · [GmodTR nedir?](https://gmod.tr/hakkinda) · [Sunucu ekle](https://gmod.tr/sunucu-ekle) · [Discord](https://discord.gg/gmodtr)

Kaynak: https://gmod.tr/wiki/gameevent/hltv_changed_target
