Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.79 KB | None | 0 0
  1. function LoadClanVehicles() {
  2. new Cache: db = mysql_query (SQL, "SELECT * FROM `clanvehicles` ORDER BY `clanvehicles`.`vID` ASC");
  3. new x, servervehs = 0, result[256];
  4. for (new i, j = cache_get_row_count (); i != j; ++i) {
  5. servervehs ++;
  6. cache_get_field_content(i, "vID", result); x = strval(result);
  7. ServerVehicles[x][vID] = x;
  8. cache_get_field_content(i, "vModel", result); ServerVehicles[x][vModel] = strval(result);
  9. cache_get_field_content(i, "LocationX", result); ServerVehicles[x][vLocation][0] = floatstr(result);
  10. cache_get_field_content(i, "LocationY", result); ServerVehicles[x][vLocation][1] = floatstr(result);
  11. cache_get_field_content(i, "LocationZ", result); ServerVehicles[x][vLocation][2] = floatstr(result);
  12. cache_get_field_content(i, "Angle", result); ServerVehicles[x][vAngle] = floatstr(result);
  13. cache_get_field_content(i, "Color1", result); ServerVehicles[x][vColor][0] = strval(result);
  14. cache_get_field_content(i, "Color2", result); ServerVehicles[x][vColor][1] = strval(result);
  15. cache_get_field_content(i, "Rank", result); ServerVehicles[x][vRank] = strval(result);
  16. cache_get_field_content(i, "Clan", result); ServerVehicles[x][vClan] = strval(result);
  17.  
  18. if(ServerVehicles[x][vModel] >= 400 && ServerVehicles[x][vModel] <= 611) {
  19. ServerVehicles[x][vSpawned] = CreateVehicleEx(ServerVehicles[x][vModel], ServerVehicles[x][vLocation][0], ServerVehicles[x][vLocation][1], ServerVehicles[x][vLocation][2], ServerVehicles[x][vAngle], ServerVehicles[x][vColor][0], ServerVehicles[x][vColor][1], -1);
  20. new idd = ServerVehicles[x][vSpawned];
  21. SetVehicleVirtualWorld(idd, ServerVehicles[idd][vVirtual]);
  22. if(ServerVehicles[idd][vFaction] != 0) {
  23. if(ServerVehicles[idd][vModel] == 411) {
  24. new policecar = CreateObject(19327, 1534.2373, -1643.2886, 5.9373, -87.6999, 90.4001, -87.1805);
  25. SetObjectMaterialText(policecar, "POLICE", 0, 50, "Arial", 25, 1, -16777216, 0, 1);
  26. new lspdcar = CreateObject(19419,0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000);
  27. AttachObjectToVehicle(policecar, idd, 0.0, -1.9, 0.3, 270.0, 0.0, 0.0);
  28. AttachObjectToVehicle(lspdcar, idd, 0.0646, 0.1661, 0.6957, 0.0000, 0.0000, 0.0000);
  29. }
  30. if(ServerVehicles[idd][vModel] == 560) {
  31. if(ServerVehicles[idd][vFaction] == 12 || ServerVehicles[idd][vFaction] == 1) {
  32. new taiddiobj = CreateObject(19308, 0.00000, 0.00000, 0.00000,0.00000, 0.00000, 0.00000);
  33. AttachObjectToVehicle(taiddiobj, idd, -0.00930, -0.23880, 0.92300,0.00000, 0.00000, 0.00000);
  34. }
  35. }
  36. if(ServerVehicles[idd][vModel] == 541) {
  37. if(ServerVehicles[idd][vFaction] == 2) {
  38. new object1 = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
  39. new object2 = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
  40. AttachObjectToVehicle(object1, idd, 0.375000,0.524999,0.375000,0.000000,0.000000,0.000000);
  41. AttachObjectToVehicle(object2, idd, 0.375000,0.524999,0.375000,0.000000,0.000000,0.000000);
  42. }
  43. }
  44. if(ServerVehicles[idd][vModel] == 525) {
  45. new object1 = CreateObject(19294, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
  46. new object2 = CreateObject(19294, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
  47. AttachObjectToVehicle(object1, idd, -0.600000,-0.485000,1.450000,0.000000,0.000000,0.000000);
  48. AttachObjectToVehicle(object2, idd, 0.600000,-0.485000,1.450000,0.000000,0.000000,0.000000);
  49. }
  50. }
  51.  
  52. new str[64];
  53. if(ServerVehicles[idd][vFaction] != 0) format(str, 64, "F%d %d", ServerVehicles[idd][vFaction], idd);
  54. else format(str, sizeof(str), "RO-0%d", ServerVehicles[x][vSpawned]);
  55. SetVehicleNumberPlate(idd, str);
  56. if(ServerVehicles[x][vClan] != 0) attach_vip_text_2(x);
  57. }
  58. }
  59. printf("Server vehicles: %d", servervehs);
  60. cache_delete(db);
  61. return 1;
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement