10.02.2010, 18:08
Well. I have seen you can make it to where you can make a dialog box come up and you can type in a password to open gates and doors, ect. I just started scripting again and I am new to dialogs. I am asking how do I make it to where you must enter a specific password into the box for an action to take place. Here I made a sample code to show you what I am talking about.
If I put in 4205 is still says I have entered the wrong combination.
is probably the wrong thing to do. I am not sure since I am new to dialogs. If someone could help me thanks. :/
Код:
if(strcmp(cmd, "/testduty", true) == 0)
{
if(IsACop(playerid))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "LVSP", "Enter your locker combination below.", "Enter", "Cancel");
return 1;
}
}
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(IsACop(playerid))
{
if(dialogid == 1)
{
if(response == 1)
{
if(strlen(inputtext)==4205)
{
GivePlayerWeapon(playerid, 22, 1017);
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You entered the wrong combination.");
return 1;
}
}
if(response == 0)
{
SendClientMessage(playerid, COLOR_RED, "You pressed cancel.");
return 1;
}
}
return 1;
}
return 0;
}
Код:
if(strlen(inputtext)==4205)


