Mysql_function_query problem.
#7

I got this that way :P
Код:
    #define AddingCar
    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)
{
    #if defined AddingCar
	carSql = mysql_insert_id();
	#endif
    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);
 	#if defined AddingCar
	    #undef AddingCar
	#endif
}
Thank you
Reply


Messages In This Thread
Mysql_function_query problem. - by Larry123 - 02.03.2014, 00:12
Re: Mysql_function_query problem. - by Richie© - 02.03.2014, 00:16
Re: Mysql_function_query problem. - by Larry123 - 02.03.2014, 00:30
Re: Mysql_function_query problem. - by Richie© - 02.03.2014, 00:34
Re: Mysql_function_query problem. - by Larry123 - 02.03.2014, 00:37
Re: Mysql_function_query problem. - by Richie© - 02.03.2014, 00:41
Re: Mysql_function_query problem. - by Larry123 - 02.03.2014, 00:45

Forum Jump:


Users browsing this thread: 1 Guest(s)