
Hiding
Members-
Posts
58 -
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,630 profile views
Hiding's Achievements

Transformer (11/54)
8
Reputation
-
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.
-
I would like to ask that is there any way for, let's say an arrow marker, to be visible behind another object? So that it's always visible, even if there's another object in front of it??
-
Thank you so much, it works now
-
I'm encountering an issue with my script where it prints 'playerName died' twice when a vehicle explodes. Interestingly, it works fine when I press enter or jump into the water; it only prints once. Any suggestions on how to handle explosions in this script? Also, any tips on optimizing the script for better efficiency would be appreciated. function onPlayerWasted(totalAmmo, killer) local playerName = getPlayerName(source) if isElement(killer) and getElementType(killer) == "player" then local killerName = getPlayerName(killer) local victimName = getPlayerName(source) if killer == source then -- suicide outputChatBox(playerName .. " died") else outputChatBox(killerName .. " killer " .. victimName) end else outputChatBox(playerName .. " died") end end addEventHandler("onPlayerWasted", root, onPlayerWasted)
-
So first I have to apply a blink image for example?
-
Help pls?