The data don't is updated [MySQL R39-2] - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: The data don't is updated [MySQL R39-2] (
/showthread.php?tid=540156)
The data don't is updated [MySQL R39-2] -
aoEXE - 03.10.2014
I need help. Upon check if I inserted data in the table (name, password, ip, status) correctly. Status is updated (when I register or login is updated to 1 and when I disconnect to 0) and I work perfectly. But also I have that when I disconnect is updated the data (admin, position, skin etc etc) are several data but the thing is that I do not update, it is as if there is no such function. Within the server, I changed the "Admin" variable to '10' and when I disconnect should be '10 'in the database but it's not, is the same as when I register, nothing is updated. (is loaded fine the password when I login, I mean that is all right the load data system)
I tried to handle some data with true and false I saw in a forum post and I thought that was why he did not update the data but returned the system to normal. (so use the variables as 0 = false and 1 = true) and everything was the same, did not update the data. I thought the size of the Query was short (Although I think would returns errors, I don't know) and I increased much and everything was the same.
Here I show how is update the data:
pawn Код:
stock GuardarDatos(playerid)
{
new Query[1000];
GetPlayerHealth(playerid,PlayerInfo[playerid][Vida]);
GetPlayerArmour(playerid,PlayerInfo[playerid][Chaleco]);
GetPlayerPos(playerid,PlayerInfo[playerid][PosX],PlayerInfo[playerid][PosY],PlayerInfo[playerid][PosZ]);
mysql_format(MiSQL,Query,sizeof(Query),"UPDATE `usuarios` SET `IP` = '%s', `AdminNivel` = '%d', `Dinero` = '%d', `Asesinatos` = '%d', `Muertes` = '%d', `Skin` = '%d', `Advertencias` = '%d', `Muteado` = '%d', `Vida` = '%f', `Chaleco` = '%f', `PosX` = '%f', `PosY` = '%f', `PosZ` = '%f', `VecesExpulsado` = '%d' WHERE `Nombre` = '%s'",
PlayerInfo[playerid][Ip],
PlayerInfo[playerid][AdminNivel],
PlayerInfo[playerid][Dinero],
PlayerInfo[playerid][Asesinatos],
PlayerInfo[playerid][Muertes],
PlayerInfo[playerid][Skin],
PlayerInfo[playerid][Advertencias],
PlayerInfo[playerid][Muteado],
PlayerInfo[playerid][Vida],
PlayerInfo[playerid][Chaleco],
PlayerInfo[playerid][PosX],
PlayerInfo[playerid][PosY],
PlayerInfo[playerid][PosZ],
PlayerInfo[playerid][VecesExpulsado],
GetName(playerid));
mysql_tquery(MiSQL,Query);
return 1;
}
sorry for my bad English I'm learning
Respuesta: The data don't is updated [MySQL R39-2] -
aoEXE - 05.10.2014
solved