Okay. So I made a dialog with ages 16-50. When they choose an age, it
be set by using "listitem+16". I
statements i'd just use that (listitem+16). But this isn't working, it just returns 0 all the time. I need a simpler way that will work.
Any ideas would be appreciated.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new
string[128],
name[MAX_PLAYER_NAME],
file[128];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), "%s.ini", name);
if (dialogid == DIALOG_AGE)
{
if (response == 1)
{
dini_Create(file);
dini_IntSet(file, "pAdminLevel", 0);
dini_IntSet(file, "pAge", 16+listitem);
LoadPlayerStats(playerid);
format(string, sizeof(string), "You've select age %d!", PlayerInfo[playerid][pAge]);
SendClientMessage(playerid, COLOR_GREEN, string);
format(string, sizeof(string), "Account Successfully Created (Name: %s || Age: %d)!", name, PlayerInfo[playerid][pAge]);
SendClientMessage(playerid, COLOR_BLUE, string);
TogglePlayerControllable(playerid, 1);
SpawnPlayer(playerid);
/*
SetPlayerPos(playerid, X, Y, Z);
SetPlayerFacingAngle(playerid, A);
SetPlayerInterior(playerid, I);
*/
return true;
}
else if (response == 0)
{
SendClientMessage(playerid, COLOR_RED, "You have canceled!");
Kick(playerid);
return true;
}
}
return true;
}