ShowMenuForPlayer

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 21:39, 26 April 2015
MP2 (Talk | contribs)

← Previous diff
Current revision
OstGot (Talk | contribs)

Line 9: Line 9:
{{ReturnsSuccess||Menu and/or player doesn't exist.}} {{ReturnsSuccess||Menu and/or player doesn't exist.}}
 +{{Example}}
<pawn> <pawn>
new Menu:MENU_PlayerTeleport; new Menu:MENU_PlayerTeleport;

Current revision



Description:

Shows a previously created menu for a player.


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


Return Values:

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


Example Usage:

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 they're related to this function in one way or another.

Personal tools
In other languages