Dzsozi (h03)

Members
  • Content count

    527
  • Joined

  • Last visited

Community Reputation

38 Good

5 Followers

About Dzsozi (h03)

  • Rank
    Playa Partner

Details

  • Location
    Hungary

Recent Profile Visitors

1,407 profile views
  1. Only one wheel is returned with getVehicleComponents

    Thank you, I fixed everything you mentioned, works perfectly now. Thank you again!
  2. Only one wheel is returned with getVehicleComponents

    Yes, I also noticed that the effectDestroyTimer was global, I already fixed it, this doesn't seem to be the problem. Here's how I call the function: local waterSplash = {} function waterSplashEffect() for k, vehicle in pairs(getElementsByType("vehicle")) do if isElementStreamedIn(vehicle) then if not isVehicleBlown(vehicle) then if isVehicleOnGround(vehicle) and not isVehicleOnRoof(vehicle) then if getVehicleSpeed(vehicle) >= 10 then waterSplash[vehicle] = createEffectAtWheels(vehicle, "water_splash", 1000) end end end end end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() setTimer(function() waterSplashEffect() end, 50, 0) end )
  3. Only one wheel is returned with getVehicleComponents

    I already did that before posting, I added it later while trying to fix the problem. Here's my current code: function createEffectAtWheels(vehicle, effect, duration) if not tostring(effect) then return false end if vehicle and isElement(vehicle) and getElementType(vehicle) == "vehicle" then local vehicleType = getVehicleType(vehicle) if vehiclesWithWheels[vehicleType] then local vehicleX, vehicleY, vehicleZ = getElementPosition(vehicle) local _, _, vehicleRotation = getElementRotation(vehicle) local effectAtWheels = {} local effectDestroyTimer if isTimer(effectDestroyTimer) then killTimer(effectDestroyTimer) effectDestroyTimer = nil end for component in pairs(getVehicleComponents(vehicle)) do if wheelComponents[component] then local wheelX, wheelY, wheelZ = getVehicleComponentPosition(vehicle, component, "world") local groundZ = getGroundPosition(wheelX, wheelY, wheelZ) outputChatBox(tostring(component)) if wheelZ <= groundZ+0.5 then effectAtWheels[component] = createEffect(effect, wheelX, wheelY, wheelZ-0.275, 0, 0, vehicleRotation, 150, false) end effectDestroyTimer = setTimer(function() if effectAtWheels[component] and isElement(effectAtWheels[component]) then destroyElement(effectAtWheels[component]) effectAtWheels[component] = nil end end, duration, 1) if effectAtWheels[component] and isElement(effectAtWheels[component]) then return effectAtWheels[component] end end end end end end wheelComponents = { ["wheel_lf_dummy"] = true, ["wheel_lb_dummy"] = true, ["wheel_rf_dummy"] = true, ["wheel_rb_dummy"] = true, ["wheel_front"] = true, ["wheel_rear"] = true, } And the problem is the same, the effect is being created only at the right front wheel, and it changes to another wheel if the right front wheel doesn't touch the ground, but as soon as it touches the ground the effect is being created only at that wheel again.
  4. Only one wheel is returned with getVehicleComponents

    What would be the right way to do it then, could you help me out? I can't solve it.
  5. Only one wheel is returned with getVehicleComponents

    Any help? I think I am doing something wrong at the loop section, but I don't know what and I can't fix it.
  6. Only one wheel is returned with getVehicleComponents

    Okay, so I realised that this only happens when I use the createEffect function, but I tried it with fxAddFootSplash and it was working. My question is why it doesn't work with the createEffect function and how can I make it work with that function?
  7. Hello! I would like to do a simple function which allows me to create GTA SA effects at the position of the vehicle's wheels. For some reason the effect is being created only at one wheel, which is the right front wheel in case of cars, and the front wheel in case of bikes. I don't know what am I doing wrong, I would be grateful if someone could help me solve the problem, here's my script: Client Side: local effectAtWheels = {} function createEffectAtWheels(vehicle, effect) if not tostring(effect) then return false end if vehicle and isElement(vehicle) and getElementType(vehicle) == "vehicle" then local vehicleType = getVehicleType(vehicle) if vehiclesWithWheels[vehicleType] then local vehicleX, vehicleY, vehicleZ = getElementPosition(vehicle) local _, _, vehicleRotation = getElementRotation(vehicle) for component in pairs(getVehicleComponents(vehicle)) do if wheelComponents[component] then for i=1, #component do local wheelX, wheelY, wheelZ = getVehicleComponentPosition(vehicle, component, "world") local groundZ = getGroundPosition(wheelX, wheelY, wheelZ) if wheelZ <= groundZ+0.5 then -- if the wheel is on the ground effectAtWheels[component] = createEffect(effect, wheelX, wheelY, wheelZ-0.225, 0, 0, vehicleRotation, 150, false) end if effectAtWheels[component] and isElement(effectAtWheels[component]) then return effectAtWheels[component] end end end end end end end Global/Shared script: wheelComponents = { ["wheel_lf_dummy"] = true, ["wheel_lb_dummy"] = true, ["wheel_rf_dummy"] = true, ["wheel_rb_dummy"] = true, ["wheel_front"] = true, ["wheel_rear"] = true, } vehiclesWithWheels = { ["Automobile"] = true, ["Bike"] = true, ["Trailer"] = true, ["BMX"] = true, ["Monster Truck"] = true, ["Quad"] = true, } What could be the problem? I don't understand why is it happening, there is nothing seems to be wrong for me, also, debugscript doesn't output any errors. Thank you for your reply in advance!
  8. [SHOW] Vehicles Get Dirty

    From my perspective, it requires more shader knowledge than I have, I wouldn't be able to do it by myself yet. Maybe later, when I get more experienced with shaders, for now I stick to the method that can be seen here.
  9. [SHOW] Vehicles Get Dirty

    If you can remember and explain how it must be done, I might remake it.
  10. [SHOW] Vehicles Get Dirty

    After the base system is done it could be done easily by adding more textures and lowering the time values. -- current local grungeTextures = {} grungeTextures[1] = dxCreateTexture("files/images/nogrunge.png") grungeTextures[2] = dxCreateTexture("files/images/lowgrunge.png") grungeTextures[3] = dxCreateTexture("files/images/defaultgrunge.png") grungeTextures[4] = dxCreateTexture("files/images/biggrunge.png") grungeTextures[5] = dxCreateTexture("files/images/megagrunge.png") You can add as many textures as you want. But I don't know how adding more textures would affect the performance. Right now this is the only way I could think of a solution for what you wrote.
  11. [SHOW] Vehicles Get Dirty

    New update!
  12. [SHOW] Vehicles Get Dirty

    Thank you! And thanks for your feedback!
  13. [SHOW] Vehicles Get Dirty

    Added video and a few more content!
  14. This might be useful, I will play around with it, thank you for mentioning!
  15. I found a solution by myself, but thank you for your time, I appreciate it! Since I am using onClientRender event I could make my own "timer"/progress thing. I don't know how it doesn't came into my mind faster, it works perfectly.