Advertisement
DoctorX13

AdvancedSpawnVehicle

Apr 7th, 2020
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. command gv(arg){
  2. permission = "vehicle.give";
  3. execute(){
  4. if(arg == null or arg == ""){
  5. player.message("Porfavor, especifica una id para spawnear.");
  6. return;
  7. }
  8. pos = player.position;
  9. py = pos.y + 5;
  10. px = pos.x + 5;
  11. pp = vector3(px, py, pos.z);
  12. vehicleManager.spawnVehicle(arg, pp, 0);
  13. foreach(vehicless in vehicleManager.vehicles){
  14. distan = v3.distance(vehicless.position, player.position);
  15. if(distan < 8 and vehicless.id == arg and vehicless.locked == false){
  16. vehicless.locked = true;
  17. vehicless.owner = player.id;
  18. }
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement