12.06.2014, 18:27
Hey all,
This is what I am doing to store a variable:
And now I want to load this variable:
And I want to use that result here:
But it is showing me the dialog and printing 'yeah'.
Am I doing it right?
This is what I am doing to store a variable:
pawn Код:
PlayerInfo[playerid][pSkillSelected] = 1;
mysql_format(mysql, f_query, sizeof(f_query), "UPDATE playerdata SET SkillSelected='%i' WHERE name='%s'", PlayerInfo[playerid][pSkillSelected], PlayerInfo[playerid][name]);
mysql_tquery(mysql, f_query, "", "");
pawn Код:
forward LoadAccount(playerid);
public LoadAccount(playerid)
{
new rows = cache_num_rows();
if(!rows) {
printf("[DATABASE ERROR]: Account does not exist.");
}
else if(rows == 1) {
cache_get_field_content(0, "IP", PlayerInfo[playerid][IP], mysql, 17);
cache_get_field_content(0, "Sex", PlayerInfo[playerid][pSex], mysql);
cache_get_field_content(0, "Age", PlayerInfo[playerid][pAge], mysql);
cache_get_field_content(0, "Medic", PlayerInfo[playerid][pAthelete], mysql);
cache_get_field_content(0, "Mechanic", PlayerInfo[playerid][pMechanic], mysql);
cache_get_field_content(0, "Pilot", PlayerInfo[playerid][pPilot], mysql);
cache_get_field_content(0, "SkillSelected", PlayerInfo[playerid][pSkillSelected]);
}
else if(rows > 1) {
printf("[DATABASE ERROR]: Multiple accounts matching player %d.", playerid);
}
}
pawn Код:
if(PlayerInfo[playerid][pSkillSelected] != 1)
{
ShowPlayerDialog(playerid, DIALOG_SKILL, DIALOG_STYLE_LIST, "Select the skill you want your chracter to have","Medic\nAthlete\nPilot\nMechanic","Select","Quit");
print("yeah!");
}
Am I doing it right?