
1LoL1
Members-
Posts
944 -
Joined
-
Last visited
Everything posted by 1LoL1
-
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)
-
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)
-
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.
-
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}
-
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)
-
Please anyone tell me if this is possible
-
This is what i need really thanks working now perfect!!!.
-
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)
-
i tried but not work and this is the code. Object i have in the code in x, y, z.
-
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)
-
You are right's. setElementHealth = only set Health car fixVehicle = repaired all
-
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]
-
Thanks working. But i again see warning.
-
Not work i don't see "TEXT" My code work normally but have 2 warning and i need change color to yellow.
-
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)
-
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)
-
Wrong section. This is English Section.
-
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)
-
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'].