29.05.2011, 01:27
Pessoal alguйm sabe me dizer como eu faзo um Keypad por dialog pra abrir com uma senha exata? eu tentei fazer mais nгo deu ;X
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_SPRINT))
{
ShowPlayerDialog(...123,...);
}
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 123)
{
if(response == 0)
{
..."vocк nгo digitou nada"
return 1;
}
if(response >= 1)
{
if(strval(inputtext) == 12345) ? SendClientMessage(playerid, 0xFFFFFFAA, "Vocк dgitou a senha 12345.") : SendClientMessage(playerid, 0xFFFFFFAA, "Vocк digitou a senha errada.");
return 1;
}
}
return 1;
}
pawn Code:
|
if(strval(inputtext) != 12345)
return SendClientMessage(playerid, 0xFFFFFFAA, "Vocк digitou a senha errada.");
SendClientMessage(playerid, 0xFFFFFFAA, "Vocк digitou a senha 12345.");
//OnDialogResponse
if(dialogid == 66665)
{
if(response == 1)
{
ShowPlayerDialog(playerid, 6985, DIALOG_STYLE_INPUT, "Digite a Senha do Keypad", ".", "OK", "");
}
if(response == 0)
{
ShowPlayerDialog(playerid, 6986, DIALOG_STYLE_INPUT, "Digite a Senha do Keypad", ".", "OK", "");
}
}
//OnPlayerKeyStateChange
if(newkeys == KEY_SPRINT)
{
if (PlayerToPoint(1, playerid,251.81860351563, 71.3359375, 1004.1585083008))
{
if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1)
{
//ShowPlayerDialog(playerid, 688, DIALOG_STYLE_MSGBOX, "Controle Remoto - Janela", " . ", "Abrir", "Fechar");
ShowPlayerDialog(playerid, 66665, DIALOG_STYLE_MSGBOX, "Controle Remoto - Janela", " . ", "Abrir", "Fechar");
ApplyAnimation(playerid,"PED","Walk_DoorPartial",4.1,0,1,1,1,1);
}
}
}