Witam,
mam pewien problem.
Tworz? system pojazd?w w oparciu o baz? danych SQLite, ale napotka?em powa?ny problem.
PVary nie chc? przyj?? danych otrzymanych z bazy.
Gdy u?yj? tablicy
[code]new test;[/code]
I do niej przypisz? dane - wszystko jest okej, ale zale?y mi na PVarach.
KOD:
[code]forward LoadVeh(uid);
public LoadVeh(uid)
{
new VUID;
new query[256];
new field[50];
new DBResult:result;
format(query,sizeof(query),"SELECT * FROM `vehicles` WHERE `uid` = '%d'",uid);
result = db_query(rpDB,query);
db_get_field_assoc(result,"uid",field,50);
VUID = strval(field);
db_get_field_assoc(result,"color1",field,50);
SetPVarInt(VUID,"vcol1",strval(field));
db_get_field_assoc(result,"color2",field,50);
SetPVarInt(VUID,"vcol2",strval(field));
db_get_field_assoc(result,"id",field,50);
SetPVarInt(VUID,"vid",strval(field));
db_get_field_assoc(result,"fuel",field,50);
SetPVarInt(VUID,"vfuel",strval(field));
db_get_field_assoc(result,"vhealth",field,50);
SetPVarFloat(VUID,"vhealth",floatstr(field));
db_get_field_assoc(result,"vownertype",field,50);
SetPVarInt(VUID,"vtype",strval(field));
db_get_field_assoc(result,"vowner",field,50);
SetPVarInt(VUID,"vowner",strval(field));
db_get_field_assoc(result,"vposa",field,50)... |