Load vehicle sqlite problem
#1

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.
Reply


Messages In This Thread
Load vehicle sqlite problem - by =WoR=Varth - 19.06.2011, 00:58
Re: Load vehicle sqlite problem - by Lorenc_ - 19.06.2011, 01:55
Re: Load vehicle sqlite problem - by =WoR=Varth - 19.06.2011, 02:23
Re: Load vehicle sqlite problem - by Benjo - 19.06.2011, 02:31
Re: Load vehicle sqlite problem - by =WoR=Varth - 22.06.2011, 22:19

Forum Jump:


Users browsing this thread: 4 Guest(s)