help mysql r7
#2

A bit of logic ffs.

Код:
WHERE `id`='%d' LIMIT 1", query, pName
Clearly should be the ID and not the name, also you forgot to use GetPlayerName:

Код:
forward SaveAccount(playerid);
public SaveAccount(playerid)
{
	new 
		query[500], 
		pName[33]
	;

	GetPlayerPos(playerid, PlayerInfo[playerid][posx], PlayerInfo[playerid][posy], PlayerInfo[playerid][posz]);
	GetPlayerName(playerid, pName, MAX_PLAYER_NAME);

	format(query, sizeof(query), "UPDATE `user` SET `posX`='%f', `posY`='%f', `posZ`='%f', `angle`='%f', `interiorid`='%f'",
	PlayerInfo[playerid][posx],
	PlayerInfo[playerid][posy],
	PlayerInfo[playerid][posz],
	PlayerInfo[playerid][angle],
	PlayerInfo[playerid][interiorid]);

	format(query, sizeof query, "%s, `adminlvl`='%d', `pass2`='%s', `dinero`='%d', `dinerobank`='%d', `banco`='%d', `movil`='%d', `dni`='%d'",
	query,
	PlayerInfo[playerid][adminlvl],
	PlayerInfo[playerid][pass2],
	PlayerInfo[playerid][dinero],
	PlayerInfo[playerid][dinerobank],
	PlayerInfo[playerid][banco],
	PlayerInfo[playerid][movil],
	PlayerInfo[playerid][dni]);

	format(query, sizeof query, "%s, `busquedad`='%d', `sexo`='%d', `edad`='%d',`skin`='%d',`origen`='%d',`faccion`='% s', `carcel`='%d', `vida`='%d'",
	query,
	PlayerInfo[playerid][Busqueda],
	PlayerInfo[playerid][sexo],
	PlayerInfo[playerid][edad],
	PlayerInfo[playerid][skin],
	PlayerInfo[playerid][origen],
	PlayerInfo[playerid][faccion],
	PlayerInfo[playerid][carcel],
	PlayerInfo[playerid][vida]);

	format(query, sizeof query, "%s WHERE `id`='%s' LIMIT 1", query, pName);

	mysql_function_query(Conecction, query, true, "OnQueryFinish", "ii", 0, playerid);
	return 1;
}
Also update the plugin.
Reply


Messages In This Thread
help mysql r7 - by capottematias - 28.05.2015, 20:15
Re: help mysql r7 - by Evocator - 28.05.2015, 20:19
Respuesta: help mysql r7 - by capottematias - 28.05.2015, 21:15
Respuesta: help mysql r7 - by capottematias - 28.05.2015, 21:18

Forum Jump:


Users browsing this thread: 1 Guest(s)