25.07.2016, 10:51
Hello.
My vehicles doesnt reload at all.
What did i do wrong here?
(And yes, the vehicle is already loaded, and the car id is equal to the mysql id.
My vehicles doesnt reload at all.
What did i do wrong here?
PHP Code:
stock ReloadVehicle(i)
{
DestroyVehicle(i);
new query1[128]; mysql_format(connection, query1, sizeof(query1), "SELECT * FROM Vehicles WHERE id = '%i'"); mysql_tquery(connection, query1, "LoadVehicle","d",i);
}
PHP Code:
forward LoadVehicle(id);
public LoadVehicle(id)
{
Vehicle[id][vModel] = cache_get_field_content_int(0, "vModel");
Vehicle[id][vColor1] = cache_get_field_content_int(0, "vColor1");
Vehicle[id][vColor2] = cache_get_field_content_int(0, "vColor2");
Vehicle[id][vX] = cache_get_field_content_float(0, "vX");
Vehicle[id][vY] = cache_get_field_content_float(0, "vY");
Vehicle[id][vZ] = cache_get_field_content_float(0, "vZ");
Vehicle[id][vA] = cache_get_field_content_float(0, "vA");
new owner[25];
cache_get_field_content(0, "vOwner", owner);
myStrcpy(Vehicle[id][vOwner], owner);
new sampid = CreateVehicle(Vehicle[id][vModel], Vehicle[id][vX], Vehicle[id][vY], Vehicle[id][vZ], Vehicle[id][vA], Vehicle[id][vColor1], Vehicle[id][vColor2], -1, 0);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(sampid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(sampid, 0, lights, alarm, doors, bonnet, boot, objective);
return 1;
}