Jump to content

koragg

Members
  • Posts

    730
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by koragg

  1. Hm, thanks guys. Gonna see what I come up with in the coming days.
  2. I already know how to fix dxDrawText functions for any resolution but is it possible to make the same for GUI windows? I have, for example, a map shop but it's ok only on my resolution (FHD). How can I make it rescale itself properly on smaller/bigger resolutions so that it will always be in the same spot and the same size on any screen resolution? I tried the same way as I did for dxDrawText but it doesn't work as good. Partially it works but not good enough.
  3. Here are a few videos which show the server when there are more players on: https://www.vbox7.com/play:2725df8f20 https://www.vbox7.com/play:21d1506763
  4. Here's another method as well: Let's say that your dxDrawText looks just like you want it to on a screen resolution of 1440x900. You can use the following way to make it ok on any resolution: local sx_, sy_ = guiGetScreenSize() local sx, sy = sx_/1440, sy_/900 dxDrawText("$123456789", 140*sx, 648*sy, 0*sx, 0*sy, tocolor(0,0,0,255), 0.8*sy,"bankgothic") Now a bit of an explanation on how it works. So you made the text look fine on 1440x900, nice. When you made your text function to look ok on 1440x900 it will look like this: dxDrawText("$123456789", 140, 648, 0, 0, tocolor(0,0,0,255), 0.8,"bankgothic") Now all you do is multiply each value by the "sx" and "sy" you just calculated at the top of the script. This way the position of the text will move accordingly with the resolution. This means that if the text is below the radar on 1440x900 and you use this way then on 1920x1080, 1366x768, 1280x720, etc the text will always be in the same spot, below the radar. And always remember to multiply the scale of the text by the "sy" variable to make it smaller on small resolutions and bigger on big ones. This is just an alternative way to the method which @Hale provided. There's no performance drawbacks or anything to this, use whichever seems easier for you. Hope we help others as I remember I had huge problems with this when I was still new to LUA and drawing stuff on screen .
  5. Have a look at the example here: https://wiki.multitheftauto.com/wiki/GuiGetScreenSize You should do some maths and make your text always be in the same position on any resolution.
  6. Background Hello everybody, I'm here to present you my brand new and updated race server but first some information about how I got to make it. It all started around august 2015 when I read a tutorial on these forums on how to open my own server as back then I needed it to train some maps alone and restart them as many times as I wanted. But in time I got interested in how all those other servers I play on are actually made and little by little I started learning LUA. At first I just used ready scripts from the community, a bit later I started to edit small parts of them and soon after I started to recreate community resources, meaning that I use the base idea/code but adapt it for my needs. And not long after I made my first standalone script. Since then I've learned a lot about how MTA works and actually that was what got me interested in programming and at the moment I'm first year in university, studying informatics and working on a few MTA servers A Glimpse Of What's Included If you wish to have a look at some of the features on the server, screenshots are available at the following link (not all are included in the screenshots): click me Server Information I won't give an IP here because there's no telling when it might change since I'm on a free hosting service (which has premium quality by the way)(https://www.limitlessrpg.com). You can either search for the server by it's name (Classic Racing) or you can see the current IP on it's forums at http://www.classicracing.tk. Other than that below you will see some more information about the server if you want to know more about it: Server Location: France Server Version: 1.5.4 First Download: Around 50 MB Maps: There are around 2000 racing maps each of which was reviewed and had it's details edited if needed. My main goal is to offer that old classic feeling of race which sadly most other servers have just forgotten and they started accepting any kind of maps in their race arenas/rooms, even DM maps or ones which are kindly put - horrible to play in any gamemode. If a map on the server is bad, you can report it to be deleted on the forums and it actually will be deleted. I hope you give the server a go when you have some free time. There are a lot of features (some quite unique and not seen in other servers) not included in the screenshots above. I have used open-source servers' resources as well as a lot of community ones but everything that was not made by me was edited or recreated mainly by me and a few of my MTA friends so that there are zero bugs or incompatibility between scripts. See you on the roads of San Andreas
  7. I did this to around 90% of my server's dxDrawText stuff. I guess you can't really make it look good on ANY resolution. But c'mon: who'll play on 640x480 lol If you make it look ok and readable down to 1280x720 then that's perfect. It's 2017 with 4k screens and you worry about a 480p one Output a message to users which are on a resolution below HD that they need to up it a bit if they want to enjoy your server.
  8. Hey people. I've got a request to somebody who knows php, css, etc. Can someone make me a small script which shows my server's status in the center of my website's home page right above the shoutbox? (http://www.classicracing.tk) If the server is online it should show in green text "Online curPlayers/maxPlayers" and when it's offline to show a text "Offline 0/maxPlayers". I searched the Internet and found just one php script from 2011 but i think that would show it on a completely new page, which isn't what I'm looking for. I'd be thankful if you tell how to position it at the center since i don't know even that. I'm a complete noob in website stuff but managed to create my forum thanks to the awesome SMF and all it's easy to use modifications.
  9. Make it look good on your resolution with normal numbers and then take a look at the example here: https://wiki.multitheftauto.com/wiki/GuiGetScreenSize There're better ways to achieve it but that's what I use and it works fine.
  10. All downloaded files are here: ...\MTA San Andreas 1.5.4\mods\deathmatch\resources
  11. Normally you download the resources of a server only once. Maybe what you're downloading are the different maps + all of the custom car models, music, etc.
  12. Here's something that may help in uploading maps to your website: https://github.com/JarnoVgr/Mr.Green-MTA-Resources/tree/master/www/mta
  13. damn @pa3ck you beat me to it Just had to erase 20 lines of writing because you said them :v
  14. function godCommand(player) if hasObjectPermissionTo(player, "command.kick") then if getElementData(player,"onProt") then setElementData(player,"onProt",false) outputChatBox("",player,255,255,0,true) else setElementData(player,"onProt",true) setPlayerSkin(player, 287) outputChatBox("",player,255,255,0,true) end end end addCommandHandler("pro",godCommand) Line 8 was not 'player' but 'thePlayer' in your code
  15. For some reason it counts the "unpack(loginPanelPos["globalPanel"]" as one argument (doesn't unpack it) and that's why it gives the boolean error at arg3 (I think). Try this: -- CLIENT local loginPanelPos = { ["globalPanel"] = {0,0,557,400} } function showLoginPanel( ) a = guiCreateStaticImage(loginPanelPos["globalPanel"][1], loginPanelPos["globalPanel"][2], loginPanelPos["globalPanel"][3], loginPanelPos["globalPanel"][4], "LOGIN.png", false) end
  16. Because it needs this: exports.scoreboard:addScoreboardColumn("Playtime", getRootElement(), 11, 48) I just gave you an example script which saves playtime to player account. You'll need to add the following in the script to put a scoreboard column: function onResStart() exports.scoreboard:addScoreboardColumn("Playtime", root, 11, 48) end addEventHandler("onResourceStart", root, onResStart) And then set the content of the newly created column with local playtime_string = string.format("%d:%02d:%02d", hours, minutes, seconds) if playtime_string then setElementData(player, "Playtime", playtime_string) end at the end of the "actualizarJugadorOn" function.
  17. Anyway, the script I gave doesn't save playtime to account, sorry didn't scroll down to see the rest of your script This saves to account and you can do a simple 'if' check to get the hours, minutes, seconds and do what you want in that 'if' block. ---Playtime Account Saving addEventHandler("onResourceStart" , resourceRoot , function() for index , player in ipairs(getElementsByType("player")) do local pAccount = getPlayerAccount ( player ) if not isGuestAccount(pAccount) then local seconds = getAccountData(pAccount , "seconds") local minutes = getAccountData(pAccount , "minutes") if minutes and seconds then local hours = getAccountData(pAccount , "hours") if # tostring(minutes) == 1 then minutes = "0" .. minutes end if # tostring(seconds) == 1 then seconds = "0" .. seconds end local timer = setTimer(actualizarJugadorOn , 1000 , 1 , player) setElementData(player , "Online.timer" , timer) else setAccountData(pAccount , "seconds" , 0) setAccountData(pAccount , "minutes" , 0) setAccountData(pAccount , "hours" , 0) local timer = setTimer(actualizarJugadorOn , 1000 , 1 , player) setElementData(player , "Online.timer" , timer) end end end end ) addEventHandler("onResourceStop" , resourceRoot , function() for index , player in ipairs(getElementsByType("player")) do local pAccount = getPlayerAccount(player) if not isGuestAccount(pAccount) then local timer = getElementData(player , "Online.timer") if isTimer(timer) then killTimer(timer) end end end end ) addEventHandler("onPlayerLogin" , root , function(_ , pAccount) local seconds = getAccountData(pAccount , "seconds") local minutes = getAccountData(pAccount , "minutes") if minutes and seconds then local hours = getAccountData(pAccount , "hours") if # tostring(minutes) == 1 then minutes = "0" .. minutes end if # tostring(seconds) == 1 then seconds = "0" .. seconds end local timer = setTimer(actualizarJugadorOn , 1000 , 1 , source) setElementData(source , "Online.timer" , timer) else setAccountData(pAccount , "seconds" , 0) setAccountData(pAccount , "minutes" , 0) setAccountData(pAccount , "hours" , 0) local timer = setTimer(actualizarJugadorOn , 1000 , 1 , source) setElementData (source , "Online.timer" , timer) end end ) addEventHandler("onPlayerLogout" , root , function(pAccount) local timer = getElementData(source , "Online.timer") if isTimer(timer) then killTimer(timer) end end ) addEventHandler("onPlayerQuit" , root , function() local pAccount = getPlayerAccount(source) if not isGuestAccount(pAccount) then local timer = getElementData(source , "Online.timer") if isTimer(timer) then killTimer(timer) end end end ) function actualizarJugadorOn(player) local pAccount = getPlayerAccount(player) local seconds = getAccountData(pAccount , "seconds") local minutes = getAccountData(pAccount , "minutes") local hours = getAccountData(pAccount , "hours") seconds = tostring(tonumber(seconds)+1) if seconds == "60" then minutes = tostring(tonumber(minutes)+1) seconds = "00" end if minutes == "60" then hours = tostring(tonumber(hours )+1) minutes = "00" end setAccountData(pAccount , "seconds" , tonumber(seconds)) setAccountData(pAccount , "minutes" , tonumber(minutes)) setAccountData(pAccount , "hours" , tonumber(hours)) if # tostring(minutes) == 1 then minutes = "0" .. minutes end if # tostring(seconds) == 1 then seconds = "0" .. seconds end local timer = setTimer(actualizarJugadorOn , 1000 , 1 , player) setElementData(player , "Online.timer" , timer) end
  18. do exports.scoreboard:addScoreboardColumn("Játszott idő", getRootElement(), 11, 48) end ------------------------------------------------------------------------------------------------------------------------- local t = {} function check_playtime() for i,player in pairs(getElementsByType("player")) do if not t[player] then t[player] = {["hour"] = 0,["min"] = 0,["sec"] = 0} end local seconds = t[player]['sec'] or 0 local minutes = t[player]['min'] or 0 local hours = t[player]['hour'] or 0 do seconds = seconds + 1 if seconds >= 60 then seconds = 0 minutes = minutes + 1 end if minutes >= 60 then minutes = 0 hours = hours + 1 end end t[player]['sec'] = seconds t[player]['min'] = minutes t[player]['hour'] = hours local playtime_string = string.format("%d:%02d:%02d", hours, minutes, seconds) if playtime_string then setElementData(player, "Játszott idő", playtime_string) end if minutes == 30 then outputChatBox("You've played for 30 mins.", player, 255, 255, 255, true) end end end setTimer(check_playtime, 1000, 0)
  19. OK, fixed it by using element data logic. Works like a charm now, and yes I used the player's position to see if he's inside the closest spawnpoint. ----------------- --- Spawns --- ----------------- local spawnIndex = {} local allSpawnpoints = {} ------------------------------------------------------------------------------------------------------------------------ function mapRestart(mapInfo, mapOptions, gameOptions) previousSpawn = {} spawnIndex = {} lshift, rshift = {}, {} allSpawnpoints = getElementsByType("spawnpoint", getResourceRootElement(exports.mapmanager:getRunningGamemodeMap())) if #getElementsByType("checkpoint") > 0 then table.sort(allSpawnpoints, function (spawnA, spawnB) local a_x, a_y, a_z, a_id = getSpawnpointPosition ( spawnA ) local b_x, b_y, b_z, b_id = getSpawnpointPosition ( spawnB ) local c_x, c_y, c_z = getElementPosition(getElementsByType("checkpoint")[1]) return getDistanceBetweenPoints3D( a_x, a_y, a_z, c_x, c_y, c_z) < getDistanceBetweenPoints3D( b_x, b_y, b_z, c_x, c_y, c_z) end) end if #allSpawnpoints == 0 then return false end for k,v in ipairs(getElementsByType("player")) do setElementData(v, "hasBoughtSpawn", false) setElementData(v, "seenShiftCmd", false) setElementData(v, "pressed3", false) setElementData(v, "seenClosestMsg", false) end end addEventHandler("onMapStarting", root, mapRestart) ------------------------------------------------------------------------------------------------------------------------ function callSpawn(player) local spawnPrice = 7 local playeraccount = getPlayerAccount(player) local res = getResourceFromName("cw") if getResourceState(res) == "running" then return end local account = getPlayerAccount(player) if isGuestAccount(account) then outputChatBox("You need to register and login in order to buy spawnpoints!", player, 255, 153, 0, true) return end if #allSpawnpoints == 1 then outputChatBox("This map contains only one spawnpoint.", player, 255, 153, 0, true) return end if #allSpawnpoints == 0 then return false end local elementID local cash = tonumber(getAccountData(account, "knightcoins") or 0) if cash < spawnPrice or not cash then outputChatBox ( "You don't have enough KnightCoins to buy a spawn.", player, 255, 153, 0) return end local xx, yy, zz = getElementPosition(getPedOccupiedVehicle(player)) if getElementData(player, "isOnSpawn") and getElementData(player, "isOnSpawn") == true then if not spawnIndex[player] or getPedOccupiedVehicle(player) then elementID, distance, index, rot = changeSpawn(player) end local sx, sy, sz = getElementPosition(getPedOccupiedVehicle(player)) if round(sx) == round(xx) and round(sy) == round(yy) and round(sz) == round(zz) then if getElementData(player, "pressed3") == false then outputChatBox("You're already in the closest to the first checkpoint spawnpoint.", player, 255, 153, 0) setElementData(player, "seenClosestMsg", true) end end if getElementData(player, "seenClosestMsg") == true then setElementData(player, "seenClosestMsg", false) return end if getElementData(player, "seenShiftCmd") == false and getElementData(player, "seenClosestMsg") == false then outputChatBox("Use shift+3 to go back to a previous spawnpoint", player, 0, 255, 255) setElementData(player, "seenShiftCmd", true) end local model = getElementModel(getPedOccupiedVehicle(player)) local rotation = rot if elementID and getElementData(player, "seenClosestMsg") == false then outputChatBox("Changed to spawnpoint: "..tostring(index).." / "..round(distance).." m / vehicle: "..tostring(getVehicleNameFromModel(model)).." ("..model..") / rotation: "..round(tonumber(rotation)), player, 0, 255, 255) end if getElementData(player, "hasBoughtSpawn") == true then return end local cash = tonumber(getAccountData(account, "knightcoins") or 0) if cash >= spawnPrice and getElementData(player, "seenClosestMsg") == false then local newCash = cash - spawnPrice setAccountData(account, "knightcoins", newCash) setElementData(player ,"data.knightcoins", newCash, true) triggerClientEvent(player, "addNotification", root, "#FF0000-"..spawnPrice.." #00FFFFKnightCoins #00FF00("..comma_value(newCash)..")", 2) local oldMoneySpentData = getAccountData(playeraccount, "moneySpent") or 0 local newMoneySpentData = oldMoneySpentData + spawnPrice setAccountData(playeraccount, "moneySpent", newMoneySpentData) setElementData(player, "moneySpent", newMoneySpentData) end else setElementData(player, "hasBoughtSpawn", false) end setElementData(player, "hasBoughtSpawn", true) end ------------------------------------------------------------------------------------------------------------------------ function changeSpawn(player) if not spawnIndex[player] then spawnIndex[player] = 1 else spawnIndex[player] = spawnIndex[player] + (getShiftState(player) and -1 or 1) end if spawnIndex[player] > #allSpawnpoints then spawnIndex[player] = 1 elseif spawnIndex[player] < 1 then spawnIndex[player] = #allSpawnpoints end local newSpawnpoint = allSpawnpoints[spawnIndex[player]] local veh = getPedOccupiedVehicle(player) if not veh then return end local x, y, z, id, vehID, rot = getSpawnpointPosition(newSpawnpoint) setElementPosition(veh, x,y,z) setElementRotation(veh, 0,0, rot) setElementModel(veh, vehID) setElementHealth(veh, 1000) local distance = getElementsByType("checkpoint")[1] and math.floor(100*getDistanceBetweenPoints3D(x,y,z,getElementPosition(getElementsByType("checkpoint")[1])))/100 or 0 return id, distance, spawnIndex[player], rot end ------------------------------------------------------------------------------------------------------------------------ function getSpawnpointPosition(element) local x = tonumber(getElementData(element, 'posX')) local y = tonumber(getElementData(element, 'posY')) local z = tonumber(getElementData(element, 'posZ')) local id = getElementID(element) local vehID = tonumber(getElementData(element, 'vehicle')) local rot = tonumber(getElementData(element, 'rotation') or getElementData(element, 'rotZ')) return x, y, z, id, vehID, rot end --------------------------- --- Shift detection --- --------------------------- local lshift, rshift = {}, {} function shift(player, key, state) if key == "lshift" then lshift[player] = state == "down" and true or nil elseif key == "rshift" then rshift[player] = state == "down" and true or nil end end ------------------------------------------------------------------------------------------------------------------------ function onResStart() for k,v in ipairs(getElementsByType("player")) do bindKey(v, "lshift", "both", shift) bindKey(v, "rshift", "both", shift) bindKey(v, "3", "down", callSpawn) end end addEventHandler("onResourseStart", resourceRoot, onResStart) ------------------------------------------------------------------------------------------------------------------------ function onPlayerJoin() bindKey(source, "lshift", "both", shift) bindKey(source, "rshift", "both", shift) bindKey(source, "3", "down", callSpawn) end addEventHandler("onPlayerJoin", root, onPlayerJoin) ------------------------------------------------------------------------------------------------------------------------ function onPlayerQuit() lshift[source] = nil rshift[source] = nil end addEventHandler("onPlayerQuit", root, onPlayerQuit) ------------------------------------------------------------------------------------------------------------------------ function getShiftState(player) return lshift[player] or rshift[player] end ------------------------------------------------------------------------------------------------------------------------ --http://lua-users.org/wiki/FormattingNumbers function round(val, decimal) if (decimal) then return math.floor( (val * 10^decimal) + 0.5) / (10^decimal) else return math.floor(val+0.5) end end ------------------------------------------------------------------------------------------------------------------------ --http://lua-users.org/wiki/FormattingNumbers function comma_value(amount) local formatted = amount while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') if (k==0) then break end end return formatted end ------------------------------------------------------------------------------------------------------------------------ function getAll(name) local result = {} for i,element in ipairs(getElementsByType(name)) do result[i] = {} result[i].id = getElementID(element) or i local position = { tonumber(getElementData(element,"posX")), tonumber(getElementData(element,"posY")), tonumber(getElementData(element,"posZ")) } result[i].position = position; end return result end
  20. Well imo the script i posted above should work ok since the one I tested it on is made the same way (fonts declared globally = when the resource starts). If not, i got no idea why
  21. I just tried using this^ resource to change a font in my race lap counter text and it worked perfectly..hmm. There were no errors at all and everything was fine, text drawn, font changed. Your function "CarshopMenu.start" is not called anywhere? Atleast I don't see it being called anywhere. Try this (declared fonts as global variables at top of script {lines 20 and 21}) and see if it works as there's no problem with the dpAssets resource since I just tried it and it worked great for me. CarshopMenu = {} local renderTarget local MENU_OFFSET = Vector3(-7.5, -7, -0.7) local position = Vector3() local size = Vector2(1.5, 1.9) local rotation = 280 local resolution = size * 250 local headerHeight = 70 local barOffset = 20 local barHeight = 20 local labelHeight = 50 local barsList = { {locale = "carshop_label_speed", value = 0.7, param = "speed"}, {locale = "carshop_label_acceleration", value = 0.4, param = "acceleration"}, {locale = "carshop_label_control", value = 0.85, param = "control"} } local headerFont = exports.dpAssets:createFont("Roboto-Regular.ttf", 20) local labelFont = exports.dpAssets:createFont("Roboto-Regular.ttf", 18) local hasDriftHandling = false local themeColor = {0, 0, 0} local themeColorHex = "#FFFFFF" local function draw() dxSetRenderTarget(renderTarget) dxDrawRectangle(0, 0, resolution.x, resolution.y, tocolor(42, 40, 41)) dxDrawRectangle(0, 0, resolution.x, headerHeight, tocolor(32, 30, 31)) local priceText = "" if Carshop.currentVehicleInfo.price > 0 then priceText = "$" .. tostring(Carshop.currentVehicleInfo.price) else priceText = exports.dpLang:getString("price_free") end dxDrawText(priceText, 0, 0, resolution.x - 20, headerHeight, tocolor(themeColor[1], themeColor[2], themeColor[3]), 1, labelFont, "right", "center") local priceWidth = dxGetTextWidth(priceText, 1, labelFont) local headerText = Carshop.currentVehicleInfo.name local hearderWidth = dxGetTextWidth(headerText, 1, headerFont) local hearderScale = false if priceWidth then hearderScale = math.min(1, (resolution.x - 60 - priceWidth) / hearderWidth) dxDrawText(headerText, 20, 0, resolution.x - 20 - priceWidth, headerHeight, tocolor(255, 255, 255), hearderScale, headerFont, "left", "center", true) end local buyButtonActive = true local buyButtonText = exports.dpLang:getString("carshop_buy_button") if Carshop.currentVehicleInfo.level > localPlayer:getData("level") then buyButtonActive = false --"Требуется уровень " .. buyButtonText = string.format(exports.dpLang:getString("carshop_required_level"), tostring(Carshop.currentVehicleInfo.level)) elseif Carshop.currentVehicleInfo.price > localPlayer:getData("money") then buyButtonActive = false buyButtonText = exports.dpLang:getString("carshop_no_money") end if not buyButtonActive then dxDrawRectangle(0, resolution.y - headerHeight, resolution.x, headerHeight, tocolor(32, 30, 31)) dxDrawText(buyButtonText, 20, resolution.y - headerHeight, resolution.x, resolution.y, tocolor(255, 255, 255, 150), 1, headerFont, "center", "center") else dxDrawRectangle(0, resolution.y - headerHeight, resolution.x, headerHeight, tocolor(themeColor[1], themeColor[2], themeColor[3])) dxDrawText(buyButtonText, 20, resolution.y - headerHeight, resolution.x, resolution.y, tocolor(255, 255, 255), 1, headerFont, "center", "center") end local y = headerHeight local barWidth = resolution.x - barOffset * 2 for i, bar in ipairs(barsList) do -- Подпись dxDrawText(bar.text, 0, y, resolution.x, y + labelHeight, tocolor(255, 255, 255), 1, labelFont, "center", "center") y = y + labelHeight dxDrawRectangle(barOffset, y, barWidth, barHeight, tocolor(65, 65, 65)) dxDrawRectangle(barOffset, y, barWidth * bar.value, barHeight, tocolor(themeColor[1], themeColor[2], themeColor[3])) bar.value = bar.value + (Carshop.currentVehicleInfo.specs[bar.param] - bar.value) * 0.2 y = y + barHeight * 2 end local labelText = exports.dpLang:getString("carshop_drift_label") local valueText = "" if Carshop.hasDriftHandling then valueText = exports.dpLang:getString("carshop_drift_label_yes") else valueText = exports.dpLang:getString("carshop_drift_label_no") end dxDrawText(labelText .. ": " .. themeColorHex .. valueText, 0, y, resolution.x, y + labelHeight, tocolor(255, 255, 255), 1, labelFont, "center", "center", false, false, false, true) dxSetRenderTarget() local halfHeight = Vector3(0, 0, size.y / 2) local rad = math.rad(rotation) local lookOffset = Vector3(math.cos(rad), math.sin(rad), 0) dxDrawMaterialLine3D( position + halfHeight, position - halfHeight, renderTarget, size.x, tocolor(255, 255, 255, 250), position + lookOffset ) end function CarshopMenu.start(basePosition) position = MENU_OFFSET + basePosition renderTarget = dxCreateRenderTarget(resolution.x, resolution.y, false) themeColor = {exports.dpUI:getThemeColor()} themeColorHex = tostring(exports.dpUtils:RGBToHex(unpack(themeColor))) for i, bar in ipairs(barsList) do bar.text = exports.dpLang:getString(bar.locale) end addEventHandler("onClientRender", root, draw) end function CarshopMenu.stop() if isElement(renderTarget) then destroyElement(renderTarget) end if isElement(headerFont) then destroyElement(headerFont) end if isElement(labelFont) then destroyElement(labelFont) end removeEventHandler("onClientRender", root, draw) end
  22. I meant to give download link to the dpAssets resource
  23. function createFont(name, size) local element = dxCreateFont(ASSETS_PATH .. FONTS_PATH .. tostring(name), tonumber(size)) setupElementParent(element, sourceResource) return element end Maybe it thinks that the size passed is a string? Replace the function in exports.la with the above and try. I made the second argument passed to always be a number (since that's what dxCreateFont wants). If not, give link to the fonts resource as I can't find it.
  24. I feel awkward that this is the first time I even hear about some functions in this post And I'm not new to MTA or LUA heh
×
×
  • Create New...