note Help Needed
This wiki is the result of an ongoing community effort — thank you all for helping!
If you want to provide changes to this page then please click here.
HidePlayerDialog
warning
This function was added in omp v1.1.0.2612 and will not work in earlier versions!
Description
Hides any dialog the player may currently be able to see.
Name | Description |
---|---|
playerid | The ID of the player to hide their current dialog from. |
Returns
true - The function was executed successfully.
false - The function failed to execute. This means the player is not connected or they aren't looking at a dialog.
Examples
public OnPlayerConnect(playerid)
{
if (IsAccountRegistered(playerid)) // Imaginary function to check if the player name is registered
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Insert Your Password", "Login", ""); // shows login dialog to player
new ipAddress[16];
GetPlayerIp(playerid, ipAddress, sizeof(ipAddress)); // get player's ip address
if (IsBanned(ipAddress)) // check if the player ip is banned
{
SendClientMessage(playerid, 0xFF0000FF, "You are banned from this server!");
HidePlayerDialog(playerid); // Hides login dialog
}
}
}
Related Functions
- ShowPlayerDialog: Shows the player a synchronous (only one at a time) dialog box.
- GetPlayerDialogData: Get the data of the dialog currently show to the player.
- GetPlayerDialogID: Get the ID of the dialog currently show to the player.