SA-MP Forums Archive
Won't kick a player - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Won't kick a player (/showthread.php?tid=311938)



Won't kick a player - Gerira Gaijin - 18.01.2012

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;
    }



Re: Won't kick a player - [ABK]Antonio - 18.01.2012

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


Re: Won't kick a player - Gerira Gaijin - 18.01.2012

Nope, doesn't works :/


Re: Won't kick a player - Tannz0rz - 19.01.2012

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


Re: Won't kick a player - Gerira Gaijin - 19.01.2012

The string is loaded correctly

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



Respuesta: Won't kick a player - OPremium - 19.01.2012

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


Re: Respuesta: Won't kick a player - [ABK]Antonio - 19.01.2012

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