Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
// new sendername[MAX_PLAYER_NAME];
new string[128];
new tmp2[256];
if(dialogid == signindial)
{
new tmppass[64];
if(!response)
{
if(accountplay)
{
if (gdebug >=1){printf("accountplay");}
return 1;
}
//format(sendername, sizeof(sendername), "Player[%d]", playerid);
//SetPlayerName(playerid, sendername);
gPlayerResponse[playerid] = 1;
return 0;
}
if(!strlen(inputtext))
{
format(string,sizeof(string),"Password does not match your name!\n\nPut correctly password");
ShowPlayerDialog(playerid,signindial,DIALOG_STYLE_INPUT,"Login Plase!",string,"Login","Cancel");
return 1;
}
strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
Encript(tmppass);
if (gdebug){printf("DEBUG enterd %s", tmppass);}
OnPlayerLogin(playerid,tmppass);
gPlayerResponse[playerid] = 1;
}
else if (dialogid == signupdial)
{
if(!response)
{
if(accountplay)
{
if (gdebug >=1){printf("accountplay");}
return 1;
}
gPlayerResponse[playerid] = 1;
return 0;
}
if(!strlen(inputtext))
{
format(string,sizeof(string),"\nContiune to register!");
ShowPlayerDialog(playerid,signupdial,DIALOG_STYLE_INPUT,"Register Plase!",string,"Register","Cancel");
return 1;
}
if (strlen(inputtext) > 12)
{
format(string,sizeof(string),"\nPassword must be less than 12 characters!");
ShowPlayerDialog(playerid,signupdial,DIALOG_STYLE_INPUT,"Register Plase!",string,"Register","Cancel");
return 1;
}
format(tmp2, sizeof(tmp2), "/register %s", inputtext);
OnPlayerCommandText(playerid, tmp2);
gPlayerResponse[playerid] = 1;
}
return 1;
}
Where can i put if they click cancel = it should kick them out from server or make cancel not click able ?