SA-MP Forums Archive
[Ajuda] Limite de caracteres - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Limite de caracteres (/showthread.php?tid=471053)



Limite de caracteres - SkullFire - 20.10.2013

Gente, й o seguinte. Eu estou tentando fazer algumas atualizaзхes no LL Admin, e quero criar um sistema de limite de caracteres. exemplo, se a senha for menor q 3 caracteres ele nгo se registra e manda mensagem de erro . Mas nгo faзo nem ideia de como fazer isso. Tentei dar uma olhada nesse tуpico https://sampforum.blast.hk/showthread.php?tid=405993 mas nгo me adiantou muito .

PHP код:
 if(dialogid == DIALOG_REGISTRO)
        {
            if(
response)
            {
                if(!
strlen(inputtext))
                {
                    
ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_INPUT, "Registrando...", "Por Favor, para jogar se registre em \nNosso server :D\n\n{1BE0E0}Digite uma senha", "Registrar", "Sair");
                    
SendClientMessage(playerid, VERMELHO, "Digite uma senha para se registrar ¬¬");
                    return 
1;
                        }
                        
format(StringContas, sizeof(StringContas), "LLADMIN/Contas/%s.txt", Nome(playerid));
                        
dini_Create(StringContas);
                        
dini_Set(StringContas, "Senha", inputtext);
                        
dini_IntSet(StringContas, "Matou", 0);
                        
dini_IntSet(StringContas, "Morreu", 0);
                        
dini_IntSet(StringContas, "Grana", 0);
                        
dini_IntSet(StringContas, "Admin", 0);
                        
dini_IntSet(StringContas, "Advertencias", 0);
                        
dini_IntSet(StringContas, "Preso", 0);
                        
SendClientMessage(playerid, AZUL_CLARO, "Registrado Com Sucesso! vocк foi logado automaticamente");
                        return 
1;
                }
                else
                {
                    
SendClientMessage(playerid, VERMELHO, "Vocк nгo quis se registrar e por isso foi kickado!");
                        
Kick(playerid);
                        return 
1;
                }
        } 
Se alguйm tiver um tutorial, ou algum cуdigo que explique . Eu agradeзo de coraзгo -q


Re: Limite de caracteres - Gii - 20.10.2013

pawn Код:
if (strlen(inputtext) < 3 ) {

    SendClientMessage(playerid, -1, "Sua senha deve conter no mнnimo 3 caracteres!");
    //ShowPlayerDialog(...);
    return 1;
}



Re: Limite de caracteres - SkullFire - 20.10.2013

Valeu anjo do senhor -n . +REP , ta bloqueado. dps te dou :P