Przejdź do głównej zawartości

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.

NameDescription
playeridThe 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
}
}
}