SHARE
TWEET

dihgoihsaoghdoasgihdhi

a guest Dec 31st, 2012 23 Never
  1. enum carinfo
  2. {
  3.         model,
  4.         Float:car_x,
  5.         Float:car_y,
  6.         Float:car_z,
  7.         Float:car_a,
  8.         color1,
  9.         color2,
  10.         respawntime,
  11.         car_team
  12. }
  13. new CarInfo[MAX_VEHICLES][carinfo];
  14.  
  15. stock LoadVehicles()
  16. {
  17.     new query[500];
  18.     format(query, sizeof(query), "SELECT * FROM vehicles");
  19.     mysql_query(query);
  20.     mysql_store_result();
  21.     if(mysql_num_rows() != 0)
  22.     {
  23.         new id;
  24.         while(mysql_fetch_row_format(query, "|"))
  25.         {
  26.             sscanf(query, "p<|>e<dffffdddd>", CarInfo[vehicleid]);
  27.                 id++;
  28.                 //new model, Float:X, Float:Y, Float:Z, Float:Angle, color1, color2, respawntime, teamid;
  29.                 //sscanf(query, "iffffiiii", model, X, Y, Z, Angle, color1, color2, respawntime, teamid);
  30.                 CreateVehicle(model,X,Y,Z,Angle,color1,color2,respawntime);
  31.         }
  32.         printf("Vehicles loaded: %d",id);
  33.         mysql_free_result();
  34.         }
  35.         return 1;
  36. }
RAW Paste Data
Top