Jump to content

1LoL1

Members
  • Posts

    944
  • Joined

  • Last visited

Everything posted by 1LoL1

  1. 1LoL1

    Solved

    Yeah I looked over the table in setElementData setElementData(source, "all", {r,g,b}) -- this has to be source instead of sorce probably addEventHandler("onVehicleEnter", getRootElement(), function (player) local colors = getElementData(player, "all") -- by calling it r, g, b you use 3 variables but the table only needs 1 local r, g, b = unpack(colors) -- here you go from 1 table to 3 variables setVehicleHeadLightColor(source, r, g, b) end) When i use your code i have this error: bad argument #1 to 'unpack' (table expected, got nil) addCommandHandler("colors", function (source) local colors = getElementData(source, "all") local r, g, b = unpack(color) outputChatBox("Colors: "..r..", "..g..", "..b.."", source, 255, 255, 255, true) end)
  2. 1LoL1

    Solved

    Don't needed full code can be this: setElementData(sorce, "all", r,g,b) addEventHandler("onVehicleEnter", getRootElement(), function (player) local r, g, b = getElementData(player, "all") local r, g, b = unpack(r, g, b) setVehicleHeadLightColor(source, r, g, b) end end)
  3. 1LoL1

    Solved

    Errors is in this examples..
  4. 1LoL1

    Solved

    Yes it is added. Where's your full code? we cant help you without your code Don't needed full code.. i want only example how i can 3x getElementData in 1x getElementData.
  5. 1LoL1

    Solved

    Yes it is added.
  6. 1LoL1

    Solved

    That error you got: Bad argument @ 'getElementData' [Expected bool at argument 3, got number '0'] That was because of your last line 'getElementData', getElementData only needs the element and the data. (source and "all") Where you do have to use 3 parameters are with SET (setElementData(source, "all", colors) For example; addEventHandler("onMarkerHit", markerName, function() local r, g, b = getVehicleColor(vehicle, true) setElementData(vehicle, "color", {r, g, b}) end) -- and later on addEventHandler("onMarkerHit", marker2Name, function() local x, y, z = unpack(getElementData(vehicle, "color") setVehicleColor(vehicle, x, y, z) end) If i'm right at least, btw it's just a random example. Not work Bad argument #1 to 'unpack' (table expected, got string) i think i need this local r, g, b = {r, g, b}
  7. Try this: addCommandHandler("flyman", function (target, command) local target = getPlayerFromName(target) if (target) then if (isVehicleOnGround(getPedOccupiedVehicle(target)) == true) then local sx, sy, sz = getElementVelocity (getPedOccupiedVehicle(target)) setElementVelocity(getPedOccupiedVehicle(target), sx+0.5, sy, sz+0.6 ) end end end)
  8. 1LoL1

    Solved

    Please anyone tell me if this is possible
  9. 1LoL1

    Solved

    This is what i need really thanks working now perfect!!!.
  10. 1LoL1

    Solved

    i tried but not work and this is the code. Object i have in the code in x, y, z. Code: addEventHandler("onClientRender", getRootElement(), function () local x = -2844.7275390625 local y = 1290.7978515625 local z = 7.1015625 local X, Y = getScreenFromWorldPosition(x,y,z) local px, py, pz = getElementPosition(getLocalPlayer()) local distance = getDistanceBetweenPoints3D(x,y,z,px,py,pz) if (distance < 10) then if (X and Y) then dxDrawText("Mechanic", X-30, Y-50, _, _,tocolor(255,255,255,255), 1, "default", "left", "top", false, false, false, false, false) end end end)
  11. 1LoL1

    Solved

    i tried but not work and this is the code. Object i have in the code in x, y, z.
  12. 1LoL1

    Solved

    One question. Is possible of this: to ? If yes here is code: addEventHandler("onClientRender", getRootElement(), function () local x = -2844.7275390625 local y = 1290.7978515625 local z = 7.1015625 local X, Y = getScreenFromWorldPosition(x,y,z) local px, py, pz = getElementPosition(getLocalPlayer()) local distance = getDistanceBetweenPoints3D(x,y,z,px,py,pz) if (distance < 10) then if (X and Y) then dxDrawText("Mechanic", X, Y - 100, X, Y,tocolor(255,255,255,255)) end end end)
  13. You are right's. setElementHealth = only set Health car fixVehicle = repaired all
  14. 1LoL1

    Solved

    Thanks Working perfect!!!.
  15. 1LoL1

    Solved

    Which warning? post it here Sorry warnings* WARNING: Bad argument @ 'dxDrawText' [Expected vector2 at argument2, got boolean] WARNING: Bad argument @ 'dxDrawText' [Expected vector2 at argument2, got boolean] [DUP x264]
  16. 1LoL1

    Solved

    Thanks working. But i again see warning.
  17. 1LoL1

    Solved

    Not work i don't see "TEXT" My code work normally but have 2 warning and i need change color to yellow.
  18. 1LoL1

    Solved

    Hello, i have this script why i have this error? and how i can change color of dxDrawText to yellow? Please can anyone help me? Warnings: WARNING: Bad argument @ 'dxDrawText' [Expected vector2 at argument2, got boolean] WARNING: Bad argument @ 'dxDrawText' [Expected vector2 at argument2, got boolean] [DUP x264] addEventHandler("onClientRender", getRootElement(), function () for k,veh in pairs(getElementsByType("vehicle")) do if isElementOnScreen(veh) then local x, y, z = getElementPosition(veh) local X, Y = getScreenFromWorldPosition(x,y,z) local px, py, pz = getElementPosition(getLocalPlayer()) local test = getDistanceBetweenPoints3D(x,y,z,px,py,pz) if test < 40 then dxDrawText("TEXT", X, Y) end end end end)
  19. 1LoL1

    Solved

    So how i can fix? Please anyone?
  20. 1LoL1

    Solved

    So how i can fix?
  21. 1LoL1

    Question

    What is 'Anti DM' ?
  22. 1LoL1

    Solved

    ok i have now this: setElementData(player, "all", ""..r..", "..g..", "..b.."") -- Work and this too: local all = getElementData(source, "all") -- Work and here too: local all = getElementData(player, "all") local r, g, b = unpack(tostring(all)) setVehicleHeadLightColor(source, r, g, b)
  23. Wrong section. This is English Section.
  24. 1LoL1

    Solved

    When i want use getElementData i have this warning: Bad argument @ 'getElementData' [Expected bool at argument 3, got number '0'] local all = getElementData(source, "all") local r, g, b = unpack(all) local wtf = r, g, b local ttt = getElementData(source, "all", wtf)
  25. 1LoL1

    Solved

    Hello, is possible 3x getElementData in 1x getElementData? i mean this: local r = getElementData(source, "r") local g = getElementData(source, "g") local b = getElementData(source, "b") local all = getElementData(source, "all", r, g, b) When i go this i have this Error: Bad argument @ 'getElementData' [Expected bool at argument 3, got number '0'].
×
×
  • Create New...