30.06.2013, 15:31
I have a question, is it possible to move object with Dialog_Style_Password? if yes, how can I do it?
//on the top
gate = CreateObject(980,-503.2999900,2592.6999500,54.8000000,0.0000000,0.0000000,269.0000000); //object(airportgate) (1)
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Chat", "Type your chat input here.", "Submit", "Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 3)
{
if(!response) // If they clicked 'Cancel' or pressed esc
{
SendClientMessage(playerid, COLOR_RED, "You MUST type correct pass to open gate.");
//For info & code of this function please refer to the bottom of this article.
}
else // Pressed ENTER or clicked 'Login' button
{
if(!strcmp(inputtext, "1234", true))
{
DestroyObject(gate);
}
else
{
SendClientMessage(playerid, COLOR_RED, "FAIL PASS.");
}
}
return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
}
return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
}
if(!strcmp(inputtext, "1234", true))
if(strcmp(inputtext, "1234", true) == 0)
if(strcmp(inputtext, "1234", true) == 0)
{
SendClientMessage(playerid, -1, "Worked."); // Telling you it has worked
DestroyObject(gate);
}
gate = CreateObject(980,-503.2999900,2592.6999500,54.8000000,0.0000000,0.0000000,269.0000000); //object(airportgate) (1)
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Chat", "Type your chat input here.", "Submit", "Cancel");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 3)
{
if(!response) // If they clicked 'Cancel' or pressed esc
{
SendClientMessage(playerid, COLOR_RED, "You MUST type correct pass to open gate.");
//For info & code of this function please refer to the bottom of this article.
}
else // Pressed ENTER or clicked 'Login' button
{
if(strcmp(inputtext, "1234", true) == 0)
{
DestroyObject(gate);
SendClientMessage(playerid, -1, "Worked");
}
else
{
SendClientMessage(playerid, COLOR_RED, "FAIL PASS.");
}
}
return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
}
return 0;
}