Jump to content

IIYAMA

Moderators
  • Posts

    6,062
  • Joined

  • Last visited

  • Days Won

    208

Everything posted by IIYAMA

  1. Only one of them is in use, the other one is just faked, by attaching the weapon object to the ped his hand. Check this resource and it's example: https://community.multitheftauto.com/index.php?p=resources&s=details&id=2540
  2. addEventHandler("onPlayerJoin", root, function () -- he joins the server end) addEventHandler("onPlayerWasted", root, function () -- So sorry, please die again end) https://wiki.multitheftauto.com/wiki/SpawnPlayer @TorNix~|nR time to make your first attempt.
  3. Just add two new ones, for serverside and clientside. Or more if you want per functionality a file.
  4. Nice concepts, now please start coding your first attempts.
  5. Why don't you start with making the component to retrieve the upgrades first?
  6. How can we help you if we aren't allow to edit the code? The information is badly translated, I can't understand anything of it. Don't be a racist. It is really NOT OK to post racist content inside your code.
  7. AVG fps. AVG ping. Travel distance. Screenshots taken.
  8. You tell me, where is the serverside file?
  9. OH lol, waaaaaahhh!! This is NO good, hell no. =/ local newLvl = false function newLvlFunction() if not newLvl then setTimer(function() newLvl = false end,5000,1) end newLvl = true end addEvent( "onClientLevelUp", true ) addEventHandler( "onClientLevelUp", localPlayer, newLvlFunction) addEventHandler("onClientRender", root, function () if newLvl == true then dxDrawRectangle(screenW * 0.4083, screenH * 0.9037, screenW * 0.1839, screenH * 0.0528, tocolor(0, 0, 0, 160), false) dxDrawImage(screenW * 0.4094, screenH * 0.9046, screenW * 0.0271, screenH * 0.0491, ":DayZ/tools/images/flags/join.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("Congradulations! You have reached "..getElementData(getLocalPlayer(),"level").." Level!", screenW * 0.4385, screenH * 0.9046, screenW * 0.5901, screenH * 0.9537, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) end end) @Emix
  10. A little bit dirty, but this might work: local newLvl = false function newLvl() newLvl = true end addEvent( "onClientLevelUp", true ) addEventHandler( "onClientLevelUp", localPlayer, newLvl) addEventHandler("onClientRender", root, function () if newLvl == true then dxDrawRectangle(screenW * 0.4083, screenH * 0.9037, screenW * 0.1839, screenH * 0.0528, tocolor(0, 0, 0, 160), false) dxDrawImage(screenW * 0.4094, screenH * 0.9046, screenW * 0.0271, screenH * 0.0491, ":DayZ/tools/images/flags/join.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("Congradulations! You have reached "..getElementData(getLocalPlayer(),"level").." Level!", screenW * 0.4385, screenH * 0.9046, screenW * 0.5901, screenH * 0.9537, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) setTimer(function() newLvl = false end,5000,1) end end)
  11. The event you cancelled has no relationship with changing the skin, so that will not work. Use, over cancelEvent(). setElementModel( source, 0 ) And this part is incorrect: function tt() triggerServerEvent( "setplayermask", localPlayer, "zombie") if getElementModel( source ) == 308 then cancelEvent() end end addEventHandler ("onClientResourceStart", getResourceRootElement(getThisResource()), tt)
  12. Is(And to which skin afterwards?) OR on skin changed? Your code doesn't make sense and should be serverside to prevent de-sync.
  13. guiSetText(GUIEditor.edit[1], tostring(loadSavedData("username", "") or "")) guiSetText(GUIEditor.edit[2], tostring(loadSavedData("password", "") or ""))
  14. Want to learn some more? Did you ever tried to remove multiple items from a table using table.remove? If not, try it and see what happens. I will provide you with a solution to an issue you will encounter. Give it 10 items and remove 3 or more of them with your own conditions. Make sure that atleast two items are placed next to each other. Debug the table at the end. iprint(table)
  15. IIYAMA

    DX Image scaling

    If you convert them to textures. https://wiki.multitheftauto.com/wiki/DxCreateTexture And if you enable mipmaps, they are pretty good. Mipmaps will create multiple versions of the image of different scales. But remember, images ARE NOT vector files and SVG is not supported in mta.
  16. + 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
  17. Works for me on localhost. This might solve your issue: (use it when the browser has been created) focusBrowser ( webBrowser ) focusBrowser ( nil )
  18. 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
  19. 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
  20. With this: https://wiki.multitheftauto.com/wiki/DxDrawMaterialLine3D Read the requirements, syntax and example very carefully.
  21. 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
  22. 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.
  23. DEBUG< I didn't add those lines for nothing.
  24. 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.
  25. 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
×
×
  • Create New...