---
title: "SetActorHealth | open.mp"
description: "سلامتی actor رو تنظیم می‌کنه."
canonical: https://omp.itsneufox.com/fa/docs/scripting/functions/SetActorHealth
language: fa
---

# SetActorHealth

هشدار

This function was added in SA-MP 0.3.7 and will not work in earlier versions!

## توضیحات

سلامتی actor رو تنظیم می‌کنه.

| نام | توضیحات |
| --- | --- |
| actorid | ID actor که سلامتیش رو می‌خوایم تنظیم کنیم. |
| Float:health | مقداری که سلامتی actor بهش تنظیم می‌شه. |

## مقدار برگشتی

**true** - موفقیت

**false** - شکست (مثلاً actor ساخته نشده).

## مثال‌ها

```c
new gMyActor;

public OnGameModeInit()
{
    gMyActor = CreateActor(179, 316.1, -134.0, 999.6, 90.0); // Actor as salesperson in Ammunation

    SetActorHealth(gMyActor, 100.0);
    return 1;
}
```

## توابع مرتبط

-   [GetActorHealth](https://omp.itsneufox.com/fa/docs/scripting/functions/GetActorHealth): گرفتن سلامتی actor.
-   [SetActorInvulnerable](https://omp.itsneufox.com/fa/docs/scripting/functions/SetActorInvulnerable): تنظیم آسیب نپذیری actor.
