Help me, Please (Rep+)
#1

Hello, How can I change this so that the player will have to type a 2-digit number?
pawn Код:
case DIALOG_AGE:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
               
                return 1;
            }
        }
Reply
#2

pawn Код:
if(response)
{
    if(inputtext >= 3 || inputtext <= 0)
    {
        Kick(playerid);
    }
    else
    {
        //what you want to do to
    }
    return 1;
}
I believe that's how it's done...I can't really remember as I don't use input dialogs...
EDIT: do not use this I just remembered something lol

pawn Код:
if(strlen(inputtext) > 3 || strlen(inputtext) < 0) Kick(playerid);
Reply
#3

Uhmm.. Why is their a Kick function? I intended that snippet for my new custom RP GM.
Reply
#4

Quote:
Originally Posted by seanny
Посмотреть сообщение
Uhmm.. Why is their a Kick function? I intended that snippet for my new custom RP GM.
It doesn't really matter what's there...I was just showing you - Also ignore the strlen after the || you shouldn't need it
Reply
#5

pawn Код:
if(strlen(inputtext) > 3)) return Kick(playerid);
Reply
#6

Код:
case DIALOG_AGE:
{
	if ( !response ) return Kick ( playerid );
	new Age=strval(inputtext);
	if(Age<10 || Age>99) return Kick(playerid);
}
Reply
#7

Quote:
Originally Posted by Babul
Посмотреть сообщение
Код:
case DIALOG_AGE:
{
	if ( !response ) return Kick ( playerid );
	new Age=strval(inputtext);
	if(Age<10 || Age>99) return Kick(playerid);
}
Or then you can use strlen to find out the length of the inputtext.
Reply
#8

Nevermind, I managed it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)