ShowMenuForPlayer

ShowMenuForPlayer

Description:
Function ShowMenuForPlayer shows a previously created menu for a player.
Crashes the both server and player if an invalid menu ID given.


Parameters:
(menuid, playerid)
int menuid The ID of the menu to show. Returned by CreateMenu.
int playerid The ID of the player to whom the menu will be shown.


Return Values:
  • 1: The function was executed successfully.
  • 0: The function failed to execute. Menu and/or player doesn't exist.


Examples:
new Menu:MENU_PlayerTeleport;
 
public OnGameModeInit()
{
    MENU_PlayerTeleport = CreateMenu(...);
    return 1;
}
 
if(strcmp(cmdtext, "/tele", true) == 0)
{
    ShowMenuForPlayer(MENU_PlayerTeleport, playerid);
    return 1;
}


Related Functions
The following functions may be useful, as they are related to this function in one way or another.


Related Callbacks
The following callbacks might be useful as well, as they are related to this callback in one way or another.