---
title: "OnPlayerSelectedMenuRow | open.mp"
description: "Acest callback este apelat atunci când un jucător selectează un articol dintr-un meniu (ShowMenuForPlayer)."
canonical: https://omp.itsneufox.com/ro/docs/scripting/callbacks/OnPlayerSelectedMenuRow
language: ro
---

# OnPlayerSelectedMenuRow

## Descriere

Acest callback este apelat atunci când un jucător selectează un articol dintr-un meniu (ShowMenuForPlayer).

| Nume | Descriere |
| --- | --- |
| playerid | ID-ul jucătorului care a selectat un element de meniu. |
| row | ID-ul rândului care a fost selectat. Primul rând este ID 0. |

## Returnări

Este întotdeauna numit primul în modul de joc.

## Exemple

```c
new Menu:MyMenu;

public OnGameModeInit()
{
    MyMenu = CreateMenu("Exemplu de meniu", 1, 50.0, 180.0, 200.0, 200.0);
    AddMenuItem(MyMenu, 0, "Element 1");
    AddMenuItem(MyMenu, 0, "Element 2");
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    if (GetPlayerMenu(playerid) == MyMenu)
    {
        switch (row)
        {
            case 0: print("Elementul 1 selectat");
            case 1: print("Elementul 2 selectat");
        }
    }
    return 1;
}
```

## Note

note

ID-ul meniului nu este transmis acestui callback. GetPlayerMenu trebuie utilizat pentru a determina în ce meniu jucătorul a selectat un element.

## Funcții similare

-   [CreateMenu](https://omp.itsneufox.com/ro/docs/scripting/functions/CreateMenu): Creați un meniu.
-   [DestroyMenu](https://omp.itsneufox.com/ro/docs/scripting/functions/DestroyMenu): Distrugeți un meniu.
-   [AddMenuItem](https://omp.itsneufox.com/ro/docs/scripting/functions/AddMenuItem): Adaugă un element la un meniu specificat.
-   [ShowMenuForPlayer](https://omp.itsneufox.com/ro/docs/scripting/functions/ShowMenuForPlayer): Afișează un meniu pentru un jucător.
-   [HideMenuForPlayer](https://omp.itsneufox.com/ro/docs/scripting/functions/HideMenuForPlayer): Ascunde un meniu pentru un jucător.
