02.03.2014, 00:12
I have this code.
The problem is, that that won`t give the right parameter, mysql_insert_id should be "8", but its always 0.
How could i fix it?
Код:
new query[350]; format(query, sizeof(query), "INSERT INTO `scriptcars` (`CarType`, `UserGroupID`, `Model`, `Color1`, `Color2`, `PosX`, `PosY`, `PosZ`, `Angle`,`ParkX`, `ParkY`, `ParkZ`, `ParkAngle`, `Fuel`, `Health`) VALUES ('2', '%d', '%i', '%i', '%i', '%f', '%f', '%f', '%f', '%f', '%f', '%f', '%f', '100', '100')", grupp, mode, colo1, colo2, Pos[0], Pos[1], Pos[2], Pos[3], Pos[0], Pos[1], Pos[2], Pos[3]); mysql_function_query(gSQL, query, true, "LoadingSCar", "i", mysql_insert_id());
Код:
publicEx LoadingSCar(carSql) { // PROBLEM ---> carSql = 0 <<<----- Always new rows, fields; cache_get_data(rows, fields, gSQL); new temp[40]; cache_get_field_content(carSql, "ID", temp), ScriptCarInfo[carSql][ID] = strval(temp), cache_get_field_content(carSql, "CarType", temp), ScriptCarInfo[carSql][CarType] = strval(temp), cache_get_field_content(carSql, "UserGroupID", temp), ScriptCarInfo[carSql][UserGroupID] = strval(temp), cache_get_field_content(carSql, "Model", temp), ScriptCarInfo[carSql][Model] = strval(temp), cache_get_field_content(carSql, "Color1", temp), ScriptCarInfo[carSql][Color1] = strval(temp), cache_get_field_content(carSql, "Color2", temp), ScriptCarInfo[carSql][Color2] = strval(temp), cache_get_field_content(carSql, "PosX", temp), ScriptCarInfo[carSql][PosX] = floatstr(temp), cache_get_field_content(carSql, "PosY", temp), ScriptCarInfo[carSql][PosY] = floatstr(temp), cache_get_field_content(carSql, "PosZ", temp), ScriptCarInfo[carSql][PosZ] = floatstr(temp), cache_get_field_content(carSql, "Angle", temp), ScriptCarInfo[carSql][Angle] = floatstr(temp), cache_get_field_content(carSql, "ParkX", temp), ScriptCarInfo[carSql][ParkX] = floatstr(temp), cache_get_field_content(carSql, "ParkY", temp), ScriptCarInfo[carSql][ParkY] = floatstr(temp), cache_get_field_content(carSql, "ParkZ", temp), ScriptCarInfo[carSql][ParkZ] = floatstr(temp), cache_get_field_content(carSql, "ParkAngle", temp), ScriptCarInfo[carSql][ParkAngle] = floatstr(temp), cache_get_field_content(carSql, "Health", temp), ScriptCarInfo[carSql][Health] = floatstr(temp); }