24.09.2013, 11:57
Hello everyone, I am trying to make a basic system with dialog style input, but I am failing to understand how to exactly use that, I am willing to make something similar to a clothes system, like "enter the clothes id below to get them", but all I am seeing in SAMP Wiki is that:
I don't really understand it, neither how to do the thing I want.
If anyone could help me taht would be great. Thanks in advance.
pawn Код:
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", "Please enter your password:", "Login", "Cancel");
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_LOGIN)
{
if(!response) // If they clicked 'Cancel' or pressed esc
{
KickWithMessage(playerid, COLOR_RED, "You MUST login to play here. Please change your name.");
//For info & code of this function please refer to the bottom of this article.
}
else // Pressed ENTER or clicked 'Login' button
{
if(CheckPassword(playerid, inputtext))
{
SendClientMessage(playerid, COLOR_RED, "You are now logged in!");
}
else
{
SendClientMessage(playerid, COLOR_RED, "LOGIN FAILED.");
// Re-show the login dialog
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", "Please enter your password:", "Login", "Cancel");
}
}
return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
}
return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}
If anyone could help me taht would be great. Thanks in advance.