goldy0999 Posted January 9 Share Posted January 9 When I Am Trying To Stand On Train While Moving, Ped Was Throwd Out, is it anyway fix thiss Link to comment
Mkl Posted January 9 Share Posted January 9 Hi, maybe with https://wiki.multitheftauto.com/wiki/AttachElements Link to comment
xMKHx Posted February 16 Share Posted February 16 You may use a glue system Try mine local glues = {} function glue (plr, cmd) local veh = getPedContactElement(plr) if (getElementData(plr, "glue") == false) then -- Boolean again >_< if isElement(veh) and (getElementType(veh) == "vehicle") then local px, py, pz = getElementPosition(plr) local vx, vy, vz = getElementPosition(veh) local sx = px - vx local sy = py - vy local sz = pz - vz local rotpX = 0 local rotpY = 0 local rotpZ = getElementRotation(plr) local rotvX,rotvY,rotvZ = getVehicleRotation(veh) local t = math.rad(rotvX) local p = math.rad(rotvY) local f = math.rad(rotvZ) local ct = math.cos(t) local st = math.sin(t) local cp = math.cos(p) local sp = math.sin(p) local cf = math.cos(f) local sf = math.sin(f) local z = ct*cp*sz + (sf*st*cp + cf*sp)*sx + (-cf*st*cp + sf*sp)*sy local x = -ct*sp*sz + (-sf*st*sp + cf*cp)*sx + (cf*st*sp + sf*cp)*sy local y = st*sz - sf*ct*sx + cf*ct*sy local rotX = rotpX - rotvX local rotY = rotpY - rotvY local rotZ = rotpZ - rotvZ attachElements(plr, veh, x,y,z, rotX, rotY, rotZ) setElementData(plr, "glue", true) glues[plr] = veh end else if (isElement(glues[plr])) then detachElements(plr, glues[plr]) setElementData(plr, "glue", false) end end end addCommandHandler("glue", glue) 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