Jump to content

Recommended Posts

Posted (edited)

Not to respawn vehicle. Following this command, no error receive, but the vehicle does not respawn!

if (cmd[0] == 'towcar') {
		var pos = player.position;
		pos.x += 2.0;
		let car = "Rebel";
		if(player.veh){
			player.veh.destroy();
		}
		
		player.veh = mp.vehicles.new(mp.joaat(car), pos);
        
        player.outputChatBox("Вы заспавнили !{0, 153, 0}" + car);
		return 1;
	}
The team fulfills without errors, but the vehicle does not appear!
Edited by Jaden_Adams
Posted

The command works if you add the line:

player.modelcar.dimension = player.dimension;

Here on this template:

if (cmd[0] == 'towcar') {
		var pos = player.position;
		pos.x += 2.0;
		let car = "Rebel";
		if(player.modelcar){
			player.modelcar.destroy();
		}
		
		player.modelcar = mp.vehicles.new(mp.joaat(car), pos);
        player.modelcar.dimension = player.dimension; 
        player.outputChatBox("Вы заспавнили !{0, 153, 0}" + car);
		return 1;
	}

How to create the machines without the players on the server and so they are visible to all?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...