Ana içeriğe geç

ShowMenuForPlayer

Description

Shows a previously created menu for a player.

NameDescription
Menu:menuidThe ID of the menu to show. Returned by CreateMenu.
playeridThe ID of the player to whom the menu will be shown.

Returns

true - The function executed successfully.

false - The function failed to execute. Menu and/or player doesn't exist.

Examples

new Menu:exampleMenu;

public OnGameModeInit()
{
exampleMenu = CreateMenu("Example Menu", 2, 200.0, 100.0, 150.0, 150.0);
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/menu", true) == 0)
{
ShowMenuForPlayer(exampleMenu, playerid);
return 1;
}
return 0;
}

Notes

ipucu

Crashes the both server and player if an invalid menu ID given.