SHARE
TWEET

Untitled

a guest Jun 19th, 2017 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. funksioon LoadCar()
  2. {
  3.     new
  4.         result[128],
  5.         idx,
  6.         sql[256],
  7.         kokkuautosi = KokkuAutosi();
  8.     for(new i = 1; i <= kokkuautosi; i++)
  9.     {
  10.         format(sql, sizeof(sql), "SELECT * FROM autod WHERE CarId = '%d'", i);
  11.         mysql_query(sql);
  12.         mysql_store_result();
  13.         if(mysql_fetch_row_format(sql,"|"))
  14.         {
  15.             mysql_fetch_field_row(result,"Owned"); CarInfo[i][cOwned] = strval(result);
  16.             mysql_fetch_field_row(result,"Owner"); CarInfo[i][cOwner] = strval(result);
  17.             mysql_fetch_field_row(result,"Description"); strmid(CarInfo[i][cDescription], result, 0, strlen(result), 255);//
  18.             mysql_fetch_field_row(result,"Model"); CarInfo[i][cModel] = strval(result);
  19.             mysql_fetch_field_row(result,"Value"); CarInfo[i][cValue] = strval(result);
  20.             mysql_fetch_field_row(result,"Lock"); CarInfo[i][cLock] = strval(result);
  21.             mysql_fetch_field_row(result,"ColorOne"); CarInfo[i][cColorOne] = strval(result);
  22.             mysql_fetch_field_row(result,"ColorTwo"); CarInfo[i][cColorTwo] = strval(result);
  23.             mysql_fetch_field_row(result,"Locationx"); CarInfo[i][cLocationx] = floatstr(result);
  24.             mysql_fetch_field_row(result,"Locationy"); CarInfo[i][cLocationy] = floatstr(result);
  25.             mysql_fetch_field_row(result,"Locationz"); CarInfo[i][cLocationz] = floatstr(result);
  26.             mysql_fetch_field_row(result,"Angle"); CarInfo[i][cAngle] = floatstr(result);
  27.             mysql_fetch_field_row(result,"Parked"); CarInfo[i][cParked] = strval(result);
  28.             mysql_fetch_field_row(result,"ParkLocationx"); CarInfo[i][cParkLocationx] = floatstr(result);
  29.             mysql_fetch_field_row(result,"ParkLocationy"); CarInfo[i][cParkLocationy] = floatstr(result);
  30.             mysql_fetch_field_row(result,"ParkLocationz"); CarInfo[i][cParkLocationz] = floatstr(result);
  31.             mysql_fetch_field_row(result,"ParkAngle"); CarInfo[i][cParkAngle] = floatstr(result);
  32.             idx++;
  33.         }
  34.     }
  35.     printf("LoadCar(): %d laetud",idx);
  36. }
RAW Paste Data
Top