How to check what a player wrote in a dialog
#3

Quote:
Originally Posted by ThePhenix
Посмотреть сообщение
You can do it using an input dialog, and check if the inputtext is numeric, after this check you can perform a second check to know if the ID entered was valid or not.

PHP код:
http://wiki.sa-mp.com/wiki/ShowPlayerDialog 
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
        return 
0;

I don't know who made this function, but here it is:

PHP код:
IsNumeric(const string[])
{
        for (new 
0strlen(string); ji++)
        {
                if (
string[i] > '9' || string[i] < '0') return 0;
        }
        return 
1;

So, bassicly I'm supposed to do:

pawn Код:
if(!IsNumeric(inputtext)) ...... ?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)