---
title: "EnablePlayerCameraTarget | open.mp"
description: "Toggle camera targeting functions for a player."
canonical: https://omp.itsneufox.com/th/docs/scripting/functions/EnablePlayerCameraTarget
language: th
---

# EnablePlayerCameraTarget

warning

ฟังก์ชั่นนี้ถูกเพิ่มใน SA-MP 0.3.7 และจะไม่ทำงานในเวอร์ชั่นก่อนหน้านี้!

## คำอธิบาย

Toggle camera targeting functions for a player. Disabled by default to save bandwidth.

| Name | Description |
| --- | --- |
| playerid | The ID of the player to toggle camera targeting functions for. |
| enable | 1 to enable camera targeting functions and 0 to disable them. |

## ส่งคืน

1: The function executed successfully.

0: The function failed to execute. The player is not connected.

## ตัวอย่าง

```c
public OnPlayerConnect(playerid)
{
     EnablePlayerCameraTarget(playerid, 1);
     return 1;
}
```

## ฟังก์ชั่นที่เกี่ยวข้องกัน

-   [GetPlayerCameraTargetVehicle](https://omp.itsneufox.com/th/docs/scripting/functions/GetPlayerCameraTargetVehicle): Get the ID of the vehicle a player is looking at.
-   [GetPlayerCameraTargetPlayer](https://omp.itsneufox.com/th/docs/scripting/functions/GetPlayerCameraTargetPlayer): Get the ID of the player a player is looking at.
-   [GetPlayerCameraFrontVector](https://omp.itsneufox.com/th/docs/scripting/functions/GetPlayerCameraFrontVector): Get the player's camera front vector
