Jump to content

Pirulax

Discord Moderators
  • Posts

    403
  • Joined

  • Last visited

Everything posted by Pirulax

  1. setFogDistance() Is only for removing fog. setFarClipDistance() Does nothing too, because the objects in that are are rendered. But I know that there is a function that is used in such case, but I dont know its name, sorry.
  2. Okey, so. There is this function called: getElementBoundingBox() But, is there any way to get the bounding box of a vehicle component? For example the bounding box of the wheel. Thanks for da' answers in advance.
  3. Jesus christ, u use this somewhere? Please clean the code up a little bit, so we can actually read it, and then understand it. Thanks >D
  4. there is a function called setElementStreamable() But use this function because the object on which you use this function will be always streamed, thus decreasing FPS.
  5. I dont think that custom fonts add something to delta time(The more delta time the less FPS, actually, the time between two frames is called 'delta time') Think about it: MTA uses custom fonts too, but they are created inside of MTA. And yeah, code: addEventHandler("onClientRender", root, function() dxDrawRectangle(panelX, panelY, mainW, mainH, tocolor(0, 0, 0, 180)) local offsetY = panelY-180 for i = currentRow, latestRow do if not (TextsInTable[i]) then return end dxDrawCenterText(v[1].." "..v[2], panelX, offsetY, mainW, mainH, Font) offsetY = offsetY + rowH end end ) bindKey("mouse_wheel_down", "down", function() if currentRow < #TextsInTable - (maxRow - 1) then currentRow = currentRow + 1 latestRow = currentRow + maxRow - 1 end end) bindKey("mouse_wheel_up", "down", function() if currentRow > 1 then currentRow = currentRow - 1 latestRow = currentRow + maxRow - 1 end end) function dxDrawCenterText(text, x, y, width, height, color, fontSize, font) dxDrawText(text, x, y, x + width , y + height, color, fontSize, font, "center", "center", false, false, false, true) end
  6. Which one helped ya'? Wanna know, because I have an 'engine' resource and other resources are dropping errors like crazy.
  7. Jeez... Try to use print("Enbuffer", enBuffer) print("Debuffer", deBuffer) enbuffer should print base64 but bebuffer should print some binary text(Or idk, never have tried to print out binary in Lua) Or maybe it fails because of the modelid, try to use other modelid, like 587
  8. Hi, I've solved everything. I forgot what exactly caused the issues. Thanks.
  9. Be realistic. It just uses RAM, nothing more.(I think) So really, that few mb(or even kb) of RAM isnt a problem I think.
  10. Ahogy eddig csináltad, létrehozod script elején, aztán használod a dxSetRenderTarget() És a 2. argumentumot 'true'-ra állitod, ezzel kitisztisa a rtargetot mielőtt újra rajzolsz rá, azért mert a rtarget egy papirlap(igy biztos megérted.), ezáltál ha 1x rajzolsz rá, az ott is marad. Egyébként, rosszul használod a rtargetot, igy csak zabálja a CPU-t, csak akkor frissitsd a rtargetot ha új szöveget akarsz irni, a többi szöveget meg tárolod egy táblában, igy amikor érkezik egy új szöveg akkor csak végigloopsz rajta, és kirajzolod azt amit kell.(Legyen egy sor limit, mondjuk 10.) Igy valahogy csináld meg(ne render alatt): dxSetRenderTarget(rtarget, true) dxSetBlendMode("modulate_add") local subY = dxGetFontHeight(1, "default-bold") local offsetY = 500--//Ird ide a rtarget magasságát for i = #texts, 1, -1 do dxDrawText(texts[i], ird be, offsetY-subY*(i-), ...)--// A ...-ot helyettesitsd be azzal amivel kell. end dxSetBlendMode("add") dxSetRenderTarget() Ez csak példa, eléggé fáradt vagyok, és nincs kedvem sokat babráli a cuccokkal, bocsi. A dxSetBlendMode Csak azért kell,hogy a szöveg szebb legyen. Második problémát nem értem teljesen, az valószitűleg a sajátkészitésű worldbreak miatt van, mivel a magyar betűket nem tudja kezelni a lua(nem ascii betűket), erre ott az utf8 lib MTAban. (Feltéve, ha az a baj,hogy levágja a szöveget) U.I.: onClientRender -be tedd a kép felrajzolását.
  11. So you made a "massaging" panel, or whatever. But if its a massaging panel, than why the heck you want to output the message that the admin typed in, into the chatbox? I dont undestang you, and I dont understand why you want to output the message to the chatbox.
  12. Pirulax

    Help

    Jeeees' Juuunk code, juunk, god. And it will never work, since you cant have more than one 'else', but you can have more than 1 'elseif' function reloadTheAmmo(thePlayer) triggerServerEvent("reloadWeapon", localPlayer) end addEventHandler ("onClientGUIClick", button3, reloadTheAmmo) --// Serverside local weapons = { [22] = {ammo = 1000, cost = 5000}, [24] = {ammo = 450, cost = 5000}, [25] = {ammo = 200, cost = 5000}, [26] = {ammo = 500, cost = 5000}, [27] = {ammo = 850, cost = 5000}, [29] = {ammo = 2100, cost = 5000}, [30] = {ammo = 1600, cost = 5000}, [31] = {ammo = 2500, cost = 5000}, [34] = {ammo = 50, cost = 5000}, } addEventHandler("reloadWeapon", root, function() local cw = getPedWeapon(thePlayer) local d = weapons[cw] if (cw) and (d) and (takePlayerMoney(thePlayer, d.cost)) then setWeaponAmmo(thePlayer, cw, d.ammo) end end ) And I would add a timer that so called, protects the server from flood.
  13. I cant undestand this junk code, sorry. Why do you have this much statemenets? Why not just redefine the values of the variables, and at the end just return it with math.random? And if you need true randomness: function totallyRandomRandom(first, second) math.randomseed(math.random(0, getTickCount())+getTickCount()) return math.random(first, second) end
  14. No,, in theory it should cause any problem(s).
  15. Én a helyedben nem hoznék létre rendertargetot onClientRender-ben. Nem egészséges a VRAM szempontjából.
  16. Solved, just forgot to run win-install-data.bat. Got a new problem, but solved it[The debug build just stopped because VS was unable to load symbols for it. To fix this you should go to Tools -> Options -> Debugger -> Symbols and select the chbox "Microsoft Symbol Server, and make sure to select a cache directory too"]
  17. So, after i built the project using the Build -> Build Solution i tried to run MTA, but a msgbox appeared saying that it cannot find netc_d.dll. Could someone help me? Thanks in advance.
  18. Pirulax

    Lua 5.3?

    I dont thing that it would break anything, but alright.
  19. Pirulax

    Lua 5.3?

    Is there any chance to see Lua 5.3 in MTA? Mostly because of new features in 5.3, like goto statement, bitwise operators, and new metatable events.
  20. Try to use setElementInterior(getCamera(), 4)
  21. If these huds on those RP servers are not the default ones i don't think that the MTA Dev team can do anything with it. (Actually there is an implementatio for this, which regulates the dimensions of drawn dxs)
  22. It didnt, since its a valid form of calling a function. print "test"
×
×
  • Create New...