Lloyd Logan Posted April 2, 2013 Posted April 2, 2013 Hey what is the argument meant to be in if ( getVehicleTowedByVehicle ( ????? ) == bullet ) then if i want it be a towtruck? e.g. towVehicles = { [525]=true } What i mean is the ????? has to be a towtruck (id 525) what do i put in there? EDIT : I TRIED if ( getVehicleTowedByVehicle ( towVehicles[getElementModel ( source )] ) == bullet ) then BUT THAT NEVER WORKED! Thanks Lloyd If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE SCOTLAND, my hometown, and the Home of GTA!
Moderators IIYAMA Posted April 2, 2013 Moderators Posted April 2, 2013 if ( getVehicleTowedByVehicle ( ????? ) == bullet ) then Vehicle user data should be there. (just the vehicle) = getVehicleTowedByVehicle ( vehicle ) Returns the vehicle(the wagon) behind it or false. https://wiki.multitheftauto.com/wiki/GetElementModel local model1 = getElementModel ( vehicle1 ) if towVehicles[model1] then --or if towVehicles[getElementModel ( vehicle1 )] then It works for sure. getVehicleTowedByVehicle ( towVehicles[getElementModel ( source )] ) == bullettowVehicles[getElementModel ( source )] -- boolean (true/false) getVehicleTowedByVehicle ( boolean )-- error Compare error with vehicle user data.... Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Lloyd Logan Posted April 2, 2013 Author Posted April 2, 2013 What i wan't is to check that the vehicle towing towing the bullet is id 525 (the towtruck)? If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE SCOTLAND, my hometown, and the Home of GTA!
DiSaMe Posted April 2, 2013 Posted April 2, 2013 getVehicleTowingVehicle Isn't that what you actually need? -
Lloyd Logan Posted April 2, 2013 Author Posted April 2, 2013 getVehicleTowingVehicle Isn't that what you actually need? How would i check the id of the car is 525? If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE SCOTLAND, my hometown, and the Home of GTA!
Ludo Posted April 2, 2013 Posted April 2, 2013 How would i check the id of the car is 525? vehicle = getVehicleTowingVehicle(yourVehicle) if getElementModel(vehicle) == 525 then --your function end
Lloyd Logan Posted April 2, 2013 Author Posted April 2, 2013 How would i check the id of the car is 525? vehicle = getVehicleTowingVehicle(yourVehicle) if getElementModel(vehicle) == 525 then --your function end What is meant to be under "yourVehicle"? If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE SCOTLAND, my hometown, and the Home of GTA!
Ludo Posted April 2, 2013 Posted April 2, 2013 How would i check the id of the car is 525? vehicle = getVehicleTowingVehicle(yourVehicle) if getElementModel(vehicle) == 525 then --your function end What is meant to be under "yourVehicle"? Man, what do you want to do with your script? I didn't get it.
Lloyd Logan Posted April 2, 2013 Author Posted April 2, 2013 It has to be that when the car hits the marker, it has to be towed in order for it to work (instead of driving the car there it has to be towed!) If you need an Intermediate scripter feel free to PM me as I will accept "almost" any job, STATUS: UNAVAILABLE SCOTLAND, my hometown, and the Home of GTA!
Ludo Posted April 2, 2013 Posted April 2, 2013 This will check is the vehicle that hits the marker is being towed and if it is a bullet. function checkIfTowed(element) if getElementType(element) == "vehicle" then if getVehicleTowingVehicle(element) then if getElementModel(element) == 525 then --your function end end end end addEventHandler("onMarkerHit", getRootElement(), checkIfTowed) EDIT: I used a wrong event, this one should work
Moderators IIYAMA Posted April 2, 2013 Moderators Posted April 2, 2013 Note: When you hit every marker, this will be executed. The best way to solve this is by using special element id's. setElementID (element,"TOWmarker")-- when you create the marker. if getElementID(element)=="TOWmarker" then -- on marker hit Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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