kuba90pl Posted January 16, 2012 Share Posted January 16, 2012 How to check that is some trailer atached to roadtrain , and get his modelid? Link to comment
BriGhtx3 Posted January 16, 2012 Share Posted January 16, 2012 function checkAttachedElement(player) local veh = getPedOccupiedVehicle(player) if veh then if getElementModel(veh) == 515 then if isElementAttached(veh) then local attachedElement = getElementAttachedTo(veh) if getElementType(attachedElement) == "vehicle" then outputChatBox(tostring(getElementModel(attachedElement)) end end end end end addCommandHandler("check",checkAttachedElement) Link to comment
Castillo Posted January 16, 2012 Share Posted January 16, 2012 Why not use the trailer functions instead? function checkAttachedElement(player) local veh = getPedOccupiedVehicle(player) if veh then local trailer = getVehicleTowedByVehicle(veh) if getElementModel(veh) == 515 and trailer then outputChatBox(tostring(getElementModel(trailer)), player) end end end addCommandHandler("check",checkAttachedElement) Link to comment
BriGhtx3 Posted January 17, 2012 Share Posted January 17, 2012 Cause I didn't know them ;D 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