15.06.2015, 09:16
well, here it gets me arguement type mismatch
PHP код:
if(dialogid == DIALOG_REGISTER)
{
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "You should enter a password in order to continue", "Register", "Quit");
new query[200], pName[MAX_PLAYER_NAME], tmp;
format(query, sizeof(query), "SELECT id FROM accounts ORDER BY id DESC LIMIT 1");
mysql_query(query);
mysql_store_result();
while(mysql_fetch_row_format(query, "|"))
{
mysql_get_field("id", tmp);
strval(tmp);
tmp = tmp + 1;
}
mysql_free_result();
GetPlayerName(playerid, pName, sizeof(pName));
format(query, sizeof(query), "INSERT INTO accounts(id, name, password) VALUES ('%i', '%s','%s')", tmp, pName, inputtext);
mysql_query(query);
SendClientMessage(playerid, -1, "You have been registered");
}