Jump to content

Search the Community

Showing results for tags 'dxdraw'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 24 results

  1. Hello, I want to know how can I put on the same bar normal health and extra health, normal health is 100 but extra health increase constantly by levels, how can i adapt a bar for both health? that looks full and adapts to the extra health
  2. Welcome back In general, I'm currently making a scoreboard under Tab with a list of players, so I have a few questions... 1. How to make a list that shows elements that are outside the image under the scroll, e.g. when scrolling html or guiCreateGridList function but with more elements than its scale offers (Using dxDraw family functions) 2. Or is there a possibility to blur something like placing a gradient so that some dxDraw elements line up in a shape other than a square or rectangle. If you still don't know what I mean, here's an example of what I want to do: I have a plan how the list of players (scoreboard TAB) will look like after pressing the [TAB] key and in general, if there are too many of these players, it is known that 1920x1080x monitor screen will not accommodate, for example, 400 players in the index so that it is visible, so you will need to add some scrolling system and here is my problem because I've never done anything like that and I don't know if it's possible to create a dxDraw function that simulates a guiGridList or add a gradient that will freeze most of the list so that it is visible for the computer screen, but not for us. Please give me an example with a detailed explanation
  3. Olá amigos sou novo na progamação para MTA porem ja evolui bastante mas uma coisa que ainda me pega é o client, eu gostaria de saber como eu poderia fazer um retangulo com bordas arredondadas usando DX
  4. How to set dxDraw to the back of the screen?
  5. Xwaw

    GuiEditor IMAGE

    I just want to know how you can import images into this "dxDrawImage" GUIEDITOR
  6. Bom dia! Tô com esse problema de não aparecer os escritos dos layouts, estava fazendo testes e encontrei algo sobre "DxCreateFont" ao tentar criar a fonte, e o meu pode estar dando falhas e por isso algumas DX não aparecem... Alguém já passou por isso? Este problema é em todos servidores que tento jogar e tenha que baixa/criar alguma fonte! (o que eu notei) Segundo a wiki, diz que pode ser problema de alguma limitação de hardware ou memoria. Quando um servidor utiliza DxCreateFont para criar uma nova fonte em um painel, e acaba que o PC não carrega essa fonte, e por este motivo acaba não aparecendo dxDrawText que utilizam esta nova fonte, porquê da erro ao carregar... Alguma solução pra isso? https://ibb.co/qmrGvQB https://ibb.co/2q7BBPM
  7. How to remove dxDrawWindow with, removeEventHandler?, I would like to turn on the window several times.
  8. I want to render a rectangle to the cursor, but the rectangle too far from the cursor.. How to fix this in my code? code: local sx_, sy_ = 1920, 1080 local sx__, sy__ = guiGetScreenSize() local xm, ym = sx__/sx_, sy__/sy_ function render() local screenx, screeny = getCursorPosition() dxDrawRectangle((sx_-687) * xm * screenx, (sy_/2+70) * ym * screeny, 170 * xm, 25 * ym,tocolor(255,181,64,80)) end addEventHandler("onClientRender",root,render) the problem:
  9. Eu Queria Saber Como Eu Coloco Dx Com Teleporte Tipo, Quando Eu Dou O Comando Do Teleporte Exemplo "/praia" Ai Apareçe o Jogador Foi Para Praia Mais Eu Queria Que Essa Msg Aparecia No Topo Da Tela Junto Com O Dx. Eu Sou Bom Em Scripter Mais Com Dx Nao Sou Bom Entao Ta Ai Me Ajudem Por Favor Teleportes: local posicoes = { { 350.177, -1763.144, 5.283 }, } function PosicaoPlayer ( thePlayer, command ) local azar = math.random ( #posicoes ) local veh = getPedOccupiedVehicle(thePlayer) if (veh) then setElementPosition(veh, unpack ( posicoes [ azar ] ) ) else setElementPosition(thePlayer, unpack ( posicoes [ azar ] ) ) end outputChatBox ('#ffffff[ #00ff00INFO #ffffff]#ffffff: O Jogador(a) ' .. getPlayerName(thePlayer) .. ' #ffffffFoi Para [/#00ff00praia#ffffff]', root, 255, 255, 255, true) end addCommandHandler ( "praia", PosicaoPlayer ) local posicoes = { { 2465.643, -1670.133, 13.477 }, } function PosicaoPlayer ( thePlayer, command ) local azar = math.random ( #posicoes ) local veh = getPedOccupiedVehicle(thePlayer) if (veh) then setElementPosition(veh, unpack ( posicoes [ azar ] ) ) else setElementPosition(thePlayer, unpack ( posicoes [ azar ] ) ) end outputChatBox ('#ffffff[ #00ff00INFO #ffffff]#ffffff: O Jogador(a) ' .. getPlayerName(thePlayer) .. ' #ffffffFoi Para [/#00ff00cj#ffffff]', root, 255, 255, 255, true) end addCommandHandler ( "cj", PosicaoPlayer ) local posicoes = { { 2172.055, -1015.773, 62.972 }, } function PosicaoPlayer ( thePlayer, command ) local azar = math.random ( #posicoes ) local veh = getPedOccupiedVehicle(thePlayer) if (veh) then setElementPosition(veh, unpack ( posicoes [ azar ] ) ) else setElementPosition(thePlayer, unpack ( posicoes [ azar ] ) ) end outputChatBox ('#ffffff[ #00ff00INFO #ffffff]#ffffff: O Jogador(a) ' .. getPlayerName(thePlayer) .. ' #ffffffFoi Para [/#00ff00favela#ffffff]', root, 255, 255, 255, true) end addCommandHandler ( "favela", PosicaoPlayer ) local posicoes = { { 1914.546, -2415.094, 13.539 }, } function PosicaoPlayer ( thePlayer, command ) local azar = math.random ( #posicoes ) local veh = getPedOccupiedVehicle(thePlayer) if (veh) then setElementPosition(veh, unpack ( posicoes [ azar ] ) ) else setElementPosition(thePlayer, unpack ( posicoes [ azar ] ) ) end outputChatBox ('#ffffff[ #00ff00INFO #ffffff]#ffffff: O Jogador(a) ' .. getPlayerName(thePlayer) .. ' #ffffffFoi Para O AeroPorto De [/#00ff00ls#ffffff]', root, 255, 255, 255, true) end addCommandHandler ( "ls", PosicaoPlayer ) local posicoes = { { -2334.966, -1658.198, 483.703 }, } function PosicaoPlayer ( thePlayer, command ) local azar = math.random ( #posicoes ) local veh = getPedOccupiedVehicle(thePlayer) if (veh) then setElementPosition(veh, unpack ( posicoes [ azar ] ) ) else setElementPosition(thePlayer, unpack ( posicoes [ azar ] ) ) end outputChatBox ('#ffffff[ #00ff00INFO #ffffff]#ffffff: O Jogador(a) ' .. getPlayerName(thePlayer) .. ' #ffffffFoi Para O [/#00ff00mt#ffffff]', root, 255, 255, 255, true) end addCommandHandler ( "mt", PosicaoPlayer )
  10. I can not make a DxText that displays the player's account name in screen My code (CLIENT SIDE) CHECK LINE 109 I wanted it to work this way: no one debugscript error example image
  11. Как сделать окно, которая будет похожая на браузер, тобишь справа полоса прокрутки, и внутри другие элементы которые будут двигаться используя колесо мыши или полосой прокрутки? Есть какой-нибудь туториал по этому?
  12. Hello, want to make a inventory system. What is better CEF or dxDraw? Say CEF slow performance, but faster development.
  13. Hello everyone! I started to learn render targets in lua. So the question is: Can i use dxDraw functions on vehicles? I think i should apply a shaders to use it. Some people use texreplace.fx for drawing. As i know, this people create a render target, draw some stuff on it, get pixel colours and apply a texture on the vehicle with shaders. Is there any other ways? Maybe i can draw text/images directly on vehicle texture (i added special texture to car called "bodytex" for this action) somehow\\\ Applying shaders each time reflects on perfomance a lot
  14. Hy! I would like to make a dxDraw indicator that shows stamina. I wanted to make a picture, that fills up to a certain level based on a value, so I tried using dxDrawImageSection and RenderTarget too, but I couldn't make it. It is important that I want it to be relative, so like I have a 200x200 size picture that I draw in 80x80, or in 50x50 and so on based on the user's resolution. Could someone help me in this?
  15. local start = getTickCount() local one, one1 = -300, 604 local two, two1 = 0, 604 local screenW, screenH = guiGetScreenSize() local text = "" local pic = "j" function draw() local x,y = interpolateBetween(one, one1, 0, two, two1, 0, (now - start) / ((start + 1500) - start), "Linear") local now = getTickCount() dxDrawRectangle(x,y, screenW * 0.2306, screenH * 0.0356, tocolor(0, 0, 0, 130), false) dxDrawText(" * "..text, x, y, screenW * 0.2340, screenH * 0.7044, tocolor(255, 255, 255, 255), 1.00, "default", "left", "center", false, false, false, true, false) end addEventHandler("onClientPlayerChangeNick", root, function(oldName, newName) addEventHandler("onClientRender", root,draw) text = string.format("#%02X%02X%02X", getPlayerNametagColor(source)) .. oldName .. " #FFffFFneve mostantól " .. string.format("#%02X%02X%02X", getPlayerNametagColor(source)) .. newName .. "" pic = "c" setTimer ( function() removeEventHandler("onClientRender", root, draw) end, 5000, 1 ) end ) this is my code. the dx things are working, just the animation does not working how to fix? sorry for my very bad english :C
  16. Hola buenas a todos, por favor me podrían ayudar con un problema que tengo con un script, es el de banderas en el scoreboard, y es cierto que está en la comunidad, pero al momento de ejecutar no aparece la bandera solo el nonbre del país, de antemano muchas gracias... aquí el script... -- ScoreBoard Country Script by ToXiiC -- Skype: toxiic_eu countryNames = { ["IT"]="Italy", ["MX"]="Mexico", ["SA"]="SAUDI ARBIA", ["PK"]="Pakistan", ["AF"]="Afghanistan", ["DZ"]="Algeria", ["AS"]="American samoa", ["AU"]="Australlia", ["AO"]="Anqola", ["AI"]="Anquilla", ["AQ"]="Antarctica", ["AG"]="Antigua and Barbuda", ["AR"]="Argentina", ["AM"]="Armenia", ["AW"]="Aruba", ["AT"]="Austria", ["AZ"]="Azerbaijan", ["BS"]="Bahamas", ["BH"]="Bahrain", ["BD"]="Bangladesh", ["BB"]="Barbados", ["BY"]="Belarus", ["BE"]="Belgium", ["BZ"]="Belize", ["BJ"]="Benin", ["BM"]="Bermuda", ["BT"]="Bhutan", ["BO"]="Bolivia", ["BA"]="Bosnia", ["BH"]="Herzegovina", ["BW"]="Botswana", ["BR"]="Brazil", ["IO"]="British Indian Ocean Territory", ["VG"]="British Virgin Islands", ["BN"]="Brunei", ["BG"]="Bulgaria", ["BF"]="Burkina Faso", ["MM"]="Burma (Myanmar)", ["BI"]="Burundi", ["KH"]="Cambodia", ["CM"]="Cameroon", ["CA"]="Canada", ["CV"]="Cape Verde", ["KY"]="Cayman Islands", ["CF"]="Central African Republic", ["TD"]="Chad", ["CL"]="Chile", ["CN"]="China", ["CX"]="Christmas Island", ["CC"]="Cocos (Keeling) Islands", ["CO"]="Colombia", ["KM"]="Comoros", ["CK"]="Cook Islands", ["CR"]="Costa Rica", ["HR"]="Croatia", ["CU"]="Cuba", ["CY"]="Cyprus", ["CZ"]="Czech Republic", ["CD"]="Democratic Republic of the Congo", ["DK"]="Denmark", ["DJ"]="Djibouti", ["DM"]="Dominica", ["DO"]="Dominican Republic", ["EC"]="Ecuador", ["SV"]="El Salvador", ["GQ"]="Equatorial Guinea", ["ER"]="Eritrea", ["EE"]="Estonia", ["ET"]="Ethiopia", ["FK"]="Falkland Islands", ["FO"]="Faroe Islands", ["FJ"]="Fiji", ["FI"]="Finland", ["FR"]="France", ["PF"]="French Polynesia", ["GA"]="Gabon", ["GM"]="Gambia", ["GE"]="Georgia", ["DE"]="Germany", ["GH"]="Ghana", ["GI"]="Gibraltar", ["GR"]="Greece", ["GL"]="Greenland", ["GD"]="Grenada", ["GU"]="Guam", ["GT"]="Guatemala", ["GN"]="Guinea", ["GW"]="Guinea-Bissau", ["GY"]="Guyana", ["HT"]="Haiti", ["VA"]="Holy See (Vatican City)", ["HN"]="Honduras", ["HK"]="Hong Kong", ["HU"]="Hungary", ["IS"]="Iceland", ["IN"]="India", ["ID"]="Indonesia", ["IR"]="Iran", ["IQ"]="Iraq", ["IE"]="Ireland", ["IM"]="Isle of Man", ["IL"]="Israel", ["IT"]="Italy", ["CI"]="Ivory Coast", ["JM"]="Jamaica", ["JP"]="Japan", ["JE"]="Jersey", ["JO"]="Jordan", ["KZ"]="Kazakhstan", ["KE"]="Kenya", ["KI"]="Kiribati", ["KO"]="Kosovo", ["KW"]="Kuwait", ["KG"]="Kyrgyzstan", ["LA"]="Laos", ["LV"]="Latvia", ["LB"]="Lebanon", ["LS"]="Lesotho", ["LR"]="Liberia", ["LY"]="Libya", ["LI"]="Liechtenstein", ["LT"]="Lithuania", ["LU"]="Luxembourg", ["MO"]="Macau", ["MK"]="Macedonia", ["MG"]="Madagascar", ["MW"]="Malawi", ["MY"]="Malaysia", ["MV"]="Maldives", ["ML"]="Mali", ["MT"]="Malta", ["MH"]="Marshall Islands", ["MR"]="Mauritania", ["MU"]="Mauritius", ["YT"]="Mayotte", ["MX"]="Mexico", ["FM"]="Micronesia", ["MD"]="Moldova", ["MC"]="Monaco", ["MN"]="Mongolia", ["ME"]="Montenegro", ["MS"]="Montserrat", ["MA"]="Morocco", ["MZ"]="Mozambique", ["NA"]="Namibia", ["NR"]="Nauru", ["NP"]="Nepal", ["NL"]="Netherlands", ["AN"]="Netherlands Antilles", ["NC"]="New Caledonia", ["NZ"]="New Zealand", ["NI"]="Nicaragua", ["NE"]="Niger", ["NG"]="Nigeria", ["NU"]="Niue", ["NI"]="Norfolk Island", ["KP"]="North Korea", ["MP"]="Northern Mariana Islands", ["NO"]="Norway", ["OM"]="Oman", ["PK"]="Pakistan", ["PW"]="Palau", ["PA"]="Panama", ["PG"]="Papua New Guinea", ["PY"]="Paraguay", ["PE"]="Peru", ["PH"]="Philippines", ["PN"]="Pitcairn Islands", ["PL"]="Poland", ["PT"]="Portugal", ["PR"]="Puerto Rico", ["QA"]="Qatar", ["CG"]="Republic of the Congo", ["RO"]="Romania", ["RU"]="Russia", ["RW"]="Rwanda", ["BL"]="Saint Barthelemy", ["SH"]="Saint Helena", ["KN"]="Saint Kitts and Nevis", ["LC"]="Saint Lucia", ["MF"]="Saint Martin", ["PM"]="Saint Pierre and Miquelon", ["VC"]="Saint Vincent and the Grenadines", ["WS"]="Samoa", ["SM"]="San Marino", ["ST"]="Sao Tome and Principe", ["SA"]="Saudi Arabia", ["SN"]="Senegal", ["RS"]="Serbia", ["SC"]="Seychelles", ["SL"]="Sierra Leone", ["SG"]="Singapore", ["SK"]="Slovakia", ["SI"]="Slovenia", ["SB"]="Solomon Islands", ["SO"]="Somalia", ["ZA"]="South Africa", ["KR"]="South Korea", ["ES"]="Spain", ["LK"]="Sri Lanka", ["SD"]="Sudan", ["SR"]="Suriname", ["SJ"]="Svalbard", ["SZ"]="Swaziland", ["SE"]="Sweden", ["CH"]="Switzerland", ["SY"]="Syria", ["TW"]="Taiwan", ["TJ"]="Tajikistan", ["TZ"]="Tanzania", ["TH"]="Thailand", ["TL"]="Timor-Leste", ["TG"]="Togo", ["TK"]="Tokelau", ["TO"]="Tonga", ["TT"]="Trinidad and Tobago", ["TN"]="Tunisia", ["TR"]="Turkey", ["TM"]="Turkmenistan", ["TC"]="Turks and Caicos Islands", ["TV"]="Tuvalu", ["UG"]="Uganda", ["UA"]="Ukraine", ["AE"]="United Arab Emirates", ["GB"]="United Kingdom", ["US"]="United States", ["UY"]="Uruguay", ["VI"]="US Virgin Islands", ["UZ"]="Uzbekistan", ["VU"]="Vanuatu", ["VE"]="Venezuela", ["VN"]="Vietnam", ["WF"]="Wallis and Futuna", ["WB"]="West Bank", ["EH"]="Western Sahara", ["YE"]="Yemen", ["ZM"]="Zambia", ["ZW"]="Zimbabwe" } function OnResourceStart() call(getResourceFromName("scoreboard"),"addScoreboardColumn","Country", getRootElement(), 10, 150) call(getResourceFromName("scoreboard"),"addScoreboardColumn"," flag", getRootElement(), 9, 16) local tPlayers = getElementsByType('player') for _,uPlayer in ipairs(tPlayers) do local countryCode = exports["admin"]:getPlayerCountry(uPlayer) local name = "Unknown" if countryCode and countryNames[countryCode] then name = countryNames[countryCode] local sFlagImagePath = ':'..getResourceName( getThisResource() )..'/flags/'..string.lower(countryCode)..'.png' if fileExists(sFlagImagePath) then setElementData(uPlayer, "countryFlagImage", sFlagImagePath ) else setElementData(uPlayer, "countryFlagImage", "??" ) end end setElementData(uPlayer, "Country", name ) end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), OnResourceStart) function OnPlayerJoin () local countryCode = exports["admin"]:getPlayerCountry(source) local name = "Unknown" if countryCode and countryNames[countryCode] then name = countryNames[countryCode] local sFlagImagePath = ':'..getResourceName( getThisResource() )..'/flags/'..string.lower(countryCode)..'.png' if fileExists(sFlagImagePath) then setElementData( source, "countryFlagImage", sFlagImagePath ) else setElementData( source, "countryFlagImage", "??" ) end end setElementData(source, "Country", name) outputChatBox("#00a8ff* [Join] #00a8ff" .. getPlayerName(source) .. "#00a8ff has joined the game from: #ECECEC" .. name, getRootElement(), 151, 151, 151, true) end addEventHandler("onPlayerJoin", getRootElement(), OnPlayerJoin)
  17. itHyperoX

    HUD

    Hi. I'm trying to make a nice DXDRAW hud. I'm using the "guieditor" resource for that. The problem is, when i make the hud at 1600x900 res, its looks nice, but when i change my resoultion to 1920x1080, the hud is looks like blured out. Anybody can help me please with this? here is 1600x900 here is at 1920x1080p here is the script. (THIS IS ONLY because of testing. --————————————————————————————————————————————————————————— --————————————————————————————————————————————————————————— local screenW,screenH = guiGetScreenSize() function HUD () dxDrawLine((screenW * 0.5994) - 1, (screenH * 0.5456) - 1, (screenW * 0.5994) - 1, screenH * 0.7111, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(screenW * 0.7481, (screenH * 0.5456) - 1, (screenW * 0.5994) - 1, (screenH * 0.5456) - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine((screenW * 0.5994) - 1, screenH * 0.7111, screenW * 0.7481, screenH * 0.7111, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(screenW * 0.7481, screenH * 0.7111, screenW * 0.7481, (screenH * 0.5456) - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(screenW * 0.5994, screenH * 0.5456, screenW * 0.1487, screenH * 0.1656, tocolor(0, 0, 0, 100), false) dxDrawLine((screenW * 0.5994) - 1, (screenH * 0.5456) - 1, (screenW * 0.5994) - 1, screenH * 0.5733, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(screenW * 0.7481, (screenH * 0.5456) - 1, (screenW * 0.5994) - 1, (screenH * 0.5456) - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawLine((screenW * 0.5994) - 1, screenH * 0.5733, screenW * 0.7481, screenH * 0.5733, tocolor(0, 0, 0, 255), 1, false) dxDrawLine(screenW * 0.7481, screenH * 0.5733, screenW * 0.7481, (screenH * 0.5456) - 1, tocolor(0, 0, 0, 255), 1, false) dxDrawRectangle(screenW * 0.5994, screenH * 0.5456, screenW * 0.1487, screenH * 0.0278, tocolor(0, 0, 0, 100), false) dxDrawText("The time", screenW * 0.5994, screenH * 0.6833, screenW * 0.6581, screenH * 0.7111, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) dxDrawText("The date", screenW * 0.6894, screenH * 0.6833, screenW * 0.7481, screenH * 0.7111, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end addEventHandler("onClientRender",getRootElement(),HUD)
  18. Hi! I don't know, how is it possible: I try it with HTML, the video is in .webm format, and I have a bad fps drop, with link I can't do it, I don't know HTML well. I try it with createBrowser too, but with this, I can't do it that the gui or dxdraw be in front of the video, the browser.
  19. Heyo, so recently I got an awesome toptimes resource from a friend and today I fixed the positions of all elements drawn with dxDraw so that the toptimes window doesn't go outside of screen boundary on any resolution. So far, so good. But there is one problem, I don't know how to fix the elements' size to be same for all resolutions. I tried with something like " local x_,y_ = x/1680,y/1080 " and put " *y_ " after the size but it still looks ugly, also tried more combinations such as " x/1440,y/900 " and so on, to no success. Below is just the function which draws the F5 tops window, I always had trouble with fixing the size and here i am again, same problem...for the Nth time. Any help is appreciated. sX,sY = guiGetScreenSize() function drawToptimesIntreface() local x,y = guiGetScreenSize() if toptimes.animState == "closed" then local tick = getTickCount() - toptimes.tick local progress = tick/1000 toptimes.anim = interpolateBetween(0,0,0,390,0,0,progress,"OutBack") else local tick = getTickCount() - toptimes.tick local progress = tick/1000 toptimes.anim = interpolateBetween(390,0,0,0,0,0,progress,"InBack") end local clanColor = tocolor(255, 205, 0, 255) -- Clan Color local titleColor = tocolor(0, 255, 255, 255) -- Toptimes Title local displayColor = tocolor(0, 0, 0, 150) -- Toptimes Blackground if toptimes.state then local sY = sY-toptimes.anim*1.2 dxDrawRectangle(sX-x*0.4354166666666667, (sY/2)-y*0.5, x*0.1979166666666667, y*0.0231481481481481, clanColor) dxDrawText("Toptimes - "..toptimes.mapname, sX-x*0.6713541666666667, (sY/2)-y*0.8509259259259259,sX-x*0.0046875, (sY/2)-y*0.1240740740740741, tocolor(0,0,0,255), 1, "default-bold","center","center",true) dxDrawText("Toptimes - "..toptimes.mapname, sX-x*0.671875, (sY/2)-y*0.8518518518518519, sX-x*0.0052083333333333, (sY/2)-y*0.125, titleColor, 1, "default-bold", "center","center",true) dxDrawRectangle(sX-x*0.4354166666666667, (sY/2)-y*0.4768518518518519, x*0.1979166666666667, y*0.1666666666666667, displayColor) for i=1,9 do -- Show when player have toptime in any map dxDrawRectangle(sX-x*0.4354166666666667, (sY/2)+((i-1)*20)-y*0.4759259259259259, x*0.1979166666666667, y*0.017022792022792, tocolor(255,255,255,toptimes.color[i])) end for i=1,9 do -- Shadow dxDrawText(i..". "..removeColorCoding(toptimes.label[i]), sX-x*0.4310416666666667, (sY/2)+((i-1)*20)-y*0.8277777777777778, sX-x*0.0244791666666667, (sY/2)+((i)*20)-y*0.1240740740740741, tocolor(0,0,0,255), 1, "default-bold","left","center",true,false,false,true) dxDrawText(toptimes.time[i], sX-x*0.3132291666666667, (sY/2)+((i-1)*20)-y*0.8277777777777778, sX-x*0.0244791666666667, (sY/2)+((i)*20)-y*0.1240740740740741, tocolor(0,0,0,255), 1, "default-bold","left","center",true,false,false,true) dxDrawText(toptimes.data[i], sX-x*0.2744791666666667, (sY/2)+((i-1)*20)-y*0.8277777777777778, sX-x*0.0244791666666667, (sY/2)+((i)*20)-y*0.1240740740740741, tocolor(0,0,0,255), 1, "default-bold","left","center",true,false,false,true) -- dxDrawText(i..". "..toptimes.label[i], sX-x*0.4315625, (sY/2)+((i-1)*20)-y*0.8287037037037037, sX-x*0.025, (sY/2)+((i)*20)-y*0.125, tocolor(255,255,255,255), 1, "default-bold","left","center",true,false,false,true) dxDrawText(toptimes.time[i], sX-x*0.31375, (sY/2)+((i-1)*20)-y*0.8287037037037037, sX-x*0.025, (sY/2)+((i)*20)-y*0.125, tocolor(255,255,255,255), 1, "default-bold","left","center",true,false,false,true) dxDrawText(toptimes.data[i], sX-x*0.275, (sY/2)+((i-1)*20)-y*0.8287037037037037, sX-x*0.025, (sY/2)+((i)*20)-y*0.125, tocolor(255,255,255,255), 1, "default-bold","left","center",true,false,false,true) if toptimes.country[i] ~= "" then if fileExists(":admin/client/images/flags/"..toptimes.country[i]..".png") then dxDrawImage(sX-x*0.4227083333333333, (sY/2)+((i-1)*20)-y*0.4731481481481481, x*0.0083333333333333, y*0.0101851851851852, ":admin/client/images/flags/"..toptimes.country[i]..".png", tocolor(255,255,255,255)) end else if fileExists(":admin/client/images/flags/gtasa.png") then dxDrawImage(sX-x*0.4227083333333333, (sY/2)+((i-1)*20)-y*0.4731481481481481, x*0.0083333333333333, y*0.0101851851851852, ":admin/client/images/flags/gtasa.png", tocolor(255,255,255,255)) end end end if toptimes.personal[1] then dxDrawRectangle(sX-x*0.4354166666666667, (sY/2)-y*0.3101851851851852, x*0.1979166666666667, y*0.017592592592596, displayColor) dxDrawRectangle(sX-x*0.4354166666666667, (sY/2)-y*0.3089506172839506, x*0.1979166666666667, y*0.0166666666666667, tocolor(255,255,255,100)) -- Shadow dxDrawText(""..toptimes.personal.pos..". "..toptimes.personal.spacement..removeColorCoding(toptimes.personal.name), sX-x*0.4341666666666667, (sY/2)-y*0.6673611111111111, sX-x*0.0244791666666667, (sY/2)+y*0.0668981481481481, tocolor(0,0,0,255), 1, "default-bold","left","center",true,false,false,true) dxDrawText(toptimes.personal.time, sX-x*0.3132291666666667, (sY/2)-y*0.6645833333333333, sX-x*0.0244791666666667, (sY/2)+y*0.0641203703703704, tocolor(0,0,0,255), 1, "default-bold","left","center",true,false,false,true) dxDrawText(toptimes.personal.data, sX-x*0.2744791666666667, (sY/2)-y*0.6645833333333333, sX-x*0.0244791666666667, (sY/2)+y*0.0641203703703704, tocolor(0,0,0,255), 1, "default-bold","left","center",true,false,false,true) -- dxDrawText(""..toptimes.personal.pos..". "..toptimes.personal.spacement..toptimes.personal.name, sX-x*0.4346875, (sY/2)-y*0.668287037037037, sX-x*0.025, (sY/2)+y*0.0659722222222222, tocolor(255,255,255,255), 1, "default-bold","left","center",true,false,false,true) dxDrawText(toptimes.personal.time, sX-x*0.31375, (sY/2)-y*0.6655092592592593, sX-x*0.025, (sY/2)+y*0.0631944444444444, tocolor(255,255,255,255), 1, "default-bold","left","center",true,false,false,true) dxDrawText(toptimes.personal.data, sX-x*0.275, (sY/2)-y*0.6655092592592593, sX-x*0.025, (sY/2)+y*0.0631944444444444, tocolor(255,255,255,255), 1, "default-bold","left","center",true,false,false,true) if toptimes.personal.country ~= "" then if fileExists(":admin/client/images/flags/"..toptimes.personal.country..".png") then dxDrawImage(sX-x*0.4227083333333333, (sY/2)-y*0.30625, x*0.0083333333333333, y*0.0101851851851852, ":admin/client/images/flags/"..toptimes.personal.country..".png", tocolor(255,255,255,255)) end else if fileExists(":admin/client/images/flags/gtasa.png") then dxDrawImage(sX-x*0.4227083333333333, (sY/2)-y*0.30625, x*0.0083333333333333, y*0.0101851851851852, ":admin/client/images/flags/gtasa.png", tocolor(255,255,255,255)) end end end end end addEventHandler("onClientRender",getRootElement(),drawToptimesIntreface) This is how it should look like, on any screen :
  20. Buenas! Tengo un problema y es que, intento hacer un dxEditBox sencillo para un dxLogin. En fin, lo que hice para que se pueda escribir en este, es esto: addEventHandler("onClientCharacter", root, function(c) if ( elementClicked == "password-edit" ) then passwordBox = passwordBox..""..c elseif ( elementClicked == "username-edit" ) then usernameBox = usernameBox..""..c end end ) Okay, me escribe bien. La cuestión es.. ¿como borrar? Un amigo me paso esto: bindKey("backspace", "down", function () if ( elementClicked == "password-edit" ) then passwordBox = "" elseif ( elementClicked == "username-edit" ) then usernameBox = "" end end) pero esto básicamente deja en blanco el editBox, no borra 1 carácter. ¿Alguien me puede decir como hacer para borrar un solo carácter sin tener que borrar todo el texto?
  21. Hey, so, I would like to make a GTA like (it sounds strange) notification system, something like you can see in every singleplayer GTA, the upper left hand corner box notifications: I have the base script, everything renders and works fine, but I would like to make a special "timer" for it, which works like the following way: the longer the text is, the longer the notification lasts. This is one thing I would like to make, the other thing is: how is it possibble to make an export function for this, so I can make notifications from other resources with the text I give in the resource I'm calling it back from. I don't really understand tables and loops, I would be so happy if somebody could help me! I hope you can understand me, and what I am trying to do and explain, thanks for the help in advance! local displayWidth, displayHeight = guiGetScreenSize(); local borderDistance = 20 local tipBox = { string = "asfasfasafaasfasfasafsafsfasfasafsasfasfafsafssafasfsdwadsadwqwdasdasfasasafsaf" } local boxX, boxY = borderDistance * displayWidth / displayWidth, borderDistance * displayHeight / displayHeight local boxPadding = 10 local lineHeight = dxGetFontHeight( 1, "default-bold" ) local minimumWidth = 350 local offsetWidth = 25 addEventHandler( "onClientRender", root, function( ) local lines = 0 local wordbreak = false local lineWidth = dxGetTextWidth( tipBox.string, 1, "default-bold" ) while ( lineWidth + offsetWidth > minimumWidth ) do lineWidth = lineWidth - minimumWidth lines = lines + 1 wordbreak = true end local boxWidth, boxHeight = minimumWidth + ( boxPadding * 3 ), ( lineHeight * ( lines + 1 ) ) + ( boxPadding * 2 ) dxDrawRectangle( boxX, boxY, boxWidth, boxHeight, tocolor( 0, 0, 0, 180 ), true ) dxDrawRectangle( boxX, boxY+boxHeight, boxWidth, 4, tocolor( 200, 0, 100, 255 ), true ) local textX, textY = boxX + boxPadding, boxY + boxPadding local textWidth, textHeight = textX + minimumWidth + boxPadding, textY + lineHeight + boxPadding dxDrawText( tipBox.string, textX, textY, textWidth, textHeight, tocolor( 255, 255, 255, 255 ), 1, "default-bold", "left", "top", false, wordbreak, true ) end )
  22. When a player change the skin several times this script causes lag. Could you tell me what causes this?
  23. dugasz1

    3D dxDraw

    Hello everybody. I would like to draw in 3D. I use DxDrawMaterialLine3D for it. So i have a background image but i want to write text to it and draw recentagles to it. Is it possible? Can i somehow set the dxDrawText output to my background texture?
×
×
  • Create New...