Help in dialog.
#1

pawn Код:
case DIALOG_REGISTER:
            {
                if(!response)
                {
                    Kick(playerid);
                }
                if(response)
                {
                    if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
                    new INI:File = INI_Open(UserPath(playerid));
                    INI_SetTag(File,"data");
                    INI_WriteInt(File,"Password",udb_hash(inputtext));
                    INI_WriteInt(File,"Cash",0);
                    INI_WriteInt(File,"Admin",0);
                    INI_WriteInt(File,"Kills",0);
                    INI_WriteInt(File,"Deaths",0);
                    INI_WriteInt(File,"Banned",0);
                    INI_Close(File);
                   
                    new pname[MAX_PLAYER_NAME], string[128];
                    GetPlayerName(playerid, pname, sizeof(pname));
                    format(string,256,""COL_GREEN"You have successfully registered the name "COL_WHITE"%s"COL_GREEN" with the password"COL_WHITE" %s.\n"COL_GREEN" Relog to save your stats.",pname, inputtext);
                    ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Registered",string,"Okay","");
                }
            }
When a player presses "Esc" button (!response), it does not kick him. There are 2 buttons in the dialog. Register and Quit. If someone presses the Quit button or the Esc button on their keyboard, it does not kick them but sends them the the class selection screen. Help please. Thanks in advance.

EDIT : Problem resolved. How : reason at page no. 2
Reply
#2

change
Quote:

Kick(playerid);

to
Quote:

return Kick(playerid);

or
change
Quote:

if(response)

to
Quote:

else

Reply
#3

Changed it but still the same.
Reply
#4

Код:
case DIALOG_REGISTER:
            {
                if(response)
                {
                    if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
                    new INI:File = INI_Open(UserPath(playerid));
                    INI_SetTag(File,"data");
                    INI_WriteInt(File,"Password",udb_hash(inputtext));
                    INI_WriteInt(File,"Cash",0);
                    INI_WriteInt(File,"Admin",0);
                    INI_WriteInt(File,"Kills",0);
                    INI_WriteInt(File,"Deaths",0);
                    INI_WriteInt(File,"Banned",0);
                    INI_Close(File);
                    
                    new pname[MAX_PLAYER_NAME], string[128];
                    GetPlayerName(playerid, pname, sizeof(pname));
                    format(string,256,""COL_GREEN"You have successfully registered the name "COL_WHITE"%s"COL_GREEN" with the password"COL_WHITE" %s.\n"COL_GREEN" Relog to save your stats.",pname, inputtext);
                    ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Registered",string,"Okay","");
                }
                else
                {
                    Kick(playerid);
                }
            }
Reply
#5

Tried that already but doesn't work. Any other ideas.
Reply
#6

Are you sure !response is being called?
Try this:

pawn Код:
if(!response) {
  printf("[DEBUG] Not response called for player %i.",playerid);
  return Kick(playerid);
}
Reply
#7

No message in the server log. It means it is called for? Didn't really expect this problem to go this far.
Reply
#8

Is it kicking the player in icra's code?
Reply
#9

does it registers player correctly?
Reply
#10

Quote:
Originally Posted by Faisal_khan
Посмотреть сообщение
Is it kicking the player in icra's code?
Nope.

When the player responds to the dialog, it registers him/her COMPLETELY. No errors/bugs but when he/she does not responds to it, it does not kick him/her.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)