Pirulax
Discord Moderators-
Posts
403 -
Joined
-
Last visited
Everything posted by Pirulax
-
Halihó, Próbáld MagicTXDvel, gtaforum.netről töltheted le, az nekem megszokta oldani az ilyen TXD bajokat. U.I.: Remélem nem számít bumpnak
-
Thanks m8
-
I never thought about just getting the color under the cursor, but instead doing some crazy math
-
Actually, maybe I realized what's the problem with the script that @maxiumdrive posted. addEventHandler('onClientResourceStart', resourceRoot, function() local buffer local hFile = fileOpen("model.dff") -- attempt to open the file if hFile then -- check if it was successfully opened while not fileIsEOF(hFile) do -- as long as we're not at the end of the file... buffer = buffer..base64Encode(fileRead(hFile, 500))-- ... read the next 500 bytes... end fileClose(hFile) -- close the file once we're done with it else outputConsole("Unable to open the model file") end local enBuffer = teaEncode(buffer, "xTN5#Gqm=sKn**dF") local deBuffer = base64Decode(teaDecode(enBuffer, "xTN5#Gqm=sKn**dF")) engineImportTXD(engineLoadTXD('tex.txd',true) , 596) engineReplaceModel(engineLoadDFF(deBuffer) , 596) end )
-
function File.encode(path, key) local uncf = File.open(path) if (uncf) then local encf = File(path..".encoded") encf:write(teaEncode(base64Encode(uncf:read(uncf:getSize())), key)) encf:close() uncf:close() end end function File.readEncoded(path, key) local encf = File.open(path..".encoded") if (encf) then local decoded = base64Decode(teaDecode(encf:read(encf:getSize()), key)) encf:close() return decoded end end Note: You need to have OOP enabled in meta.xml(<oop>true</oop>)
-
You actually gave me an idea Thanks mate, I really appreciate, I gave you some reputation points.
-
I'm sure that you have a professional team.(sarcasm) They didn't used callbacks. Neither LIMIT 1 in sql queries. Neither '?' but instead they simply concated string which leads to SQL injection.... Dont insult me, alright?
-
That SQL query you just posted is totally inject safe, you should know that. Nah, back to the thing: buy a better VPS, or actually, a server. The problem is that(mostly) setElementData causes a big bottleneck, since it's synced to everyone who joins to the server. Try optimizing ur vehicle-system, since a lot of elements can cause big CPU usage too. Try reducing server-side elements, like create maps client side instead of server-side.
-
dont use element data maybe? Because the way it works is that every element data is synced to everyone. Even the ones set at the client I think. So, that's the problem.
-
What does that 'log' function do?
-
My friend has 15 pcs, but he didn't want to give 'em. srry
-
Here are a few. Or ohh, I just realized that you need the one you posted in 3k res. I don't have that, but you may like those ones I sent you.
-
Actually: function getCursorPosAtHeight(h) --// Calculate the cursorposition at the v3StartAz.z height. local v3CamPos = getCamera():getPosition() local v3Unit = v3CamPos-Vector3(getWorldFromScreenPosition(v2CursorPos.x, v2CursorPos.y, 1))--// Calculate how much going down 1 depth effects our z local zDistance = (v3CamPos.z-h)/v3Unit.z --// Get the height between the wanted height and the cam and devide it by the v3Unit.z, so we get how much units we need return Vector3(v3CamPos.x-v3Unit.x*zDistance, v3CamPos.y-v3Unit.y*zDistance, h)--// Calculate the cursor position at the given height. end Water is always at height 0. Now, to test that the user really clicked on water just use the mentioned function. testLineAgainstWater(getCamera():getPosition(), getWorldFromScreenPosition(v2CursorPos, 300)) If this returns true then he clicked at water. To get the water height juse use getCursorPosAtHeight(0)
-
So, I have a shader: float4 PixelShader3Function(float2 UVCoords : TEXCOORD0) : COLOR0 { return float4(0, 0, 0, 1); } technique Normal { pass P0 { PixelShader = compile ps_3_0 PixelShader3Function(); } } Which should make the texture black, but instead it makes it transparent. But, if I use compile ps_2_0 instead it works just fine, and turns my texture into black. Anyone any idea?
-
- shader
- pixelshader
-
(and 3 more)
Tagged with:
-
But ur solution is more than great
-
@Jayceon Drawing a texture from a path is slow. Use a texture created with dxCreateTexture instead. And, drawing a whole map which is 3072x3072 is also slow.
-
local level = tonumber ( CreatTop[i].level ) or 0 -- attempt to convert to number or return a 0 First CreatTop.level is evaluated and then if tonumber() returns a false CONDITION then or's other side(0 here) is returned. It's called a ternary operation.
-
No, it's not. Because if CreatTop is a nil value it should thrown an error at line 8.
-
So, line 595 is "if #CreatTop>0 then"? Also, set you tab key to insert spaces instead of tabs, because(bc) this linter doesn't love tabs that much, and it brokes the indentation.
-
Jesus, please use normal variable names, not some random ones. Also, which is the 116th line?
-
Explain ur issue a little bit more please.
-
local tick, healthLastFrame, animateTo = 0, 0 addEventHandler("onClientRender", root, function() local health = getElementHealth(localPlayer) if (healthLastFrame~=health) then tick = getTickCount() animateTo = health else healthLastFrame = health end local progress = (getTickCount()-tick)/1000 dxDrawRectangle(450, 0, 400, 30, tocolor(0, 0, 0, 150)) dxDrawRectangle(450, 0, 400*animateTo*((progress>1 and 1) or progress)/100, 30, tocolor(100, 0, 0, 255)) end ) Should work. 'Should' bc i haven't tried it.
-
No, they don't. Performance wise it's the same as caching them. non-cached scripts actually load faster, because they are directly downloaded into the RAM, while cached files are first written, then loaded.
