
Hiding
Members-
Posts
63 -
Joined
-
Last visited
-
Days Won
1
Hiding last won the day on February 10 2024
Hiding had the most liked content!
Recent Profile Visitors
1,843 profile views
Hiding's Achievements

Transformer (11/54)
8
Reputation
-
Needed an extra showCursore(false) before the timer showCursor(true) if savedCursorX and savedCursorY then showCursor(false) -- here local screenX, screenY = guiGetScreenSize() setTimer(function() setCursorPosition(savedCursorX * screenX, savedCursorY * screenY) showCursor(true) end, 50, 1) end So now it looks good thank you guys
-
No any errors..
-
Thank you, but same :~.. xd doesnt help
-
As I mentioned, I already tried getCursorPosition and setCursorPosition, but it doesn't work — the cursor still starts from the center of the screen.. local function togglePanel() toggle = not toggle if toggle then if savedCursorX and savedCursorY then local screenX, screenY = guiGetScreenSize() setCursorPosition(savedCursorX * screenX, savedCursorY * screenY) end showCursor(true) else savedCursorX, savedCursorY = getCursorPosition() showCursor(false) end end bindKey("k", "down", togglePanel) Doesnt work this way
-
Hi, When I use showCursor(true) to open a panel, the cursor appears in the center of the screen for a short moment, then instantly jumps to where it was before I closed the panel. I tried saving the last position using getCursorPosition() and restoring it with setCursorPosition(), but it doesn't help. Any idea how to prevent the cursor jumping from the center?
-
Hi guys, my problem is that for some reason the slow element movement in map editor doesn't work properly, if I hold down the alt key it was working fine, but for some reason it doesn't work anymore, I reinstalled everything and it's still not woking I can set the slow element movement speed in the Movement tab of the settings, I set it to 0.001, but even if I move the object and hold the alt key, it doesn't slow down, it's as fast as normal movement.. Why is that? ** I found the problem, another script had a cancelEvent() on the lalt key.. XD
-
Thank your for your reply. By the way, dxDrawRectangle should cover the full size of the screen. The other part, including dxDrawImage and everything inside window.drawHeaderInfos(), should be drawn using dxSetRenderTarget. I want the entire header to use dxSetRenderTarget. That's why I asked what the proper way to use it. If there are multiple hud elements (functions) one after the other, for example and pls don't rename "window" to "janela" bcs its hard to read that way
-
Hi guys, I'm wondering how to use this dxCreateRenderTarget in a proper way. So i have this script: I'm trying to make a fade animation, when the window comes up and down, but nothing appears. Anyone can help me how to use this? local window = {} window.windowWidth = 600 window.headerHeight = 600 window.renderTarget.mainHeader = dxCreateRenderTarget(window.windowWidth, window.headerHeight, true) function window.drawHeader() dxSetRenderTarget(window.renderTarget.mainHeader, true) dxDrawRectangle(0, 0, screenWidth, screenHeight, tocolor(10, 10, 10, math_min(window.colors.alpha, 100))) dxDrawImage(window.headerX, window.headerY, window.windowWidth, window.headerHeight, textures.header_bg, 0, 0, 0, tocolor(30, 30, 30, math.min(window.colors.alpha, 250)), false) window.drawMatchScore() dxSetRenderTarget() end function window.drawHeaderInfos() -- ofc there is more data, but its not relevant dxDrawText(vsText, vsTextX, vsTextY, vsTextX, vsTextY, tocolor(230, 230, 230, window.colors.alpha), window.fonts.size, window.fonts.fontSize) end local function updateScoreboard() local now = getTickCount() local elapsedTime = now - window.fadeStartTime local progress = math_min(elapsedTime / window.fadeDuration, 1) window.currentAlpha = interpolateBetween( window.fadeStartAlpha, 0, 0, window.targetAlpha, 0, 0, progress, "Linear") window.colors.alpha = math_floor(window.currentAlpha) if window.renderTarget.mainHeader then dxDrawImage(window.headerX, window.headerY, window.windowWidth, window.headerHeight, window.renderTarget.mainHeader) end if progress == 1 and not window.isVisible and window.currentAlpha == 0 then removeEventHandler("onClientRender", root, updateScoreboard) window.isHandlerAdded = false end end local function toggleScoreboard(state) window.isVisible = state window.targetAlpha = state and 255 or 0 window.fadeStartTime = getTickCount() window.fadeStartAlpha = window.currentAlpha if not window.isHandlerAdded then addEventHandler("onClientRender", root, updateScoreboard) window.isHandlerAdded = true end end bindKey("H", "down", function() window.drawHeader() toggleScoreboard(true) end) bindKey("H", "up", function() toggleScoreboard(false) end)
-
Actually the km data is saved in the memory local function initializePlayerData(player, km_driven) playerData[player] = { lastPosition = Vector3(getElementPosition(player)), distanceTraveled = km_driven * 1000, newDistance = 0, } end Only the final data that has been driven between login and quit will be saved in the db.
-
Actually now I'm measuring the player's km on the server side, and I saving it when the player onPlayerQuit, but im using setTimer(function() ... end, 1000, 0) to measure it, can it be problem on the server, if it needs to save for example 10 players at the same time?
-
Thank you for your answer, then what would be your suggestion? Because I use an onClientRender to measure the distance driven by the player in km, and I would like to save it to db when the player leaves the server to avoid unnecessary dbExec
-
function onPlayerWasted() triggerServerEvent("someEvent", localPlayer, data / 1000) end addEventHandler("onClientPlayerWasted", root, onPlayerWasted) function onPlayerQuit() setTimer(function() triggerServerEvent("someEvent", localPlayer, data / 1000) end, 2000, 1) end addEventHandler("onClientPlayerQuit", root, onPlayerQuit) addEvent("someEvent", true) addEventHandler("someEvent", root, function(data) if not exports.login:isPlayerLoggedIn(source) then return end exports.login:updatePlayerStat(source, "stat", "stat", data) end) I would like to ask how can I make it so that when a player disconnects from the server, the data collected on the client side is sent to the server? It works fine with onClientPlayerWasted, but doesn't work with the onClientPlayerQuit, why?
-
Ah, thank you for your response, I think I'll stick with the marker not being visible behind the object.
-
Thanks for your answer, I know these thinks Let me write it down again, my question concerns how the arrow marker can be visible behind an object, the objects has 255 alpha, meaning it's not transparent, so I want my arrow marker to be visible even if there's an object front of it that obscures it.
-
I know, my question was whether if there's an object in front of it, you can't see it, because that object obscures it. I want it to be visible even if there's an object front of it that obscures it.