papam77 Posted July 27, 2013 Share Posted July 27, 2013 Hello, I've saw anywhere faster pickups rotation, how can do that please? Link to comment
iMr.3a[Z]eF Posted July 27, 2013 Share Posted July 27, 2013 You meant you want the pickup spin in circle? Link to comment
Castillo Posted July 27, 2013 Share Posted July 27, 2013 Maybe the pickup wasn't a default one, but a custom pickup. Link to comment
papam77 Posted July 27, 2013 Author Share Posted July 27, 2013 No, it was a default pickup, but faster rotations. Link to comment
Castillo Posted July 27, 2013 Share Posted July 27, 2013 How do you know it was a default pickup? Link to comment
denny199 Posted July 27, 2013 Share Posted July 27, 2013 I think he ment the race pickups. if so, search for race_client.lua for "updatePickups" Link to comment
papam77 Posted July 27, 2013 Author Share Posted July 27, 2013 Yes, thank you And this is for someone else function updatePickups() local setRotationSpeed = 1000 -- in ms local angle = math.fmod((getTickCount() - g_PickupStartTick) * 360 / setRotationSpeed, 360) local g_Pickups = g_Pickups local pickup, x, y, cX, cY, cZ, pickX, pickY, pickZ for colshape,elem in pairs(g_VisiblePickups) do pickup = g_Pickups[colshape] if pickup.load then setElementRotation(elem, 0, 0, angle) if pickup.label then cX, cY, cZ = getCameraMatrix() pickX, pickY, pickZ = unpack(pickup.position) x, y = getScreenFromWorldPosition(pickX, pickY, pickZ + 2.85, 0.08 ) local distanceToPickup = getDistanceBetweenPoints3D(cX, cY, cZ, pickX, pickY, pickZ) if distanceToPickup > 80 then pickup.labelInRange = false pickup.label:visible(false) elseif x then if distanceToPickup < 60 then if isLineOfSightClear(cX, cY, cZ, pickX, pickY, pickZ, true, false, false, true, false) then if not pickup.labelInRange then if pickup.anim then pickup.anim:remove() end pickup.anim = Animation.createAndPlay( pickup.label, Animation.presets.dxTextFadeIn(500) ) pickup.labelInRange = true pickup.labelVisible = true end if not pickup.labelVisible then pickup.label:color(255, 255, 255, 255) end pickup.label:visible(true) else pickup.label:color(255, 255, 255, 0) pickup.labelVisible = false pickup.label:visible(false) end else if pickup.labelInRange then if pickup.anim then pickup.anim:remove() end pickup.anim = Animation.createAndPlay( pickup.label, Animation.presets.dxTextFadeOut(1000) ) pickup.labelInRange = false pickup.labelVisible = false pickup.label:visible(true) end end local scale = (60/distanceToPickup)*0.7 pickup.label:scale(scale) pickup.label:position(x, y, false) else pickup.label:color(255, 255, 255, 0) pickup.labelVisible = false pickup.label:visible(false) end if Spectate.fadedout then pickup.label:visible(false) -- Hide pickup labels when screen is black end end else if pickup.label then pickup.label:visible(false) if pickup.labelInRange then pickup.label:color(255, 255, 255, 0) pickup.labelInRange = false end end end end end addEventHandler('onClientRender', g_Root, updatePickups) Link to comment
denny199 Posted July 27, 2013 Share Posted July 27, 2013 there are two ways, removing the angle variable and then use: setElementRotation(elem, 0, 0, (getElementRotation(elem)+1)) -- play arround with +1 or +2 etc. But by this function the fps will have a huge effect OR local angle = math.fmod((getTickCount() - g_PickupStartTick) * 360 / 2000, 360) Change the "divided by"(/) to less like / 1000 What you did there. Just to make it clear for everyone who is interested for making it faster. Have fun anyways, goodluck with scripting 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