Overkillz

Members
  • Content Count

    445
  • Joined

  • Last visited

Community Reputation

22 Decent

1 Follower

About Overkillz

  • Rank
    Hustler

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. For example. I want to create a renderTarget which containt a square (dxDrawRectangle) and an image, like a star (dxDrawImage) and apply the gradient shader effect to both of them. to later draw it. However, I wont create just one renderTarget, I want to create multiples of them with different gradient colors. Thats why I asked you if I need to create a shader per renderTarget (which containt the square and the star).
  2. @XaskeL Well, I've just understood more less. Assuming that I want to add a rectangle and an image and apply the shader effect to both of them it doesn't work correctly. Its near of reaching the goal, but it does weird things. imagePath is defined. local sX,sY = guiGetScreenSize() local gradientShader = dxCreateShader("files/shader/gradient.fx") local rt1 = dxCreateRenderTarget(sX*0.3, sY*0.05, true) local rt2 = dxCreateRenderTarget(sX*0.3, sY*0.05, true) function drawThings() -- ##RENDER TARGET #1 dxSetRenderTarget(rt1) dxDrawRectangle(0,0,sX*0.3, sY*0.05) dxDrawImage(0,15,sY*0.02,sY*0.02,imagePath) dxDrawImage(0,0,sX*0.3, sY*0.05, gradientShader) dxSetRenderTarget() dxSetShaderValue(gradientShader, "startColor", 207/255, 22/255, 124/255,1) dxSetShaderValue(gradientShader, "endColor", 239/255, 56/255, 48/255,1) dxSetShaderValue(gradientShader, "tex", rt1) -- ##RENDER TARGET #2 dxSetRenderTarget(rt2) dxDrawRectangle(0,0,sX*0.3, sY*0.05) dxDrawImage(0,15,sY*0.02,sY*0.02,imagePath) dxDrawImage(0,0,sX*0.3, sY*0.05, gradientShader) dxSetRenderTarget() dxSetShaderValue(gradientShader, "startColor", 207/255, 22/255, 124/255,1) dxSetShaderValue(gradientShader, "endColor", 239/255, 56/255, 48/255,1) dxSetShaderValue(gradientShader, "tex", rt2) addEventHandler("onClientRender",root,renderThings) end function renderThings() dxDrawImage(sX*0.05,sY*0.1,sX*0.3, sY*0.05, rt1) dxDrawImage(sX*0.05,sY*0.4,sX*0.3, sY*0.05, rt2) end drawThings()
  3. @XaskeL Yes, that was a big mistake by me. Anyways, If I want to create mulitple rectangles with different gradient colours, Am I forced to create multiple shaders ? Regards.
  4. @XaskeL Thanks, it worked, but ... Now Im trying to merge it with renderTargets and later convert that renderTarget into a texture to later apply the effect. But the draw doesn't take any effect. CODE I really don't know what could be wrong. No errors in debug. Regards.
  5. Hello dear community. Im doing some researchs about shaders and I'm trying to applying a grradient effect to the bell photo. But the problem is that I know that I don't know how to apply it to the image. I can create a rectangel by drawing the shader, but applying the effect to the texture ..etc its giving me some troubles. Here is the shader SCRIPT And here it is what I've just reached drawing it. I know I can use HUDMASK script to reach it, but I want to try to simplify the things Thanks for reading. Regards.
  6. Thats all what you need (If I didnt forget anything) local theTime = getRealTime() local secondsToAdd = 4500 local timeForPlayer = theTime.timestamp+(secondsToAdd) setAccountData (acc, "time", timeForPlayer ) --Your checker funciton local theTime = getRealTime() if theTime.timestamp > getAccountData(acc,"time") then -- DO WHATEVER YOU WANT end
  7. Im not sure about this, but try to use set as gravity 0.8 Btw, Im not understanding what do you really want.
  8. Hello dear guys, today I've just got an issue index-ing some values inside a table. More than an issue, its a question. Why Index-ing is not working properly. Sometimes I need to edit the layer-1 (Position 1) and sometimes I need to edit the 15th (Position 15) and might form 2-14 they arre not exists addLayer(1,"arrowdown") addLayer(2,"arrows") addLayer(3,"curve") local tableTest1 = {} function addLayer(slotNo,layerName) if not slotNo or not layerName then return end tableTest1[tonumber(slotNo)] = {name = layerName, active = true} iprint(tableTest1) end I need to keep them in the order that Im adding them to the table. Sometimes the index is visible in the table and idk when I add a layer from client.Lua to addLayerClient.Lua Sometimes even the first index isn't appeared and the rest of them yes. and the structure in this case would be INFO {{ active = true, name = "addowdown" }, [2] = { active = true, name = "whatever" }, [8] = { active = true, name = "whatever2" } I know there are several ways to fix it like adding an id to each table inserted and later use table.sort or things like that, but I would like to know whats wrong with this. I hope you can bring me a hand. Best Regards.
  9. If you are trying to add a crosshair in the groun. You can use dxDrawMaterialLine3D() Read carefully the arguments to draw it correctly.
  10. Probably getTickCount() Will solve your problem. Just when the "Bomb" reach the point where you want it, get the timer using local startTick = getTickCount() --When the bomb reach the point just get the time local timeVariable = getTickCount() - startTick Regards.
  11. @IIYAMA Well, assuming that I will chose the way of dxDrawMaterialLine3D. Will I be forced to use shaders if I want to reach a similar effect for uneven grounds right ?
  12. @IIYAMA Yes, the right word woluld be a shadow (But an image as shadow) I have been several Topics around the community and I have been reading that adding a shadow to the COL could solve my problem even more. But could someone tell how do COLS work ? Thanks for answering
  13. @Awang @IIYAMA I have been doing some researchs about it and ... Well, I think instead of getGroundPosition() onPlayerContact I could use isLineOfSightClear() Due to what about if the player enter in a vehicle (I want to keep the image) under the car. Also. I have been reading some shaders code which were previously mentioned by Awang and I have seen that all of them have a list of textures added to apply the effect over them. (This might could solve the problem for the uneven grounds) And might the best way to take reference for my goal is to read carefully the code of @Ren_712 The Dynamic Lights Script (https://community.multitheftauto.com/index.php?p=resources&s=details&id=9398) But I have a question. Do Im still needing to use dxDrawMaterialLine3D() to reach the goal ? Might create a texture would be a better option if I just want to draw an image. What do you think about this ? Thanks for reading. Best regards.
  14. Hello guys, Im planning to create an script which draw whatever I want(For example an image) under my PED, but when i have been thinking about it a lot of questions came to me. First of all I know that I will have to use shaders to reeach my goal. But here are my main question. How do I get the elements that are under me. I have been thinking for a vehicle with onClientVehicleCollision but i want with the peds. Another question is, what about if Im in the middle of 2 objects like on this image Otherwise, What about if the ped is flying or whatever (It is supossed that he is not touching the ground) so how could I deal with it. I don't know where to start with this, I hope you can bring me a hand. Thanks for reading. Regards.
  15. Wasn't aware about it. I thought server side could change it, even if it wasn't created there. Thanks for answering.