Advertisement
Guest User

Untitled

a guest
Oct 10th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. CreatexVehicle(modelid, ownername[], prices, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2)
  2. {
  3. new id = Iter_Free(xVehicles);
  4.  
  5. xVehicle[id][xv_Veh] = CreateVehicle(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2, -1);
  6.  
  7. xVeh[xVehicle[id][xv_Veh]] = id;
  8. xVehicle[id][xv_ModelID] = modelid;
  9. xVehicle[id][xv_Renk][0] = color1;
  10. xVehicle[id][xv_Renk][1] = color2;
  11. xVehicle[id][xv_Paintjob] = -1;
  12. xVehicle[id][xv_Pos][0] = spawn_x;
  13. xVehicle[id][xv_Pos][1] = spawn_y;
  14. xVehicle[id][xv_Pos][2] = spawn_z;
  15. xVehicle[id][xv_Pos][3] = z_angle;
  16. format(xVehicle[id][xv_Sahip], 24, "%s", ownername);
  17. xVehicle[id][xv_Fiyat] = prices;
  18. plate_check:
  19. format(xVehicle[id][xv_Plaka], 8, "%s", CreatePlate());
  20. foreach(new i : xVehicles) if(!xStrcmp(xVehicle[id][xv_Plaka], xVehicle[i][xv_Plaka])) goto plate_check;
  21. SetVehicleNumberPlate(xVehicle[id][xv_Veh], xVehicle[id][xv_Plaka]);
  22. SetVehicleToRespawn(xVehicle[id][xv_Veh]);
  23. Iter_Add(xVehicles, id);
  24. new query[256];
  25. format(query, sizeof(query),"INSERT INTO `xVehicle` (`ID`,`Sahip`,`Fiyat`,`X`,`Y`,`Z`,`A`,`Model`,`Renk1`,`Renk2`,`Plaka`) VALUES ('%d','%s','%d','%f','%f','%f','%f','%d','%d','%d','%s')",
  26. id, ownername, prices, spawn_x, spawn_y, spawn_z, z_angle, modelid, color1, color2, xVehicle[id][xv_Plaka]);
  27. mysql_query(handle, query);
  28.  
  29. if(!strlen(xVehicle[id][xv_Sahip]))
  30. {
  31. new str[150];
  32. format(str, sizeof(str), "{00FF00}This Vehicle Is For Sale!\n{FFA500}Vehicle Name: {FFFFFF}%s\n{FFA500}Plate Number: {FFFFFF}%s\n{FFA500}Price: {00FF00}$%d", GetVehicleNameFromModel(xVehicle[id][xv_ModelID]), xVehicle[id][xv_Plaka], xVehicle[id][xv_Fiyat]);
  33. xVehicle[id][xv_Text] = Create3DTextLabel(str, 0x008080FF, 0.0, 0.0, 0.0, 50.0, 0);
  34. Attach3DTextLabelToVehicle(xVehicle[id][xv_Text], xVehicle[id][xv_Veh], 0.0, 0.0, 1.0);
  35. }
  36. return xVehicle[id][xv_Veh];
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement