![](https://forum.multitheftauto.com/uploads/monthly_2018_02/bgimg..png.2e935deab1b1b4c3240520a864d18cfc.png)
Pirulax
Discord Moderators-
Posts
403 -
Joined
-
Last visited
Everything posted by Pirulax
-
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.
-
If its the default GTASA map then just set your Streaming memory to max. (Settings -> Advanced -> Streaming memory if I remember correctly)
-
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
-
I'm more than sure that on(Client)ElementDataChange is async.
-
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
-
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...
-
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.
-
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)
-
"Google translating gone sexual"
-
That's only for Notepad++ isn't it?
-
You can have your own version of MTA, yes, but you must keep it open source bc of the license.
-
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 ?
-
Stop using element data for everything, please.
-
Applying a dynamic depth bias to a shader possible?
Pirulax replied to Einheit-101's topic in Scripting
You can actually call a function to get depth bias like so: DepthBias = GetDynamicDepthBias(); If that helps you. -
Getting an applied shader/texture's world position?
Pirulax replied to maximumdrive's topic in Scripting
You can do that in the shader itself actually. -
It's unrealistically accurate
-
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.
-
I'd store a simple timestamp, then use getRealTime(timestamp), and there you go
-
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.
-
Create one shader but replace multiple textures
Pirulax replied to Dzsozi (h03)'s topic in Scripting
By the way, I created 10k shaders, it doesn't lag at all, because it's just a simple texture replace. -
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.
-
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
-
Create one shader but replace multiple textures
Pirulax replied to Dzsozi (h03)'s topic in Scripting
That will just simply replace the texture to cj_ped_feet, I think. -
Create one shader but replace multiple textures
Pirulax replied to Dzsozi (h03)'s topic in Scripting
You could make multiple passes in one tec. But in theory, only Texture[0] is used I think.