14.12.2014, 12:10
Update, not insert. And while we're at it, this block of code can be compacted. Always avoid duplicate code. If a change is to be made, you want to do it in only one place.
pawn Код:
if(dialogid == SEXMENU) // could probably use a switch here, as well
{
new name[MAX_PLAYER_NAME], query[128];
GetPlayerName(playerid, name, sizeof(name));
format(query, sizeof(query), "UPDATE accounts SET psex=%d WHERE name='%s'", (response) ? 1 : 2, name);
mysql_function_query(sqlconnect, query, false, "", "");
SetPlayerSkin(playerid, (response) ? 185 : 193);
ShowPlayerDialog(playerid, AGEMENU, DIALOG_STYLE_INPUT, "{00C0FF}Amzius", "{FFFFFF}Kiek jums metu ?", "Submit", "Cancel");
}