SA-MP Forums Archive
Help me, Please (Rep+) - 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: Help me, Please (Rep+) (/showthread.php?tid=304406)



Help me, Please (Rep+) - seanny - 18.12.2011

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



Re: Help me, Please (Rep+) - [ABK]Antonio - 18.12.2011

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



Re: Help me, Please (Rep+) - seanny - 18.12.2011

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


Re: Help me, Please (Rep+) - [ABK]Antonio - 18.12.2011

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


Re: Help me, Please (Rep+) - Max_Coldheart - 18.12.2011

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



Re: Help me, Please (Rep+) - Babul - 18.12.2011

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



Re: Help me, Please (Rep+) - Max_Coldheart - 18.12.2011

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.


Re: Help me, Please (Rep+) - seanny - 18.12.2011

Nevermind, I managed it.