Jump to content

TrapiS

Members
  • Posts

    4
  • Joined

  • Last visited

About TrapiS

  • Birthday 26/06/2003

Details

  • Location
    Brasil - São Paulo
  • Interests
    LUA Script

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

TrapiS's Achievements

Vic

Vic (3/54)

0

Reputation

  1. Thanks everyone for the help, but I've already managed to achieve the result I expected using the interpolateBetween function to calculate the color values local multiplier = sX/820 local scrollPosition = localPlayer:getData("reputation")*multiplier local progress = 100 / (200*multiplier) * scrollPosition / 100 if progress <= 0.5 then rR, rG, rB = interpolateBetween(255, 0, 25, 255, 200, 0, progress*2, "Linear") elseif progress > 0.5 then rR, rG, rB = interpolateBetween(255, 200, 0, 0, 255, 25, progress-0.5, "Linear") end local hex = RGBToHex(rR, rG, rB)
  2. Thanks for the answer. I've already created the gradient texture for the reputation bar, but I'm not sure how to get it to see the color code in a specific position that would be the position where the bookmark would be, I'd have to use dxCreateTexture and dxGetTexturePixels for this? Gradient Texture: https://prnt.sc/ktpkoh Part of the reputation code: dxDrawText("Sua reputação: " .. localPlayer:getData("reputation_rank") .. "(" .. localPlayer:getData("reputation") .. ")", 1115 + 1, 440 + 1, 1605 + 1, 465 + 1, tocolor(50, 50, 50, 100), 0.60, g_MenuSettings['default']['text']['font_c'], "left", "center", false, false, true, true) dxDrawText("Sua reputação: #FFC800" .. localPlayer:getData("reputation_rank") .. "(" .. localPlayer:getData("reputation") .. ")", 1115, 440, 1605, 465, tocolor(50, 50, 50), 0.60, g_MenuSettings['default']['text']['font_c'], "left", "center", false, false, true, true) dxDrawLine(1110 - 1, 485 - 1, 1110 - 1, 500, tocolor(200, 200, 200), 1, true) dxDrawLine(1590, 485 - 1, 1110 - 1, 485 - 1, tocolor(200, 200, 200), 1, true) dxDrawLine(1110 - 1, 500, 1590, 500, tocolor(200, 200, 200), 1, true) dxDrawLine(1590, 500, 1590, 485 - 1, tocolor(200, 200, 200), 1, true) dxDrawImage(1110, 485, 480, 15, "assets/buttons/tab1_reputation.png", 0, 0, 0, tocolor(255, 255, 255), true)
  3. For starters, sorry for the mistakes in English, I'm from Brazil. I am trying to create a Freeroam in DX with the theme of Forza Horizon, in this freeroam I am creating a system of reputation of the player, of standard the reputation will be 100 points a neutral reputation, as it makes friendships within the server the reputation of it will rise, being able go up to 200 points, but if he arranges many discussions between players, his reputation will be decreased and can reach up to 0. https://prnt.sc/ktm4bc I wanted to make the "neutral (100)" string change color according to its reputation, being 0 red, 100 yellow, and 200 green, and the space between 0 and 100 is a mixture between red and yellow and so on but I do not know where I could start to make it work. Could someone help me by showing me some calculation bases or functions that I can use? Note: I am not using anything gui in the panel, everything being done in dx.
  4. Sorry for my english, i am Brazilian. I need a help because i want to compare a string with a number, but is not possible, i would like to know if there is any possibility of comparing a string with a number. Or create a function that blocks all numbers smaller than 1, and greater than 100000. Here is the script: Total script lines: 738 this is the script part of line 235 to 378 rollTime = 3500 gameDelay = 4000 playerWinRoll = {} jogoDosDadosStarted = {} function jogoDosDados (source, commandName, amount) if (isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin"))) then if (amount ~= "" and amount ~= nil) then if (jogoDosDadosA[source] == true) then if (jogoDosDadosStarted[source] == true) then outputChatBox("#FF3A64[ ! ] Error c642: #FFFFFFEste comando já está ativo, aguarde até este comando ficar disponivel novamente.", source, 255, 255, 255, true) else jogoDosDadosStarted[source] = true setTimer(function() jogoDosDadosStarted[source] = false end, gameDelay, 1) local pName = getPlayerName(source) local pMoney = getPlayerMoney(source) local nDados = math.random(1,6) local negativeN = 1 local muchN = 100000 if (pMoney > amount -1) then if (amount < negativeN) then outputChatBox("#FF3A64[ ! ] Error m435: #FFFFFFVocê não pode apostar uma quantia menor que 1.", source, 255, 255, 255, true) outputChatBox("#FF3A64[ ! ] AVISO! #FFFFFFTavez " .. pName .. " #FFFFFFesteja tentando bugar os dados.", root, 255, 255, 255, true) elseif (amount == muchN) then outputChatBox("#FF3A64[ ! ] Error m435: #FFFFFFVocê não pode apostar uma quantia maior que 100000.", source, 255, 255, 255, true) elseif (numberPar[source] == true) then if (nDados == 1) then outputChatBox("#00B2FF[ #FFFFFF! #00B2FF] #FFFFFFVocê girou os dados apostando em números pares.", source, 255, 255, 255, true) takePlayerMoney(source, amount) triggerClientEvent(source, "playDiceSound", source, diceRolling) setTimer(function() outputChatBox("#00B2FF[ #FFFFFF! #00B2FF] #FFFFFFVocê perdeu, número do dado: #00B2FF1#FFFFFF.", source, 255, 255, 255, true) triggerClientEvent(source, "playLoseSound", source, youLose) end, rollTime, 1) elseif (nDados == 2) then outputChatBox("#00B2FF[ #FFFFFF! #00B2FF] #FFFFFFVocê girou os dados apostando em números pares.", source, 255, 255, 255, true) takePlayerMoney(source, amount) triggerClientEvent(source, "playDiceSound", source, diceRolling) playerWinRoll[source] = true setTimer(function() outputChatBox("#00B2FF[ #FFFFFF! #00B2FF] #FFFFFFVocê ganhou, número do dado: #00B2FF2#FFFFFF.", source, 255, 255, 255, true) givePlayerMoney(source, amount *2) triggerClientEvent(source, "playWinSound", source, youWin) playerWinRoll[source] = false end, rollTime, 1) elseif (nDados == 3) then outputChatBox("#00B2FF[ #FFFFFF! #00B2FF] #FFFFFFVocê girou os dados apostando em números pares.", source, 255, 255, 255, true) takePlayerMoney(source, amount) triggerClientEvent(source, "playDiceSound", source, diceRolling) setTimer(function() outputChatBox("#00B2FF[ #FFFFFF! #00B2FF] #FFFFFFVocê perdeu, número do dado: #00B2FF3#FFFFFF.", source, 255, 255, 255, true) triggerClientEvent(source, "playLoseSound", source, youLose) end, rollTime, 1) elseif (nDados == 4) then outputChatBox("#00B2FF[ #FFFFFF! #00B2FF] #FFFFFFVocê girou os dados apostando em números pares.", source, 255, 255, 255, true) takePlayerMoney(source, amount) triggerClientEvent(source, "playDiceSound", source, diceRolling) playerWinRoll[source] = true setTimer(function() outputChatBox("#00B2FF[ #FFFFFF! #00B2FF] #FFFFFFVocê ganhou, número do dado: #00B2FF4#FFFFFF.", source, 255, 255, 255, true) givePlayerMoney(source, amount *2) triggerClientEvent(source, "playWinSound", source, youWin) playerWinRoll[source] = false end, rollTime, 1) elseif (nDados == 5) then outputChatBox("#00B2FF[ #FFFFFF! #00B2FF] #FFFFFFVocê girou os dados apostando em números pares.", source, 255, 255, 255, true) takePlayerMoney(source, amount) triggerClientEvent(source, "playDiceSound", source, diceRolling) setTimer(function() outputChatBox("#00B2FF[ #FFFFFF! #00B2FF] #FFFFFFVocê perdeu, número do dado: #00B2FF5#FFFFFF.", source, 255, 255, 255, true) triggerClientEvent(source, "playLoseSound", source, youLose) end, rollTime, 1) elseif (nDados == 6) then outputChatBox("#00B2FF[ #FFFFFF! #00B2FF] #FFFFFFVocê girou os dados apostando em números pares.", source, 255, 255, 255, true) takePlayerMoney(source, amount) triggerClientEvent(source, "playDiceSound", source, diceRolling) playerWinRoll[source] = true setTimer(function() outputChatBox("#00B2FF[ #FFFFFF! #00B2FF] #FFFFFFVocê ganhou, número do dado: #00B2FF6#FFFFFF.", source, 255, 255, 255, true) givePlayerMoney(source, amount *2) triggerClientEvent(source, "playWinSound", source, youWin) playerWinRoll[source] = false end, rollTime, 1) end elseif (numberImpar[source] == true) then if (nDados == 1) then outputChatBox("#00B2FF[ #FFFFFF! #00B2FF] #FFFFFFVocê girou os dados apostando em números impares.", source, 255, 255, 255, true) takePlayerMoney(source, amount) triggerClientEvent(source, "playDiceSound", source, diceRolling) playerWinRoll[source] = true setTimer(function() outputChatBox("#00B2FF[ #FFFFFF! #00B2FF] #FFFFFFVocê ganhou, número do dado: #00B2FF1#FFFFFF.", source, 255, 255, 255, true) givePlayerMoney(source, amount *2) triggerClientEvent(source, "playWinSound", source, youWin) playerWinRoll[source] = false end, rollTime, 1) elseif (nDados == 2) then outputChatBox("#00B2FF[ #FFFFFF! #00B2FF] #FFFFFFVocê girou os dados apostando em números impares.", source, 255, 255, 255, true) takePlayerMoney(source, amount) triggerClientEvent(source, "playDiceSound", source, diceRolling) setTimer(function() outputChatBox("#00B2FF[ #FFFFFF! #00B2FF] #FFFFFFVocê perdeu, número do dado: #00B2FF2#FFFFFF.", source, 255, 255, 255, true) triggerClientEvent(source, "playLoseSound", source, youLose) end, rollTime, 1) elseif (nDados == 3) then outputChatBox("#00B2FF[ #FFFFFF! #00B2FF] #FFFFFFVocê girou os dados apostando em números impares.", source, 255, 255, 255, true) takePlayerMoney(source, amount) triggerClientEvent(source, "playDiceSound", source, diceRolling) playerWinRoll[source] = true setTimer(function() outputChatBox("#00B2FF[ #FFFFFF! #00B2FF] #FFFFFFVocê ganhou, número do dado: #00B2FF3#FFFFFF.", source, 255, 255, 255, true) givePlayerMoney(source, amount *2) triggerClientEvent(source, "playWinSound", source, youWin) playerWinRoll[source] = false end, rollTime, 1) elseif (nDados == 4) then outputChatBox("#00B2FF[ #FFFFFF! #00B2FF] #FFFFFFVocê girou os dados apostando em números impares.", source, 255, 255, 255, true) takePlayerMoney(source, amount) triggerClientEvent(source, "playDiceSound", source, diceRolling) setTimer(function() outputChatBox("#00B2FF[ #FFFFFF! #00B2FF] #FFFFFFVocê perdeu, número do dado: #00B2FF4#FFFFFF.", source, 255, 255, 255, true) triggerClientEvent(source, "playLoseSound", source, youLose) end, rollTime, 1) elseif (nDados == 5) then outputChatBox("#00B2FF[ #FFFFFF! #00B2FF] #FFFFFFVocê girou os dados apostando em números impares.", source, 255, 255, 255, true) takePlayerMoney(source, amount) triggerClientEvent(source, "playDiceSound", source, diceRolling) playerWinRoll[source] = true setTimer(function() outputChatBox("#00B2FF[ #FFFFFF! #00B2FF] #FFFFFFVocê ganhou, número do dado: #00B2FF5#FFFFFF.", source, 255, 255, 255, true) givePlayerMoney(source, amount *2) triggerClientEvent(source, "playWinSound", source, youWin) playerWinRoll[source] = false end, rollTime, 1) elseif (nDados == 6) then outputChatBox("#00B2FF[ #FFFFFF! #00B2FF] #FFFFFFVocê girou os dados apostando em números impares.", source, 255, 255, 255, true) takePlayerMoney(source, amount) triggerClientEvent(source, "playDiceSound", source, diceRolling) setTimer(function() outputChatBox("#00B2FF[ #FFFFFF! #00B2FF] #FFFFFFVocê perdeu, número do dado: #00B2FF6#FFFFFF.", source, 255, 255, 255, true) triggerClientEvent(source, "playLoseSound", source, youLose) end, rollTime, 1) end this is the script part of line 241 to 260 if (amount ~= "" and amount ~= nil) then if (jogoDosDadosA[source] == true) then if (jogoDosDadosStarted[source] == true) then outputChatBox("#FF3A64[ ! ] Error c642: #FFFFFFEste comando já está ativo, aguarde até este comando ficar disponivel novamente.", source, 255, 255, 255, true) else jogoDosDadosStarted[source] = true setTimer(function() jogoDosDadosStarted[source] = false end, gameDelay, 1) local pName = getPlayerName(source) local pMoney = getPlayerMoney(source) local nDados = math.random(1,6) local negativeN = 1 local muchN = 100000 if (pMoney > amount -1) then if (amount < negativeN) then outputChatBox("#FF3A64[ ! ] Error m435: #FFFFFFVocê não pode apostar uma quantia menor que 1.", source, 255, 255, 255, true) outputChatBox("#FF3A64[ ! ] AVISO! #FFFFFFTavez " .. pName .. " #FFFFFFesteja tentando bugar os dados.", root, 255, 255, 255, true) elseif (amount == muchN) then outputChatBox("#FF3A64[ ! ] Error m435: #FFFFFFVocê não pode apostar uma quantia maior que 100000.", source, 255, 255, 255, true)
×
×
  • Create New...