-
Posts
6,097 -
Joined
-
Last visited
-
Days Won
218
Everything posted by IIYAMA
-
+ As the pairs loop can iterate over all kinds of keys, it might not loop the items in order. local table = { "item1", "item2", "item3" } for key, data in pairs(table) do iprint(data) end The result could be: item2 item3 item1
-
Works for me on localhost. This might solve your issue: (use it when the browser has been created) focusBrowser ( webBrowser ) focusBrowser ( nil )
-
Here use this one, I created it a month ago. (it does also have a rotation effect, which makes it more alive) P.s 20 lines =D function dxDrawCircle3D(x, y, z, radius, width, color) if type(x) ~= "number" or type(y) ~= "number" or type(z) ~= "number" then return false end local radius = radius or 1 local width = width or 1 local color = color or tocolor(255,255,255,150) local startRotation = (getTickCount() % 5000 / 5000) * 360 for i=1, 18 do local pR1 = (((i-1)*20 + startRotation) * 3.141592653 * 2)/360 local pR2 = ((i*20 + startRotation) * 3.141592653 * 2)/360 local startX, startY = x + math.cos(pR1) * radius, y + math.sin(pR1) * radius local endX, endY = x + math.cos(pR2) * radius, y + math.sin(pR2) * radius dxDrawLine3D(startX, startY, z, endX, endY, z, color, width) end return true end
-
You might be able to do it with: https://wiki.multitheftauto.com/wiki/TriggerEvent triggerEvent("onPlayerChat", player, "HI, I AM YOUR MOTHER!", 0) It is a kind of hack for your tag system, but should be possible. onPlayerChat parameters: string message, int messageType
-
With this: https://wiki.multitheftauto.com/wiki/DxDrawMaterialLine3D Read the requirements, syntax and example very carefully.
-
Hmm strange, should be placed correctly according to wiki. And if you replace the getVehicleComponentPosition line with these two lines: local offsetX, offsetY, offsetZ = getVehicleComponentPosition ( vehicle, "exhaust_ok", "root" ) x,y,z = getPositionFromElementOffset(vehicle, offsetX, offsetY, offsetZ) And add this at the bottom function getPositionFromElementOffset(element,offX,offY,offZ) local m = getElementMatrix ( element ) -- Get the matrix local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] -- Apply transform local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z -- Return the transformed point end
-
So it is actually working. fxAddGunshot(x, y, z, -10, 0, 0, true) fxAddSparks(x, y, z, -10, 0, 0) fxAddBulletImpact(x, y, z, -10, 0, 0, 2, 15, 5) fxAddTankFire(x, y, z, -10, 0, 0) Set all offsets to 0. And adjust them little by little. 1 unit is A LOT. (1.5/2 units is ~ the height of a ped) So use small steps like: 0.1 or 0.05 Rotating particles, I am not going to do that for you, because it takes me too much time for me to get it right. Sorry.
-
DEBUG< I didn't add those lines for nothing.
-
local lastGear addEventHandler("onClientRender", root, function() local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then local gear = getVehicleCurrentGear(vehicle) if gear ~= lastGear then iprint("gear isn't the same as last gear") triggerEvent("onClientVehicleGearChange", vehicle, gear) lastGear = gear local x,y,z if getVehicleComponents(vehicle).exhaust_ok then x,y,z = getVehicleComponentPosition ( vehicle, "exhaust_ok", "world" ) iprint("found exhaust_ok component on vehicle")-- debug else x,y,z = getElementPosition(vehicle) iprint("can't find exhaust_ok component on vehicle")-- debug end fxAddGunshot(x, y+0.5, z+1, -10, 0, 0, true) fxAddSparks(x, y+0.5, z+1, -10, 0, 0) fxAddBulletImpact(x, y+0.5, z+1, -10, 0, 0, 2, 15, 5) fxAddTankFire(x, y, z, -10, 0, 0) local sound = playSound3D("untitled.mp3", x, y, z, true) setSoundVolume(sound, 1) setSoundMaxDistance(sound, 100) end end end) -- prevent the trigger to activate after entering a vehicle. addEventHandler("onClientPlayerVehicleEnter", localPlayer, function (vehicle) lastGear = getVehicleCurrentGear(vehicle) end) Untested, if it doesn't work, please debug properly. You could have guessed it... As it is just a language like English, with different rules.
-
hmm local x,y,z if getVehicleComponents(vehicle).exhaust_ok then x,y,z = getVehicleComponentPosition ( vehicle, "exhaust_ok", "world" ) iprint("found exhaust_ok component on vehicle")-- debug else x,y,z = getElementPosition(vehicle) iprint("can't find exhaust_ok component on vehicle")-- debug end OR (get the back of the vehicle) --local x,y,z = getElementPosition(vehicle) local x0, y0, z0, x1, y1, z1 = getElementBoundingBox ( vehicle ) -- test which one is ~ correct. x,y,z = getPositionFromElementOffset(vehicle, (x0 + x1) / 2, y0, z0) -- or x,y,z = getPositionFromElementOffset(vehicle, (x0 + x1) / 2, y1, z1) -- or x,y,z = getPositionFromElementOffset(vehicle, x0, (y0 + y1) / 2, z0) -- or x,y,z = getPositionFromElementOffset(vehicle, x1, (y0 + y1) / 2, z1) function getPositionFromElementOffset(element,offX,offY,offZ) local m = getElementMatrix ( element ) -- Get the matrix local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] -- Apply transform local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z -- Return the transformed point end
-
@swag_k_dog Why creating a new topic for only this? And you didn't even say thank you for my help, are you that inhuman or what? local lastGear addEventHandler("onClientRender", root, function() local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then local gear = getVehicleCurrentGear(vehicle) if gear ~= lastGear then triggerEvent("onClientVehicleGearChange", vehicle, gear) lastGear = gear local x,y,z = getElementPosition(vehicle) local sound = playSound3D("untitled.mp3", x, y, z, true) setSoundVolume(sound, 1) setSoundMaxDistance(sound, 100) outputChatBox("test") end end end) -- prevent the trigger to activate after entering a vehicle. addEventHandler("onClientPlayerVehicleEnter", localPlayer, function (vehicle) lastGear = getVehicleCurrentGear(vehicle) end)
-
local lastGear addEventHandler("onClientRender", root, function() local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then local gear = getVehicleCurrentGear(vehicle) if gear ~= lastGear then triggerEvent("onClientVehicleGearChange", vehicle, gear) lastGear = gear end end end) -- prevent the trigger to activate after entering a vehicle. addEventHandler("onClientPlayerVehicleEnter", localPlayer, function (vehicle) lastGear = getVehicleCurrentGear(vehicle) end) You could try this. (clientside)
- 1 reply
-
- 1
-
-
Please. Add more debug lines. Do a hard refresh. (/refreshall) Because if an export goes wrong, there is NO WAY you get no error/warning. Unless the export code hasn't been executed OR it has been executed but the code that should show this indication doesn't work.
-
Can you script or not? Because this the scripting section. If you make a small attempt with the light element, then I will help you further.
-
Did you add the export child/tag in your meta.xml as well? (from the resource that contains that function) https://wiki.multitheftauto.com/wiki/Call <export function="createWindow" type="server"/>
-
You could also try this: https://wiki.multitheftauto.com/wiki/CreateLight Skygraphy. (z.j.). From the Idea to the Finished Product [Foto]. Geraadpleegd van http://www.skygraphy.com/cp-lifecycle Not sure if it works.
-
You didn't check the whitelist, pfff local screenWidth, screenHeight = guiGetScreenSize() function webBrowserRender() dxDrawImage(0, 0, screenWidth, screenHeight, webBrowser, 0, 0, 0, tocolor(255,255,255,255), true) end requestBrowserDomains({ "www.facebook.com" }, false) local facebookWasAccepted local webBrowser = createBrowser(screenWidth, screenHeight, false, false) addEventHandler('onClientBrowserCreated',webBrowser, webBrowserCreated) addEventHandler("onClientBrowserWhitelistChange", root, function (newDomains) if not facebookWasAccepted then for i=1, #newDomains do if newDomains[i] == "www.facebook.com" then facebookWasAccepted = true break end end if facebookWasAccepted then loadBrowserURL(webBrowser,'https://www.facebook.com/iulian.macovei.904/videos/1932180010376910/') end end end) function webBrowserCreated () addEventHandler('onClientRender',root,webBrowserRender) if not isBrowserDomainBlocked("www.facebook.com") then loadBrowserURL(webBrowser,'https://www.facebook.com/iulian.macovei.904/videos/1932180010376910/') facebookWasAccepted = true end end
-
Did you check if this video is available without being logged in? Afaik, you shouldn't be able to view Facebook video's if you aren't.
-
Then you post your code, as simple as that...
-
You can render it as well, see example: 'Local example' https://wiki.multitheftauto.com/wiki/CreateBrowser
-
setServerPassword("") nil should be working too. Try to give the resource admin rights.
-
You could use this: https://wiki.multitheftauto.com/wiki/IsChatBoxInputActive
-
for i = 1, #Blips do local blip = Blips[i] if isElement(blip) then destroyElement(blip) end end Please also take a look at: (which can come in handy if you want to destroy multiple elements in once) If you destroy a parent element, all child elements will also be destroyed.
-
Only one wheel is returned with getVehicleComponents
IIYAMA replied to Dzsozi (h03)'s topic in Scripting
the effectDestroyTimer Is global. (not sure if that is the problem, but will have influence.) How does the script know that it has to create the effect? Because that sounds more like your problem. (the trigger itself) -
Only one wheel is returned with getVehicleComponents
IIYAMA replied to Dzsozi (h03)'s topic in Scripting
You can't figure out why you used the same variable name? You got to be kidding me. Just remove the second loop and debug your code.
