PDA

View Full Version : Bug with saving


Unkovic
23/06/2018, 08:54 PM
case DIALOG_IZMENIVOZILO:
{
if(response)
{
if(listitem == 0)
{
new vid = GetPlayerVehicleID(playerid);
new Float:vpos[4];
new q[125];

if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
GetVehiclePos(vid, vpos[0], vpos[1], vpos[2]);
vInfo[vid][vehX] = vpos[0];
vInfo[vid][vehY] = vpos[1];
vInfo[vid][vehZ] = vpos[2];
GetVehicleZAngle(vid, vpos[3]);
SetVehiclePos(vid, vpos[0], vpos[1], vpos[2]);
SetVehicleZAngle(vid, vpos[3]);

mysql_format(g_SQL, q, sizeof(q), "UPDATE `vehicles` SET `vehX` = %f, `vehY` = %f, `vehZ` = %f, `vehA` = %f WHERE `vehID` = %d", vInfo[vid][vehX], vInfo[vid][vehY], vInfo[vid][vehZ], vInfo[vid][vehA], vInfo[vid][vehID]);
mysql_tquery(g_SQL, q);

}
else SEM(playerid, "Niste u vozilu. Na mestu vozaca.");
}

but when it need to respawn, it will respawn on old spawn, old positions and mysql dont update it. Btw, system is working with iterators, so, i think im wrong there