---
title: "ShowMenuForPlayer | open.mp"
description: "Shows a previously created menu for a player."
canonical: https://omp.itsneufox.com/th/docs/scripting/functions/ShowMenuForPlayer
language: th
---

# ShowMenuForPlayer

## คำอธิบาย

Shows a previously created menu for a player.

| Name | Description |
| --- | --- |
| menuid | The ID of the menu to show. Returned by CreateMenu. |
| playerid | The ID of the player to whom the menu will be shown. |

## ส่งคืน

1: The function executed successfully.

0: The function failed to execute. Menu and/or player doesn't exist.

## ตัวอย่าง

```c
new Menu:MENU_PlayerTeleport;

public OnGameModeInit()
{
    MENU_PlayerTeleport = CreateMenu(...);
    return 1;
}

if (strcmp(cmdtext, "/tele", true) == 0)
{
    ShowMenuForPlayer(MENU_PlayerTeleport, playerid);
    return 1;
}
```

## บันทึก

warning

Crashes the both server and player if an invalid menu ID given. (Fixed in open.mp)

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

-   [CreateMenu](https://omp.itsneufox.com/th/docs/scripting/functions/CreateMenu): Create a menu.
-   [AddMenuItem](https://omp.itsneufox.com/th/docs/scripting/functions/AddMenuItem): Adds an item to a specified menu.
-   [SetMenuColumnHeader](https://omp.itsneufox.com/th/docs/scripting/functions/SetMenuColumnHeader): Set the header for one of the columns in a menu.
-   [DestroyMenu](https://omp.itsneufox.com/th/docs/scripting/functions/DestroyMenu): Destroy a menu.
-   [OnPlayerSelectedMenuRow](https://omp.itsneufox.com/th/docs/scripting/callbacks/OnPlayerSelectedMenuRow): Called when a player selected a row in a menu.
-   [OnPlayerExitedMenu](https://omp.itsneufox.com/th/docs/scripting/callbacks/OnPlayerExitedMenu): Called when a player exits a menu.
