Hello everyone! I am new to this scripting stuff so I am looking for help. For the last few days I have been trying to make work SetElementModel and have no success. What I want this script to do is to change one vehicle to another while you are driving it. Any suggestions? Here is link to the site- https://wiki.multitheftauto.com/wiki/SetElementModel. Also here is the code I used.
addCommandHandler ( "changeveh",
function ( thePlayer, command, newModel )
local theVehicle = getPedOccupiedVehicle ( thePlayer )
newModel = tonumber ( newModel )
if theVehicle and newModel then
setElementModel ( theVehicle, newModel )
end
end
)