SA-MP Forums Archive
Verification Age - 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: Verification Age (/showthread.php?tid=431244)



Verification Age - cristip - 17.04.2013

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


Re: Verification Age - HurtLocker - 17.04.2013

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


Re: Verification Age - cristip - 17.04.2013

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"


Re: Verification Age - iGetty - 17.04.2013

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?


Re: Verification Age - cristip - 17.04.2013

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


Re: Verification Age - iGetty - 17.04.2013

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



Re: Verification Age - cristip - 17.04.2013

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


Re: Verification Age - MarioVPS - 17.04.2013

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.


Re: Verification Age - iGetty - 17.04.2013

Just add in there:

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