---
title: "CreateExplosionForPlayer | open.mp"
description: "Creates an explosion that is only visible to a single player."
canonical: https://omp.itsneufox.com/th/docs/scripting/functions/CreateExplosionForPlayer
language: th
---

# CreateExplosionForPlayer

## คำอธิบาย

Creates an explosion that is only visible to a single player. This can be used to isolate explosions from other players or to make them only appear in specific virtual worlds.

| Name | Description |
| --- | --- |
| playerid | The ID of the player to create the explosion for. |
| Float:X | The X coordinate of the explosion. |
| Float:Y | The Y coordinate of the explosion. |
| Float:Z | The Z coordinate of the explosion. |
| type | The [type](https://omp.itsneufox.com/th/docs/scripting/resources/explosionlist) of the explosion. |
| Float:radius | The radius of the explosion. |

## ส่งคืน

This function always returns 1, even if the function failed to excute (player doesn't exist, invalid radius, or invalid explosion type).

## ตัวอย่าง

```c
if (strcmp(cmdtext, "/burnme", true) == 0)
{
    new Float:POS[3];
    GetPlayerPos(playerid, POS[0], POS[1], POS[2]);
    CreateExplosionForPlayer(playerid, POS[0], POS[1], POS[2], 1, 10.0);
    return 1;
}
```

## บันทึก

หมายเหตุ

There is a limit as to how many explosions can be seen at once by a player. This is roughly 10.

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

-   [CreateExplosion](https://omp.itsneufox.com/th/docs/scripting/functions/CreateExplosion): Create an explosion which is visible for all players.
-   [Explosion Types](https://omp.itsneufox.com/th/docs/scripting/resources/explosionlist): A list of all the explosion types.
