Captain Cody Posted November 23, 2015 Share Posted November 23, 2015 towingVehicle = getVehicleTowedByVehicle ( trailer ) playeraab = getVehicleOccupant ( towingVehicle ) trailer = createVehicle (435, 64.477539, -268.84082, 3, 0, 0, 360) error in debugscript - Expected vehicle argument for getVehicleTowedbyVehicle and GetVehicleOccupant. Link to comment
DRW Posted November 23, 2015 Share Posted November 23, 2015 towingVehicle = getVehicleTowedByVehicle ( trailer ) playeraab = getVehicleOccupant ( towingVehicle ) trailer = createVehicle (435, 64.477539, -268.84082, 3, 0, 0, 360) error in debugscript - Expected vehicle argument for getVehicleTowedbyVehicle and GetVehicleOccupant. The error is happening because you first check for the trailer and after that you create it. trailer = createVehicle (435, 64.477539, -268.84082, 3, 0, 0, 360) towingVehicle = getVehicleTowedByVehicle ( trailer ) playeraab = getVehicleOccupant ( towingVehicle ) That should do the trick. Oh and also, you should warp a player or ped inside of it before checking out for the occupant. How are you supposed to check for the occupants at the exact moment when the vehicle is created? Use the "OnVehicleEnter" function or some timer. Ex: trailer = createVehicle (435, 64.477539, -268.84082, 3, 0, 0, 360) towingVehicle = getVehicleTowedByVehicle ( trailer ) addEventHandler ("onVehicleEnter",towingVehicle,function() playeraab = getVehicleOccupant ( towingVehicle ) end) Remember that te scripted functions always get executed in the same order: -- RIGHT WAY ped = createPed (0,0,0,5) -- You first create the ped setElementRotation (ped,0,0,60) -- Then you use a function to interact with it -- WRONG WAY setElementRotation (ped,0,0,60) -- You first interact with the ped ped = createPed (0,0,0,5) -- Then you create it Link to comment
Captain Cody Posted November 23, 2015 Author Share Posted November 23, 2015 How would I do it so it checks for driver when the towing vehicle is attatched to the trailer? Link to comment
Captain Cody Posted November 23, 2015 Author Share Posted November 23, 2015 Well that worked, but it seams the rest of the script no longer works. Link to comment
Tails Posted November 23, 2015 Share Posted November 23, 2015 How would I do it so it checks for driver when the towing vehicle is attatched to the trailer? Try use getVehicleController https://wiki.multitheftauto.com/wiki/Ge ... Controller Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now