Guest User

Erori

a guest
Jul 7th, 2016
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.95 KB | None | 0 0
  1. -------------------------WhenCheckVehicle
  2. public WhenVehCheck1(eent)
  3. {
  4. new query[254];
  5. cache_get_data(rows, fields, handle);
  6.  
  7. cache_get_field_content(0, "ID", temp), VehiclesInfo[eent][vID] = strval(temp);
  8. cache_get_field_content(0, "Model", temp), VehiclesInfo[eent][vModel] = strval(temp);
  9. cache_get_field_content(0, "PositionX", temp), VehiclesInfo[eent][vPositionX] = floatstr(temp);
  10. cache_get_field_content(0, "PositionY", temp), VehiclesInfo[eent][vPositionY] = floatstr(temp);
  11. cache_get_field_content(0, "PositionZ", temp), VehiclesInfo[eent][vPositionZ] = floatstr(temp);
  12. cache_get_field_content(0, "Angle", temp), VehiclesInfo[eent][vAngle] = floatstr(temp);
  13. cache_get_field_content(0, "Color1", temp), VehiclesInfo[eent][vColor1] = strval(temp);
  14. cache_get_field_content(0, "Color2", temp), VehiclesInfo[eent][vColor2] = strval(temp);
  15. cache_get_field_content(0, "PaintJob", temp), VehiclesInfo[eent][vPaintJob] = strval(temp);
  16. cache_get_field_content(0, "Owner", temp), VehiclesInfo[eent][vOwner] = strval(temp);
  17. cache_get_field_content(0, "Lock", temp), VehiclesInfo[eent][vLock] = strval(temp);
  18. cache_get_field_content(0, "KM", temp), VehiclesInfo[eent][vKM] = strval(temp);
  19. cache_get_field_content(0, "Days", temp), VehiclesInfo[eent][vDays] = strval(temp);
  20. cache_get_field_content(0, "NumberPlate", temp), VehiclesInfo[eent][vNumberPlate] = sizeof(temp);
  21. cache_get_field_content(0, "Component1", temp), VehiclesInfo[eent][vComponent1] = strval(temp);
  22. cache_get_field_content(0, "Component2", temp), VehiclesInfo[eent][vComponent2] = strval(temp);
  23. cache_get_field_content(0, "Component3", temp), VehiclesInfo[eent][vComponent3] = strval(temp);
  24. cache_get_field_content(0, "Component4", temp), VehiclesInfo[eent][vComponent4] = strval(temp);
  25. cache_get_field_content(0, "Component5", temp), VehiclesInfo[eent][vComponent5] = strval(temp);
  26. cache_get_field_content(0, "Component6", temp), VehiclesInfo[eent][vComponent6] = strval(temp);
  27. cache_get_field_content(0, "Component7", temp), VehiclesInfo[eent][vComponent7] = strval(temp);
  28. cache_get_field_content(0, "Component8", temp), VehiclesInfo[eent][vComponent8] = strval(temp);
  29. cache_get_field_content(0, "Component9", temp), VehiclesInfo[eent][vComponent9] = strval(temp);
  30. cache_get_field_content(0, "Component10", temp), VehiclesInfo[eent][vComponent10] = strval(temp);
  31. cache_get_field_content(0, "Component11", temp), VehiclesInfo[eent][vComponent11] = strval(temp);
  32. cache_get_field_content(0, "Component12", temp), VehiclesInfo[eent][vComponent12] = strval(temp);
  33. cache_get_field_content(0, "Component13", temp), VehiclesInfo[eent][vComponent13] = strval(temp);
  34. cache_get_field_content(0, "Component14", temp), VehiclesInfo[eent][vComponent14] = strval(temp);
  35. cache_get_field_content(0, "Component15", temp), VehiclesInfo[eent][vComponent15] = strval(temp);
  36. cache_get_field_content(0, "Component16", temp), VehiclesInfo[eent][vComponent16] = strval(temp);
  37. cache_get_field_content(0, "Component17", temp), VehiclesInfo[eent][vComponent17] = strval(temp);
  38. cache_get_field_content(0, "ServerID", temp), VehiclesInfo[eent][vServerID] = strval(temp);
  39. cache_get_field_content(0, "Slot", temp), VehiclesInfo[eent][vSlot] = strval(temp);
  40.  
  41. VehiclesInfo[eent][vServerID] = CreateVehicle(VehiclesInfo[eent][vModel],VehiclesInfo[eent][vPositionX],VehiclesInfo[eent][vPositionY],VehiclesInfo[eent][vPositionZ],VehiclesInfo[eent][vAngle],VehiclesInfo[eent][vColor1],VehiclesInfo[eent][vColor2],60000);
  42. mysql_format(handle, query, sizeof(query), "UPDATE `vehicles` SET ServerID = %i WHERE ID = %i LIMIT 1", VehiclesInfo[eent][vServerID], VehiclesInfo[eent][vID]);
  43. mysql_query(handle, query);
  44. Tunen(VehiclesInfo[eent][vServerID]);
  45. printf("!!: %i", VehiclesInfo[eent][vServerID]); // debugging.
  46. return 1;
  47. }
  48.  
  49. ---------------------------------Tunen
  50. public Tunen(vehicleid)
  51. {
  52. new v = vehicleid;
  53. if(VehiclesInfo[v][vComponent1]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent1]); }
  54. if(VehiclesInfo[v][vComponent2]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent2]); }
  55. if(VehiclesInfo[v][vComponent3]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent3]); }
  56. if(VehiclesInfo[v][vComponent4]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent4]); }
  57. if(VehiclesInfo[v][vComponent5]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent5]); }
  58. if(VehiclesInfo[v][vComponent6]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent6]); }
  59. if(VehiclesInfo[v][vComponent7]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent7]); }
  60. if(VehiclesInfo[v][vComponent8]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent8]); }
  61. if(VehiclesInfo[v][vComponent9]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent9]); }
  62. if(VehiclesInfo[v][vComponent10]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent10]); }
  63. if(VehiclesInfo[v][vComponent11]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent11]); }
  64. if(VehiclesInfo[v][vComponent12]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent12]); }
  65. if(VehiclesInfo[v][vComponent13]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent13]); }
  66. if(VehiclesInfo[v][vComponent14]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent14]); }
  67. if(VehiclesInfo[v][vComponent15]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent15]); }
  68. if(VehiclesInfo[v][vComponent16]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent16]); }
  69. if(VehiclesInfo[v][vComponent17]!=0) { AddVehicleComponent(vehicleid,VehiclesInfo[v][vComponent17]); }
  70. if(VehiclesInfo[v][vColor1] != 0 || VehiclesInfo[v][vColor2] != 0)
  71. {
  72. ChangeVehicleColor(vehicleid,VehiclesInfo[v][vColor1],VehiclesInfo[v][vColor2]);
  73. }
  74. if(VehiclesInfo[v][vPaintJob]!=0) { ChangeVehiclePaintjob(vehicleid,VehiclesInfo[v][vPaintJob]); }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment