Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. /*----------------------*/
  2. /* Chargement des véhicules */
  3. Chargement_Vehicules()
  4. {
  5. new rows, stringtext[128], count, Cache:result;
  6.  
  7. result = mysql_query(mysql, "SELECT * FROM "MYSQL_VEHICLES_TABLE"");
  8.  
  9. if(cache_get_row_count(rows))
  10. {
  11. for(new i = 1; i < rows; i++)
  12. {
  13.  
  14. cache_get_value_int(i, "sqlid", vInfo[i][vSQL]);
  15.  
  16. cache_get_value_float(i, "x", vInfo[i][vPosX]);
  17. cache_get_value_float(i, "y", vInfo[i][vPosY]);
  18. cache_get_value_float(i, "z", vInfo[i][vPosZ]);
  19. cache_get_value_float(i, "a", vInfo[i][vPosA]);
  20.  
  21.  
  22. cache_get_value_int(i, "color1", vInfo[i][vColor1]);
  23. cache_get_value_int(i, "color2", vInfo[i][vColor2]);
  24. cache_get_value_int(i, "model", vInfo[i][vModel]);
  25.  
  26. cache_get_value(i, "immatriculation", vInfo[i][vPlaque], 7);
  27.  
  28.  
  29. vInfo[i][vID] = AddStaticVehicle(vInfo[i][vModel], vInfo[i][vPosX], vInfo[i][vPosY], vInfo[i][vPosZ], vInfo[i][vPosA], vInfo[i][vColor1], vInfo[i][vColor2]);
  30.  
  31. new stringplaque[7];
  32. format(stringplaque, sizeof(stringplaque), "%s", vInfo[i][vPlaque]);
  33. SetVehicleNumberPlate(i, stringplaque);
  34. SetVehicleToRespawn(i);
  35.  
  36. ////
  37. new Text3D:vehicle3dtext[MAX_VEHICLES];
  38. vehicle3dtext[vInfo[i][vID]] = Create3DTextLabel("test", -1, 0.0, 0.0, 0.0, 50.0, 0, 1);
  39.  
  40. new string5[256];
  41. format(string5, sizeof string5, "%s", vInfo[i][vPlaque]);
  42. Update3DTextLabelText(vehicle3dtext[vInfo[i][vID]], -1, string5);
  43. Attach3DTextLabelToVehicle(vehicle3dtext[vInfo[i][vID]], vInfo[i][vID], -0.7, -1.9, -0.3);
  44.  
  45.  
  46.  
  47. vInfo[i][vExist] = true;
  48.  
  49. count++;
  50.  
  51. }
  52. printf("[SQL_LOAD] CHARGEMENT DES VEHICULES EFFECTUER! (%i)", count);
  53. }
  54. else
  55. {
  56. print("[SQL_LOAD] /!/ CHARGEMENT DES VEHICULES FAILED!");
  57. }
  58.  
  59. cache_delete(result);
  60. return 1;
  61.  
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement