Won't kick a player
#1

When a player types a wrong password, he doesn't gets kicked. What am I doing wrong?

pawn Код:
if(dialogid == ADMINPIN_INPUT){
        if(!response) return Kick(playerid);
        if(!strlen(inputtext)) return ShowPlayerDialog(playerid,ADMINPIN_DIALOG,DIALOG_STYLE_INPUT,"Enter administrator PIN","Please enter your administration PIN number:","Confirm","");
        if(strlen(inputtext) > 32) return ShowPlayerDialog(playerid,ADMINPIN_DIALOG,DIALOG_STYLE_INPUT,"Enter administrator PIN","Please enter your administration PIN number:","Confirm","");     
        if(strcmp(inputtext, pInfo[playerid][pAdminPIN], false)) return Kick(playerid);
        return 1;
    }
Reply
#2

pawn Код:
if(strcmp(inputtext, pInfo[playerid][pAdminPIN], false) != 0) return Kick(playerid)
Hmm can try that, not sure if it would work
Reply
#3

Nope, doesn't works :/
Reply
#4

I suggest you make use of printf and see what pInfo[playerid][pAdminPIN] contains.
Reply
#5

The string is loaded correctly

Код:
[02:41:26] AdminPIN contains: test2
Reply
#6

Why in OnDialogResponse you check if dialogid = ADMINPIN_INPUT, but when you 'recreate' the dialog, you put ADMINPIN_DIALOG as dialogid?

pawn Код:
if(dialogid == ADMINPIN_INPUT) // <---- THIS
{
        if(!response) return Kick(playerid);
        if(!strlen(inputtext)) return ShowPlayerDialog(playerid,ADMINPIN_DIALOG/*<-- WTF?*/,DIALOG_STYLE_INPUT,"Enter administrator PIN","Please enter your administration PIN number:","Confirm","");
        if(strlen(inputtext) > 32) return ShowPlayerDialog(playerid,ADMINPIN_DIALOG,DIALOG_STYLE_INPUT,"Enter administrator PIN","Please enter your administration PIN number:","Confirm","");      
        if(strcmp(inputtext, pInfo[playerid][pAdminPIN], false)) return Kick(playerid);
        return 1;
    }
Try adding a print there and see if its called in the first place
Reply
#7

Quote:
Originally Posted by OPremium
Посмотреть сообщение
Why in OnDialogResponse you check if dialogid = ADMINPIN_INPUT, but when you 'recreate' the dialog, you put ADMINPIN_DIALOG as dialogid?

pawn Код:
if(dialogid == ADMINPIN_INPUT) // <---- THIS
{
        if(!response) return Kick(playerid);
        if(!strlen(inputtext)) return ShowPlayerDialog(playerid,ADMINPIN_DIALOG/*<-- WTF?*/,DIALOG_STYLE_INPUT,"Enter administrator PIN","Please enter your administration PIN number:","Confirm","");
        if(strlen(inputtext) > 32) return ShowPlayerDialog(playerid,ADMINPIN_DIALOG,DIALOG_STYLE_INPUT,"Enter administrator PIN","Please enter your administration PIN number:","Confirm","");      
        if(strcmp(inputtext, pInfo[playerid][pAdminPIN], false)) return Kick(playerid);
        return 1;
    }
Try adding a print there and see if its called in the first place
if no text is input he wants them to be sent back to it to try again this time containing text
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)