Guest User

Untitled

a guest
Oct 19th, 2017
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1.  
  2. enum Vehicle_informations
  3. {
  4.  
  5. v_ID,
  6. v_Model,
  7.  
  8. v_Color1,
  9. v_Color2,
  10.  
  11. Float:v_PosX,
  12. Float:v_PosY,
  13. Float:v_PosZ,
  14. Float:v_PosA,
  15.  
  16.  
  17. };
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29. CMD:veh(playerid, params[])
  30. {
  31.  
  32. new
  33. query[800],
  34. Float:x,
  35. Float:y,
  36. Float:z,
  37. Float:a;
  38.  
  39. GetPlayerFacingAngle(playerid, a);
  40. GetPlayerPos(playerid, x, y, z);
  41.  
  42. new vehicleid = CreateVehicle(560, x+2.0, y+2.0, z+3.0, a+90, -1, -1, 0);
  43.  
  44. LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
  45. SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
  46.  
  47. SetVehicleToRespawn(vehicleid);
  48.  
  49. Vehicle_infos[vehicleid][v_Model] = 560;
  50.  
  51. Vehicle_infos[vehicleid][v_Color1] = -1;
  52. Vehicle_infos[vehicleid][v_Color2] = -1;
  53.  
  54. Vehicle_infos[vehicleid][v_PosX] = Float:x;
  55. Vehicle_infos[vehicleid][v_PosY] = Float:y;
  56. Vehicle_infos[vehicleid][v_PosZ] = Float:z;
  57. Vehicle_infos[vehicleid][v_PosA] = Float:a;
  58.  
  59. // Insert DB
  60. mysql_format(dbhandle, query, sizeof(query), "INSERT INTO `server_vehicles` SET Model='%d',Color1='%d',Color2='%d',PosX='%d',PosY='%d',PosZ='%d',PosA='%d'",
  61. Vehicle_infos[vehicleid][v_Model], Vehicle_infos[vehicleid][v_Color1], Vehicle_infos[vehicleid][v_Color2], Vehicle_infos[vehicleid][v_PosX], Vehicle_infos[vehicleid][v_PosY], Vehicle_infos[vehicleid][v_PosZ], Vehicle_infos[vehicleid][v_PosA]);
  62. mysql_tquery(dbhandle, query, "SendQuery", "");
  63.  
  64. return 1;
  65. }
Advertisement
Add Comment
Please, Sign In to add comment