07.12.2017, 11:11
Hey yall, im trying to save the age from an inputtext from an dialog.
I played around with it for around an hour or two but I cant get it to work.
I just want to store what ever number the player entered in dialogid 3 and save it to the SQLite database.
Code:
I played around with it for around an hour or two but I cant get it to work.
I just want to store what ever number the player entered in dialogid 3 and save it to the SQLite database.
Code:
pawn Код:
public OnPlayerSpawn(playerid)
{
new str[2500];
strcat(str,""chat" "COL_WHITE"Enter your age");
ShowPlayerDialog(playerid,3,DIALOG_STYLE_INPUT,""COL_WHITE"Alice",str,"Enter","");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 3)
{
if(response)
{
new Query[1000];
new amount[128] = inputtext;
User[playerid][USER_AGE] = amount[playerid];
format(Query, sizeof(Query), "UPDATE users SET age = %d", User[playerid][USER_AGE]);
db_query(Database, Query);
}
}
}