Clipper_ Posted November 25, 2017 Share Posted November 25, 2017 I want to create a script that prevents the fall of the player from the bike while doing backflips and while having another player glued. The thing is it doesn't do what it is supposed to. function onClientRender() if (isElementAttached(localPlayer) == true) then local naElement = getElementAttachedTo(localPlayer) if (getElementType(naElement) == "vehicle") then if (getVehicleType(naElement) == "Bike" or getVehicleType(naElement) == "BMX" or getVehicleType(vehicle) == "Quad") then local driver = getVehicleOccupant(naElement, 0) if (driver) then local rX, rY, rZ = getElementRotation(naElement) --outputChatBox("Bike rotation: x = " .. rX .. " y = " .. rY .. " z = " .. rZ) if (rX > 90 and rX < 300) then setPedCanBeKnockedOffBike(driver, true) outputChatBox(getPlayerName(driver) .. " is fixed") else setPedCanBeKnockedOffBike(driver, false) outputChatBox(getPlayerName(driver) .. " is not fixed") end end end end end end addEventHandler("onClientRender", root, onClientRender) Link to comment
Moderators IIYAMA Posted November 25, 2017 Moderators Share Posted November 25, 2017 Quote The thing is it doesn't do what it is supposed to. Not specific enough... Where does it go wrong? This code can't tell me right away what your problem is. Link to comment
Clipper_ Posted November 25, 2017 Author Share Posted November 25, 2017 (edited) So, in my server i have configured "glue" script, which attach players to my vehicle. Recently, i found a bug that throws me away if I do backflips and if i have another player glued on. What i want to do is to force myself to not fall of when i do rotations and when i have someone glued on my bike Edited November 25, 2017 by Clipper_ mistakes Link to comment
Moderators IIYAMA Posted November 25, 2017 Moderators Share Posted November 25, 2017 But what does this script has to do with the glue script? Because the function setPedCanBeKnockedOffBike has no influence over the glue script. Link to comment
Dzsozi (h03) Posted November 27, 2017 Share Posted November 27, 2017 https://community.multitheftauto.com/index.php?p=resources&s=details&id=12903 This may help you out with the rotations. Link to comment
Clipper_ Posted November 27, 2017 Author Share Posted November 27, 2017 I finished my script, restricting some cases when player could have felt off the bike in another way. I request topic closed 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