Detect listitem
#4

I have a problem with retrieving the id from inputtext.
inputtext returns the number 49.
CharacterMonth[playerid] returns the number 52.

What am i doing wrong?

PHP код:
ShowPlayerDialog(playeridDIALOG_ACCOUNT_REGISTRATION+8DIALOG_STYLE_TABLIST_HEADERS"Character Creation - Select a Month""#\tMonth\n1\tJanuary\n2\tFebruary\n3\tMarch\n4\tApril\n5\tMay\n6\tJune\n7\tJuly\n8\tAugust\n9\tSeptember\n10\tOctober\n11\tNovember\n1\tDecember""Confirm""Close");
         
if(
dialogid==DIALOG_ACCOUNT_REGISTRATION+8)
    {
        if(
response)
        {
            new 
MonthStr[10],MonthStrPrep[10];
            
format(MonthStrPrepsizeof(MonthStrPrep), "%d"inputtext);
            
CharacterMonth[playerid] = strval(MonthStrPrep);
            if(
CharacterMonth[playerid] >= && CharacterMonth[playerid] <= 9)
            {
                
format(MonthStrsizeof(MonthStr), "0%d"CharacterMonth[playerid]);
            } else {
                
format(MonthStrsizeof(MonthStr), "%d"CharacterMonth[playerid]);
            }
            
PlayerTextDrawSetString(playerid,CharacterCreationTD30[playerid],MonthStr);
        }
        return 
1;
    } 
Edit: This fixed it

PHP код:
format(MonthStrPrepsizeof(MonthStrPrep), "%s"inputtext); 
Reply


Messages In This Thread
Detect listitem - by jasperschellekens - 21.02.2018, 19:21
Re: Detect listitem - by NaS - 21.02.2018, 19:24
Re: Detect listitem - by Kaperstone - 21.02.2018, 19:32
Re: Detect listitem - by jasperschellekens - 01.05.2018, 18:12

Forum Jump:


Users browsing this thread: 2 Guest(s)