01.05.2018, 18:12
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?
Edit: This fixed it
inputtext returns the number 49.
CharacterMonth[playerid] returns the number 52.
What am i doing wrong?
PHP код:
ShowPlayerDialog(playerid, DIALOG_ACCOUNT_REGISTRATION+8, DIALOG_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(MonthStrPrep, sizeof(MonthStrPrep), "%d", inputtext);
CharacterMonth[playerid] = strval(MonthStrPrep);
if(CharacterMonth[playerid] >= 1 && CharacterMonth[playerid] <= 9)
{
format(MonthStr, sizeof(MonthStr), "0%d", CharacterMonth[playerid]);
} else {
format(MonthStr, sizeof(MonthStr), "%d", CharacterMonth[playerid]);
}
PlayerTextDrawSetString(playerid,CharacterCreationTD30[playerid],MonthStr);
}
return 1;
}
PHP код:
format(MonthStrPrep, sizeof(MonthStrPrep), "%s", inputtext);