Jump to content

Pirulax

Discord Moderators
  • Posts

    403
  • Joined

  • Last visited

Everything posted by Pirulax

  1. What MIKI785 said is correct. In theory you could use resourceRoot to, for example, blow up a vehicle, but only a vehicle that was created by that resource.
  2. If its the default GTASA map then just set your Streaming memory to max. (Settings -> Advanced -> Streaming memory if I remember correctly)
  3. You can: local _setElementData = setElementData -- Store the function in a var function setElementData( player, key, value ) -- Wrapper return _setElementData( player, key, value, false ) -- call the old function end Element.setData = setElementData -- OOP
  4. I'm more than sure that on(Client)ElementDataChange is async.
  5. btw, be aware that you should have a hash check if used client-side, because ppl will simply add their own code inthere as well
  6. "when I restart" Probably the render target is just black, so you need to render something on it right after you create it
  7. Well, setting takes way more time than getting it, just because the :~ty way its implemented in. for some reason everything is in CStaticFunctionDefinitions.cpp, even those things which are CLASS specific, for example, when you set an element data a new value, you'd expect that the CCustomData class should send a packet to the client to request them to refresh their data, but... NO, it doesn't. And that's not a big of a deal, at all.. But, take a look at the way setElementData is implemented...
  8. he said he doesn't wont the clients to redownload the files by the way, PUBG servers use the magic attribute called 'cache' with a value of 'false' in the meta.
  9. For the sake of god, dont use element data If possible avoid it, it's slow af.(indexing is 30x times faster if I recall correctly)
  10. "Google translating gone sexual"
  11. That's only for Notepad++ isn't it?
  12. Pirulax

    Open Source

    You can have your own version of MTA, yes, but you must keep it open source bc of the license.
  13. You may want to use functions from the utf8 lib instead, because Lua doesn't handle utf8 chars that well, for example Hungarian letters: é, á, ő, and so on I mean, it should actually work with gmatch as well, but for example :gsub with Hungarian letters isn't a working thing ?
  14. Stop using element data for everything, please.
  15. You can actually call a function to get depth bias like so: DepthBias = GetDynamicDepthBias(); If that helps you.
  16. It's unrealistically accurate
  17. getSoundTTFData dxCreateRenderTarget dxSetRenderTarget dxDrawRectangle dxCreateShader("TEXTURE gTexture; technique default {Pass P0 {Texture[0] = gTexture}} technique fallback {Pass P0{}}") dxSetShaderValue Maybe the shader has some errors, but fix them if it does.
  18. I'd store a simple timestamp, then use getRealTime(timestamp), and there you go
  19. I'd rather use a shade than a rt, with AddressU and V set to 'Border' and BorderColor to the color of water. But if you want to do it in Lua, then, set the rt, draw a rectangle with the color of water, then draw the image.
  20. By the way, I created 10k shaders, it doesn't lag at all, because it's just a simple texture replace.
  21. guiGetScreenSize() just gets the width and height of the screen. If you want to place something exactly 10px from the bottom of the screen, then you'd use sh-10, if you want to place something 10px from the top of the screen you'd simply use 10, And so on.
  22. local sw, sh = guiGetScreenSize() local jumpTick = 0 local RELOAD_TIME = 3000 bindKey("lshift", "down", function() local now = getTickCount() if (now-jumpTick>reload) then local vehicle = getPedOccupiedVehicle(localPlayer) if (vehicle)then local sx, sy, sz = getElementVelocity(vehicle) setElementVelocity(vehicle, sx, sy, sz+0.33) end jumpTick = now addEventHandler("onClientRender", root, drawProgressBar) end end ) function drawProgressBar() local now = getTickCount() if (now-jumpTick>RELOAD_TIME) then -- Only draw the progressbar when it's reloading removeEventHandler("onClientRender", root, drawProgressBar) return end local width = 200*(now-jumpTick)/RELOAD_TIME dxDrawRectangle(sw/2-100, sh-100, 200, 20, tocolor(0, 0, 0, 180)) dxDrawRectangle(sw/2-100, sh-100, width, 20, tocolor(0, 255, 0, 180)) end There you go
  23. That will just simply replace the texture to cj_ped_feet, I think.
  24. You could make multiple passes in one tec. But in theory, only Texture[0] is used I think.
×
×
  • Create New...