Advertisement
Guest User

Untitled

a guest
May 30th, 2021
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. public LoadCars()
  2. {
  3. new count_cars = 0;
  4.  
  5. new Cache: rCars = mysql_query(SQL, "SELECT * FROM `cars`" );
  6. masinii = cache_num_rows();
  7. if( !cache_num_rows() ) return cache_delete( rCars ), print( "MySQL: No cars in database." );
  8. for( new i = 0; i < masinii; i++ )
  9. {
  10. cache_get_value_name_int( i, "ID", CarInfo[i][cID]);
  11. cache_get_value_name_int( i, "Model", CarInfo[i][cModel]);
  12. cache_get_value_name_float(i, "LocaltionX", CarInfo[i][cLocationX]);
  13. cache_get_value_name_float(i, "LocaltionY", CarInfo[i][cLocationY]);
  14. cache_get_value_name_float(i, "LocaltionZ", CarInfo[i][cLocationZ]);
  15. cache_get_value_name_float(i, "LocaltionA", CarInfo[i][cLocationA]);
  16. cache_get_value_name_int( i, "ColorOne", CarInfo[i][cColorOne]);
  17. cache_get_value_name_int( i, "ColorTwo", CarInfo[i][cColorTwo]);
  18. cache_get_value( i, "Owner", CarInfo[i][cOwner], MAX_PLAYER_NAME);
  19. cache_get_value_name_int( i, "Lockk", CarInfo[i][cLockk]);
  20. cache_get_value( i, "License", CarInfo[i][cLicense]);
  21. cache_get_value_name_int( i, "UserID", CarInfo[i][cUserID]);
  22. cache_get_value_name_int( i, "Spawned", CarInfo[i][cSpawned]);
  23. cache_get_value_name_int( i, "Value", CarInfo[i][cValue]);
  24.  
  25. count_cars++;
  26. }
  27. printf( "MySQL: (%d) masini incarcate!", count_cars);
  28. cache_delete( rCars );
  29. return 1;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement