• Content Count

  • Joined

  • Last visited

  • Days Won


JeViCo last won the day on April 21 2018

JeViCo had the most liked content!

Community Reputation

79 Popular


About JeViCo

  • Rank

Recent Profile Visitors

1,774 profile views
  1. JeViCo

    fetchRemote problems

    thank you so much @IIYAMA i fixed my problem)
  2. JeViCo

    [HELP] How to fix this bug in render target?

    could you give us more info? When does it happen?
  3. JeViCo

    Set scale for weapon in hands

    @majqq You can't interact with weapons directly. You should do it in common software like Zmodeller (dff) - easy way OR you can make invisible texture, create and attach custom weapon object to yourself using bone_attach functions, replace texture using shaders to make them visible again and manage it - hard way
  4. JeViCo

    fetchRemote problems

    Hi there! I've recently discovered 2 problems: 1. I can't trigger fetchRemote inside another fetchRemote function. Example: fetchRemote("http_stuff",function(resp) -- everything OK here -- some magic here myfunc("some_args") end) function myfunc(args) fetchRemote("httpStuff_x2",function(resp2) print("done x2") end) -- it won't trigger but i'll see 'done x2' message end 2. i can't store information into variables inside fetchRemote func. Example: local variable fetchRemote("http_stuff",function(resp) -- everything OK here variable = resp print(variable) -- OK end) print(variable) -- nil I don't know what to do 📉
  5. JeViCo

    engineApplyShaderToWorldTexture For Vehicles

    you probably should make your own 'layer'. For example some vehicles have "remap" texture
  6. JeViCo

    Vehicle keep hp in zone

    you not defined specific colshape here function vehicleGodMod(player) if isPedInVehicle ( player ) and getPedOccupiedVehicleSeat( player ) == 0 then vehicle = getPedOccupiedVehicle ( player ) setVehicleDamageProof( vehicle, true ) outputChatBox ( "#FFFFFFVehicle godmode #00FF00enabled", getRootElement(), 255, 0, 0, true ) end end addEventHandler("onColShapeHit", root, vehicleGodMod) function vehicleGodMod2(player) if isPedInVehicle ( player ) and getPedOccupiedVehicleSeat( player ) == 0 then setVehicleDamageProof( vehicle, false ) outputChatBox ( "Vehicle godmode #FF0004disabled", getRootElement(), 255, 255, 255, true ) end end addEventHandler("onColShapeLeave", root, vehicleGodMod2) you should add if source == your_colshape then -- using colshape directly another idea (attach to elementData + useful function). Also, sorry) i forgot that onVehicleDamage doesn't have cancel effect so here (client-side): addEventHandler("onClientVehicleDamage",root,function() local col = isElementWithinAColShape(source) if col then if getElementData(col,"safe-zone") then cancelEvent() end end end) function isElementWithinAColShape(element) local element = element or localPlayer if element or isElement(element)then for _,colshape in ipairs(getElementsByType("colshape"))do if isElementWithinColShape(element,colshape) then return colshape end end end outputDebugString("isElementWithinAColShape - Element does not exist",1) return false end @Quenix, try both ideas and find out which one is better
  7. JeViCo

    I need a little advice with metatables

    thank you for your support 😁 i had some problems with my code. Now everything works amazing
  8. JeViCo

    I need a little advice with metatables

    now i have another problem :c elements don't want to destroy. I use destroyElement(window) then onClientElementDestroy triggers where i do some magic stuff and that's all. window variable is still userdata so element still exists 😕 or something wrong with my code
  9. JeViCo

    I need a little advice with metatables

    sorry for bothering you :с i solved this problem by using an additional table
  10. JeViCo

    Vehicle keep hp in zone

    @Quenix onVehicleDamage + isElementWithinColShape + cancelEvent() where colshape is your zone EVERYTNING SERVER-SIDE
  11. JeViCo

    I need a little advice with metatables

    @IIYAMA i returned :3 i figured everything out except for one: i use onClientRender event to draw DX window like that wnd.handlers.render = function() wnd:renderWindow() end addEventHandler("onClientRender", element, wnd.handlers.render) setElementData(element,"variable-data",wnd) but i can't do this because all functions disappear local dat = getElementData(source, "variable-data") removeEventHandler("onClientRender", root, dat.handlers.render) i don't know how to save them. Maybe i should not use elementData
  12. JeViCo

    I need a little advice with metatables

    What do you mean? It removed function once and spams now or what?
  13. JeViCo

    I need a little advice with metatables

    @IIYAMA same problem idk why 1-st lua file function destroyDX(element) local dx_type = getElementType(element) if dx_type == "dx-window" then JVwindow.destroy(source) elseif dx_type == "dx-button" then end end addEventHandler("onClientElementDestroy",root,function() if getElementData(source,"dxcore") == true then cancelEvent() destroyDX(source) end end) 2-nd lua file function JVwindow.destroy(element) local dat = getElementData(element, "variable-data") if #dat.main.related_elements > 0 then for _, el in ipairs(dat.main.related_elements) do destroyElement(el) end end removeEventHandler("onClientRender", root, dat.handlers.render) setmetatable(dat, nil) destroyElement(element) end errors: I thought cancelEvent() didn't work but nope print(element) returns userdata so element exists
  14. JeViCo

    Lua module installing?

    wtf why did i miss it, Thank you so much
  15. JeViCo

    Lua module installing?

    Can i install utf8 Lua module somehow? I need lua string-matching functions to use russian letters