Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 22/08/24 in all areas

  1. if x and y and z and world and dimension and rotation then local player = client -- < HERE setElementData(player, "player.activeMarker", false) Make `player` a local variable. Else all players will share the variable `player` for the (delayed) timer functions. You can also pass the predefined `client` variable like this: setTimer(function (player) end, 1500, 1, client)
    1 point
  2. DOWNLOAD: https://community.multitheftauto.com/index.php?p=resources&s=details&id=14306 This countdown script draws digits in DX locally, it detects who is in the direct area of the player who triggers the countdown. Assuming these are participants of the race/event, they will get the DX '3, 2, 1' (or chosen lenght) on their screens.DEMONSTRATION: (7 seconds, = /cd 7 for my demo)Use: /cd [lenght in secs] for example 3 seconds: /cd 3= 3, 2, 1, GO! (including beep sounds like classic countdown)alt: /countdown, /cdn, etcIf someone gets auto-added to countdown unwanted, he can use /cstop to leave the countdown (as indicated in chat) so barely abusable; also it has anti spam timer, using countdown is limited by default to once per 40 seconds (you can modify the value in .lua, and also other values like area width for participants auto-add, max lenght in seconds etc)
    1 point
  3. You can multiply the blur if you render the screen source multiple times on a render target. Beware, it has a huge peformance impact. Lua Script: http://pastebin.com/10DumXhb Blur Shader: http://pastebin.com/VfAnetdB
    1 point
  4. onClientPreRender Notice (not quite sure about this): This number might be inaccurate, because pre-rendered frames might be dropped, which will show higher FPS (prerendered) than the actual FPS (rendered). local framesPerSecond = 0 local framesDeltaTime = 0 addEventHandler("onClientPreRender", root, function (deltaTime) framesDeltaTime = framesDeltaTime + deltaTime framesPerSecond = framesPerSecond + 1 if framesDeltaTime >= 1000 then setElementData(localPlayer, "fps", framesPerSecond) framesDeltaTime = framesDeltaTime - 1000 framesPerSecond = 0 end end ) onClientRender local framesPerSecond = 0 local framesDeltaTime = 0 local lastRenderTick = false addEventHandler("onClientRender", root, function () local currentTick = getTickCount() lastRenderTick = lastRenderTick or currentTick framesDeltaTime = framesDeltaTime + (currentTick - lastRenderTick) lastRenderTick = currentTick framesPerSecond = framesPerSecond + 1 if framesDeltaTime >= 1000 then setElementData(localPlayer, "fps", framesPerSecond) framesDeltaTime = framesDeltaTime - 1000 framesPerSecond = 0 end end ) @ getCurrentFPS This example is even more inaccurate than onClientPreRender because it may jump randomly between 0-FPSLIMIT, depending on CPU usage.
    1 point
×
×
  • Create New...