Verification Age
#1

Hy,i need to verify the age of players,and i wonder if i can do that with "if" statament ori regex match?can somebody help me please.Thanks very much
Reply
#2

The age input is just a number, why would you need either "if" or register expression strings?
Reply
#3

Quote:
Originally Posted by HurtLocker
Посмотреть сообщение
The age input is just a number, why would you need either "if" or register expression strings?
I need for "/stats"
Reply
#4

Still, that makes no sense. From what I can tell you're trying to show a dialog that asks their age, then you want to ask it again, to verify it?

Or, do you want to store it into a variable that you can use elsewhere on the script?
Reply
#5

Quote:
Originally Posted by iGetty
Посмотреть сообщение
Still, that makes no sense. From what I can tell you're trying to show a dialog that asks their age, then you want to ask it again, to verify it?

Or, do you want to store it into a variable that you can use elsewhere on the script?
i want to use elsewhere on the script
Reply
#6

Simply do this:

pawn Код:
//top of script
new PlayerAge[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Age", "Please define your age below:", "Ok", "Cancel");
    return 1;
}

public OnDialogResponse(playerid, dialogid, ...)
{
    if(dialogid == 1)
    {
        if(response)
        {
            PlayerAge[playerid] = strval(inputtext);
        }
    }
    return 1;
}
Reply
#7

Quote:
Originally Posted by iGetty
Посмотреть сообщение
Simply do this:

pawn Код:
//top of script
new PlayerAge[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Age", "Please define your age below:", "Ok", "Cancel");
    return 1;
}

public OnDialogResponse(playerid, dialogid, ...)
{
    if(dialogid == 1)
    {
        if(response)
        {
            PlayerAge[playerid] = strval(inputtext);
        }
    }
    return 1;
}
i want to restrict the age,i need to make if inputtext > 12 , <39
Reply
#8

You will find it in any admin script, or find any code for it and create it in your admin system,

Pawno >> pawn.exe >> File>Open >> View the admin system >> CMDtats,dcmd_stats,COMMANDtats >> add the code thats you found there.
Reply
#9

Just add in there:

pawn Код:
if(strval(inputtext) > 12 && strval(inputtext) < 39)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)