19.06.2011, 00:58
pawn Код:
LoadVehicle()
{
new query[2048];
Result = db_query(USERDB,"SELECT * FROM `Vehicles`");
for(new a;a<db_num_rows(Result);a++)
{
db_get_field_assoc(Result,"Model",query,sizeof(query));
V_Data[a][Model]=strval(query);
db_get_field_assoc(Result,"Plate",query,sizeof(query));
V_Data[a][Plate]=strval(query);
db_get_field_assoc(Result,"PosX",query,sizeof(query));
V_Data[a][vPosX]=strval(query);
db_get_field_assoc(Result,"PosY",query,sizeof(query));
V_Data[a][vPosY]=strval(query);
db_get_field_assoc(Result,"PosZ",query,sizeof(query));
V_Data[a][vPosZ]=strval(query);
db_get_field_assoc(Result,"Rot",query,sizeof(query));
V_Data[a][vRot]=strval(query);
V_Data[a][ID] = AddStaticVehicleEx(V_Data[a][Model],V_Data[a][vPosX],V_Data[a][vPosY],V_Data[a][vPosZ],V_Data[a][vRot],1,1,-1);
SetVehicleNumberPlate(V_Data[a][ID],V_Data[a][Plate]);
db_next_row(Result);
}
return 1;
}
The only one that loaded correctly just "V_Data[a][Model]". "V_Data[a][vPosX]" return "1283.000000" instead "1283.733276" (Same as "V_Data[a][vPosY]" "V_Data[a][vPosZ]" "V_Data[a][vRot]"). It won't load numbers after dot(.)
Also it won't load the plate.