Infra

Forum Member
  • Content Count

    11
  • Joined

  • Last visited

  • Days Won

    1

Infra last won the day on May 3

Infra had the most liked content!

About Infra

  • Rank
    Newbie
  • Birthday 03/30/1999

Contact Methods

  • Skype
    Infrarot99

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

431 profile views
  1. Previous Page Next Page easeGameSpeed This function changes the players game speed step by step (that way it appears smoother) I'm using this in my maps a lot and in my opinion it makes a huge difference Difference between setGameSpeed and easeGameSpeed: local ease = {} function easeGameSpeed(targetSpeed, overTime, callback) ease.startedAt = getTickCount() ease.startSpeed = getGameSpeed() ease.targetSpeed = math.round(targetSpeed, 4, "floor") ease.overTime = overTime ease.callback = (type(callback) == "function" or type(callback) == "nil") and (type(callback) == "function" and callback or nil) or nil ease.isActive = true end addEventHandler("onClientRender", root, function() if ease.isActive then local progress = (getTickCount() - ease.startedAt) / ((ease.startedAt + ease.overTime) - ease.startedAt) local currentSpeed = math.round(getGameSpeed(), 1, (ease.startSpeed > ease.targetSpeed and "ceil" or "floor")) local X, Y, Z = interpolateBetween(currentSpeed, 0.0, 0.0, ease.targetSpeed, 0.0, 0.0, progress, "InOutQuad") X = math.round(X, 4, (ease.startSpeed > ease.targetSpeed and "floor" or "ceil")) if ease.startSpeed > ease.targetSpeed and X <= ease.targetSpeed then X = math.round(X, 1, "ceil") elseif ease.startSpeed < ease.targetSpeed and X >= ease.targetSpeed then X = math.round(X, 1, "floor") end setGameSpeed(X) if X == ease.targetSpeed then ease.isActive = false if type(ease.callback) == "function" then ease.callback(); end end end end) function math.round(number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end end ^ Paste this code somewhere in your script file ^ Example Usage local Marker = createMarker(X, Y, Z, "corona", SIZE, 0, 0, 0) addEventHandler("onClientMarkerHit", getRootElement(), function(playerid) if playerid == getLocalPlayer() then if isPedInVehicle(playerid) then local vehicleid = getPedOccupiedVehicle(playerid) if source == Marker then --Params: (targetSpeed, overTime, callback) easeGameSpeed(0.6, 1500, function() -- Target game speed reached -- Now you can either delay the reversal by using setTimer: -- This example waits 1500ms before it starts reversing the game speed back to 1.0 over a time of 1000ms setTimer(function() easeGameSpeed(1.0, 1000) end, 1500, 1) --OR instantly start the reversal back to 1.0: easeGameSpeed(1.0, 1500) end) end end end end) -- And obviously the function somewhere down here.. Previous Page Next Page
  2. Download: http://www.mediafire.com/download/zv4apwgg7tlpwzs/-DM-Infra-ft-Tx-Undiscovered-Island-.zip
  3. Hello guys,I'm back with another great map called 'Undiscovered Island' made by 2 great mappers:Infra and Tx!. Good job my friends! Do you want me to record your map?Contact me via Skype: oribr3