-
Hali
MySQL-es autórendszert editelek, kibővítettem ezekkel:vhealth, vpanels, vdoors, vlights, vtires. De egyiket sem menti, mi lehet a baj?
Car_Save(carid)
{
static
query[900];
if (CarData[carid][carVehicle] != INVALID_VEHICLE_ID)
{
for (new i = 0; i < 14; i ++) {
CarData[carid][carMods] = GetVehicleComponentInSlot(CarData[carid][carVehicle], i);
}
}
new vpanels, vdoors, vlights, vtires;
new Float:vhealth;
GetVehicleDamageStatus(CarData[carid][carVehicle], vpanels, vdoors, vlights, vtires);
GetVehicleHealth(CarData[carid][carVehicle], vhealth);
format(query, sizeof(query), \"UPDATE `cars` SET `carModel` = \'%d\', `carOwner` = \'%d\', `carPosX` = \'%.4f\', `carPosY` = \'%.4f\', `carPosZ` = \'%.4f\', `carPosR` = \'%.4f\', `carColor1` = \'%d\', `carColor2` = \'%d\', `carPaintjob` = \'%d\', `carLocked` = \'%d\'\",
CarData[carid][carModel],
CarData[carid][carOwner],
CarData[carid][carPos][0],
CarData[carid][carPos][1],
CarData[carid][carPos][2],
CarData[carid][carPos][3],
CarData[carid][carColor1],
CarData[carid][carColor2],
CarData[carid][carPaintjob],
CarData[carid][carLocked]
);
format(query, sizeof(query), \"%s, `carMod1` = \'%d\', `carMod2` = \'%d\', `carMod3` = \'%d\', `carMod4` = \'%d\', `carMod5` = \'%d\', `carMod6` = \'%d\', `carMod7` = \'%d\', `carMod8` = \'%d\', `carMod9` = \'%d\', `carMod10` = \'%d\', `carMod11` = \'%d\', `carMod12` = \'%d\', `carMod13` = \'%d\', `carMod14` = \'%d\'\",
query,
CarData[carid][carMods][0],
CarData[carid][carMods][1],
CarData[carid][carMods][2],
CarData[carid][carMods][3],
CarData[carid][carMods][4],
CarData[carid][carMods][5],
CarData[carid][carMods][6],
CarData[carid][carMods][7],
CarData[carid][carMods][8],
CarData[carid][carMods][9],
CarData[carid][carMods][10],
CarData[carid][carMods][11],
CarData[carid][carMods][12],
CarData[carid][carMods][13]
);
format(query, sizeof(query), \"%s, `carImpounded` = \'%d\', `carImpoundPrice` = \'%d\', `carFaction` = \'%d\', `carWeapon1` = \'%d\', `carWeapon2` = \'%d\', `carWeapon3` = \'%d\', `carWeapon4` = \'%d\', `carWeapon5` = \'%d\', `carAmmo1` = \'%d\', `carAmmo2` = \'%d\', `carAmmo3` = \'%d\', `carAmmo4` = \'%d\', `carAmmo5` = \'%d\', `CarHP` = \'%f\', `CarPanels` = \'%d\', `CarDoors` = \'%d\', `CarLights` = \'%d\', `CarTires` = \'%d\' WHERE `carID` = \'%d\'\",query,
query,
CarData[carid][carImpounded],
CarData[carid][carImpoundPrice],
CarData[carid][carFaction],
CarData[carid][carWeapons][0],
CarData[carid][carWeapons][1],
CarData[carid][carWeapons][2],
CarData[carid][carWeapons][3],
CarData[carid][carWeapons][4],
CarData[carid][carAmmo][0],
CarData[carid][carAmmo][1],
CarData[carid][carAmmo][2],
CarData[carid][carAmmo][3],
CarData[carid][carAmmo][4],
vhealth,
vpanels,
vdoors,
vlights,
vtires,
CarData[carid][carID]
);
return mysql_tquery(g_iHandle, query);
}
-
Szia!
Egy mysql_log -ot tudnál küldeni?
-
[14:16:38] [WARNING] CMySQLResult::GetRowDataByName - field not found (\"carVehicle\")
-
Csinálj egy \"carVehicle\" mezőt a cars táblában.
-
[12:15:11] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'`carHP` = \'1000.000000\' `carPanels` = \'0\' `carDoors` = \'0\' `carLights` = \'0\' `ca\' at line 1
Dupla hozzászólás automatikusan összefûzve. ( 2016. augusztus 07. - 12:30:05 )
és így semmit sem ment :(
Car_Save(carid)
{
static
query[900];
new vpanels, vdoors, vlights, vtires, Float:vhealth;
GetVehicleDamageStatus(CarData[carid][carVehicle], vpanels, vdoors, vlights, vtires);
GetVehicleHealth(CarData[carid][carVehicle], vhealth);
if (CarData[carid][carVehicle] != INVALID_VEHICLE_ID)
{
for (new i = 0; i < 14; i ++) {
CarData[carid][carMods] = GetVehicleComponentInSlot(CarData[carid][carVehicle], i);
}
}
format(query, sizeof(query), \"UPDATE `cars` SET `carModel` = \'%d\', `carOwner` = \'%d\', `carPosX` = \'%.4f\', `carPosY` = \'%.4f\', `carPosZ` = \'%.4f\', `carPosR` = \'%.4f\', `carColor1` = \'%d\', `carColor2` = \'%d\', `carPaintjob` = \'%d\', `carLocked` = \'%d\'\",
CarData[carid][carModel],
CarData[carid][carOwner],
CarData[carid][carPos][0],
CarData[carid][carPos][1],
CarData[carid][carPos][2],
CarData[carid][carPos][3],
CarData[carid][carColor1],
CarData[carid][carColor2],
CarData[carid][carPaintjob],
CarData[carid][carLocked]
);
format(query, sizeof(query), \"%s, `carMod1` = \'%d\', `carMod2` = \'%d\', `carMod3` = \'%d\', `carMod4` = \'%d\', `carMod5` = \'%d\', `carMod6` = \'%d\', `carMod7` = \'%d\', `carMod8` = \'%d\', `carMod9` = \'%d\', `carMod10` = \'%d\', `carMod11` = \'%d\', `carMod12` = \'%d\', `carMod13` = \'%d\', `carMod14` = \'%d\'\",
query,
CarData[carid][carMods][0],
CarData[carid][carMods][1],
CarData[carid][carMods][2],
CarData[carid][carMods][3],
CarData[carid][carMods][4],
CarData[carid][carMods][5],
CarData[carid][carMods][6],
CarData[carid][carMods][7],
CarData[carid][carMods][8],
CarData[carid][carMods][9],
CarData[carid][carMods][10],
CarData[carid][carMods][11],
CarData[carid][carMods][12],
CarData[carid][carMods][13]
);
format(query, sizeof(query), \"%s, `carImpounded` = \'%d\', `carImpoundPrice` = \'%d\', `carFaction` = \'%d\', `carWeapon1` = \'%d\', `carWeapon2` = \'%d\', `carWeapon3` = \'%d\', `carWeapon4` = \'%d\', `carWeapon5` = \'%d\', `carAmmo1` = \'%d\', `carAmmo2` = \'%d\', `carAmmo3` = \'%d\', `carAmmo4` = \'%d\', `carAmmo5` = \'%d\' `carHP` = \'%f\' `carPanels` = \'%d\' `carDoors` = \'%d\' `carLights` = \'%d\' `caTires` = \'%d\' `caVehicle` = \'%d\' WHERE `carID` = \'%d\'\",
query,
CarData[carid][carImpounded],
CarData[carid][carImpoundPrice],
CarData[carid][carFaction],
CarData[carid][carWeapons][0],
CarData[carid][carWeapons][1],
CarData[carid][carWeapons][2],
CarData[carid][carWeapons][3],
CarData[carid][carWeapons][4],
CarData[carid][carAmmo][0],
CarData[carid][carAmmo][1],
CarData[carid][carAmmo][2],
CarData[carid][carAmmo][3],
CarData[carid][carAmmo][4],
vhealth,
vpanels,
vdoors,
vlights,
vtires,
CarData[carid][carVehicle],
CarData[carid][carID]
);
return mysql_tquery(g_iHandle, query);
}
-
Szia!
`carHP` = \'%f\' `carPanels` = \'%d\' `carDoors` = \'%d\' `carLights` = \'%d\' `caTires` = \'%d\' `caVehicle` = \'%d\' WHERE `carID` = \'%d\'\"
helyett:
`carHP` = \'%f\' ,`carPanels` = \'%d\', `carDoors` = \'%d\' ,`carLights` = \'%d\', `caTires` = \'%d\', `caVehicle` = \'%d\' WHERE `carID` = \'%d\'\"
Lehagytál pár vesszőt! :D
-
Igen, előbb ki is javítottam :D
Most nincs error, de a carHP carTires carDoors carLights carPanels nem kerül mentésre, minden azon az értéken marad ami a kocsi létrehozásánál meg lett adva
Mikor kéne mentenem?
Dupla hozzászólás automatikusan összefûzve. ( 2016. augusztus 07. - 14:20:19 )
Végre sikerült :thumbsup: :thumbsup: :thumbsup: