Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- funksioon LoadCar()
- {
- new
- result[128],
- idx,
- sql[256],
- kokkuautosi = KokkuAutosi();
- for(new i = 1; i <= kokkuautosi; i++)
- {
- format(sql, sizeof(sql), "SELECT * FROM autod WHERE CarId = '%d'", i);
- mysql_query(sql);
- mysql_store_result();
- if(mysql_fetch_row_format(sql,"|"))
- {
- mysql_fetch_field_row(result,"Owned"); CarInfo[i][cOwned] = strval(result);
- mysql_fetch_field_row(result,"Owner"); CarInfo[i][cOwner] = strval(result);
- mysql_fetch_field_row(result,"Description"); strmid(CarInfo[i][cDescription], result, 0, strlen(result), 255);//
- mysql_fetch_field_row(result,"Model"); CarInfo[i][cModel] = strval(result);
- mysql_fetch_field_row(result,"Value"); CarInfo[i][cValue] = strval(result);
- mysql_fetch_field_row(result,"Lock"); CarInfo[i][cLock] = strval(result);
- mysql_fetch_field_row(result,"ColorOne"); CarInfo[i][cColorOne] = strval(result);
- mysql_fetch_field_row(result,"ColorTwo"); CarInfo[i][cColorTwo] = strval(result);
- mysql_fetch_field_row(result,"Locationx"); CarInfo[i][cLocationx] = floatstr(result);
- mysql_fetch_field_row(result,"Locationy"); CarInfo[i][cLocationy] = floatstr(result);
- mysql_fetch_field_row(result,"Locationz"); CarInfo[i][cLocationz] = floatstr(result);
- mysql_fetch_field_row(result,"Angle"); CarInfo[i][cAngle] = floatstr(result);
- mysql_fetch_field_row(result,"Parked"); CarInfo[i][cParked] = strval(result);
- mysql_fetch_field_row(result,"ParkLocationx"); CarInfo[i][cParkLocationx] = floatstr(result);
- mysql_fetch_field_row(result,"ParkLocationy"); CarInfo[i][cParkLocationy] = floatstr(result);
- mysql_fetch_field_row(result,"ParkLocationz"); CarInfo[i][cParkLocationz] = floatstr(result);
- mysql_fetch_field_row(result,"ParkAngle"); CarInfo[i][cParkAngle] = floatstr(result);
- idx++;
- }
- }
- printf("LoadCar(): %d laetud",idx);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement