Jump to content

"got vehicle"


Junim

Recommended Posts

WeaponCar = {};
Guard1 = {};
Guard2 = {};

addEventHandler("onResourceStart", root,
	function ()
		StartTrajet ();
	end
)	


function StartTrajet ()
	setTimer(function()
		if (isElement(WeaponCar) ) then
			destroyElement(WeaponCar);
		end	
		if (isElement(Guard1) ) then
			destroyElement(Guard1);
		end	
		if (isElement(Guard2) ) then
			destroyElement(Guard2);
		end	
		WeaponCar = createVehicle(498, 1360, -1279, 14);
		Guard1 = createPed(73, 0, 0, 0);
		Guard2 = createPed(73, 0, 0, 0);
		warpPedIntoVehicle(Guard1, WeaponCar);
		warpPedIntoVehicle(Guard2, WeaponCar, 1);
		setElementRotation(WeaponCar, 0, 0, 1);
		setVehicleColor(WeaponCar, 0, 0, 0, 255);
		setControlState(WeaponCar, "accelerate", true);
	end, 1500, 1)
end

Hi guys, my problem is this "setControlState" my debugscript say "Expected player at argument 1, got vehicle" why he say this? what is the error in my code?

Sorry my english I AM FROM BRAZIL ! 

I want that this vehicle accelerate alone , because i am doing an Artificial Inteligence "Traffic of vehicles". you can help me?

Edited by Junim
I entered the wrong code
Link to comment

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...