Sign in to follow this  
Jaden_Adams

Not to respawn vehicle

Recommended Posts

Jaden_Adams    0

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

Share this post


Link to post
Share on other sites
Jaden_Adams    0

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?

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.