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

You can do it using an input dialog, and check if the inputtext is numeric, after that you have to strval(inputtext); and finally 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;

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 4 Guest(s)