Jump to content

Kazafka

Members
  • Posts

    143
  • Joined

  • Last visited

Everything posted by Kazafka

  1. Hi! I wanted to ask a simple question: Assuming that vehicle's 3rd and 4th colors are free to use, are there any wheel models that could potentially use these color channels to alter their colors? Thanks in advance!
  2. I wanted to ask if you can access variable x from scrip1.lua in script2.lua. The thing is that I have a special variable in a script that loads an XML file, and I wanted to create another script specifically for commands, and in it I wanted to acces the special variable.
  3. Little question, I don't know why, but when I start this resource and spawn any car, I can't hear ANYTHING. May it be a problem with my server, or it is a temporary problem with resource?
  4. Well, problem is, that whenever I start the resource and spawn a new vehicle, I have NO sounds. I mean, I was using bengines a long time ago before, and it played custom engine sounds. Now, it doesn't.
  5. No, it doesn't affect the audio. EDIT#1: I've tested that before in normal GTA San Andreas. If engine type of cars in San Andreas would make a difference (e.g. in sound, acceleration, etc.), I wouldn't start this thread.
  6. Hello, Me and my friend are trying to play together on my MTA server. When he downloads almost all the resources and etc. he gets kicked out for this: Anyone does know what may cause this?
  7. Unfortunately, nope. I mean, when I use setWorldSoundEnabled I can't hear engine sound of a Bullet, driven by my friend.
  8. Hello! I'm back after a big break. I began playing on my MTA server again. Today, I tried to add electric cars to my server. It's almost done, but there is still only one thing left to achieve. Well, I am trying to disable ALL engine sounds, for electric cars, to make them more realistic. So, I've looked up for some resources, nothing helped. setWorldSoundEnable - I don't know if this function can disable sounds for a specific entity, I only know, that it completely disables all sounds from a specific world sound group. Any ideas?
  9. Multi Theft Auto still surprises me with it's possibilities. Well, what would I expect from R* games themselves... Thank you! The resource that you have gave me is really cool and does the job, but, when I press the control for the mirror, the game starts being laggy...
  10. Hi! I wasn't active for quite a long time, because I started playing GTA V. So I'm back with yet another question! Well, I wanted to know, if there is any way to get, and optionally view it with DX or something, what player camera sees in the moment... The cause of this, is because I wanted to make a mirror for the cars, so players can easily see what's behind them. Of course, I wanted to add this feature to my whole car system, which's for now including a complete loader for custom shops, speedometer, supported RGB colors and upgrades when saving and reading car info, etc. BTW, i dont know why, but when i posted this question first, my browser stopped working and the post actually has been added to the forum, sorry for this duplicate. Any ideas?
  11. Here you go: To convert string like "element one, element two, element three" to table, you do: str = "element one, element two, element three" tab = string.split(string, ", ") To convert table like {"element one", "element two", "element three"} back, to string you do: tab = {"element one", "element two", "element three"} str = table.concat(tab, ", ") Hope I helped you too!
  12. Well, i converted this table: {1015, 1008, 1087, 1086, 1084} To this string using table.concat(): "1015, 1008, 1087, 1086, 1084" Now, how can I un-concat this string, to make it table again?? Any ideas? CLOSE THIS TOPIC, I HAVE AN ANSWER!!!
  13. After many tries, I got actually half of my question answered, but still how to do from this: 1001, 1086, 1025 To this: { 1001, 1086, 1025 } Any ideas?
  14. Yet another question, how to fix this weird ugly clamp, etc.: [click] (minimap on left-bottom corner). I am using this code: [click].
  15. Ok, im trying right now with another render target.
  16. Code: function getElementSpeed(theElement, unit) -- Check arguments for errors assert(isElement(theElement), "Bad argument 1 @ getElementSpeed (element expected, got " .. type(theElement) .. ")") local elementType = getElementType(theElement) assert(elementType == "player" or elementType == "ped" or elementType == "object" or elementType == "vehicle" or elementType == "projectile", "Invalid element type @ getElementSpeed (player/ped/object/vehicle/projectile expected, got " .. elementType .. ")") assert((unit == nil or type(unit) == "string" or type(unit) == "number") and (unit == nil or (tonumber(unit) and (tonumber(unit) == 0 or tonumber(unit) == 1 or tonumber(unit) == 2)) or unit == "m/s" or unit == "km/h" or unit == "mph"), "Bad argument 2 @ getElementSpeed (invalid speed unit)") -- Default to m/s if no unit specified and 'ignore' argument type if the string contains a number unit = unit == nil and 0 or ((not tonumber(unit)) and unit or tonumber(unit)) -- Setup our multiplier to convert the velocity to the specified unit local mult = (unit == 0 or unit == "m/s") and 50 or ((unit == 1 or unit == "km/h") and 180 or 111.84681456) -- Return the speed by calculating the length of the velocity vector, after converting the velocity to the specified unit return (Vector3(getElementVelocity(theElement)) * mult).length end function isElementOutSide(elem) if elem then if getElementInterior(elem) == 0 then return true else return false end else return false end end pliki = { mapa = "files/map.png", --Domyślna tekstura mapy gracz = "files/player.png", --Domyślna tekstura gracza } hud = { szer = 320, --Długość i wysokość radaru, tego nie zmieniamy pod żadnym pozorem przez = 200, --Przeźroczystość unit = 3000 / 6000, --Unity, radzę nie zmieniać wiel = 320, --Wielkość mapy, też radzę nie zmieniać rot = true --Obrót minimapki } ustawienia = { dispHud = true, --Wyświatlaj mapę current_minimap = 2 --Obecna tekstóra minimapy } deweloper = { false, --Opcja dewelopera #1 false, --Opcja dewelopera #2 false --Opcja dewelopera #3 } addEventHandler("onClientResourceStart", resourceRoot, function() setPlayerHudComponentVisible("radar", false) minimap = dxCreateRenderTarget(hud.szer, hud.szer, true) full = dxCreateRenderTarget(hud.szer + 5, hud.szer + 5, true) end) addEventHandler("onClientResourceStop", resourceRoot, function() setPlayerHudComponentVisible("radar", true) end) addEventHandler("onClientRender", root, function() if ustawienia.dispHud then local w, h = guiGetScreenSize() local x, y, z = getElementPosition(localPlayer) local rx, ry, rz = getElementRotation(localPlayer) local x = x * hud.unit local y = y * hud.unit if deweloper[1] then outputChatBox(tostring(x) .. ", " .. tostring(y)) end dxSetRenderTarget(minimap, false) dxSetBlendMode("blend") local zeroX = 1314 local zeroY = 1322 local mapX = x + zeroX + 15 local mapY = y + zeroY local zoneX, zoneY, zoneZ = getElementPosition(localPlayer) if isElementOutSide(localPlayer) then dxDrawImageSection(0, 0, hud.wiel, hud.wiel, mapX, mapY, hud.wiel, hud.wiel, pliki.mapa, 0, 0, 0, tocolor(255, 255, 255, hud.przez)) else dxDrawImageSection(0, 0, hud.wiel, hud.wiel, mapX, mapY, hud.wiel, hud.wiel, pliki.int, 0, 0, 0, tocolor(255, 255, 255, hud.przez), "nil") end if deweloper[3] then outputChatBox(tostring(getElementInterior(localPlayer))) end dxDrawImage(hud.szer / 2, hud.szer / 2, 20, 20, pliki.gracz, 180 + rz, 0, 0, tocolor(255, 255, 255, hud.przez)) dxSetRenderTarget(full, false) if hud.rot then dxDrawImage(1, h - hud.szer - 1, hud.szer, hud.szer, minimap, rz) else dxDrawImage(1, h - hud.szer - 1, hud.szer, hud.szer, minimap) dxDrawRectangle(0, h - hud.szer - 5, hud.szer + 5, 5, tocolor(0, 0, 0, hud.przez)) dxDrawRectangle(hud.szer, h - hud.szer, 5, hud.szer, tocolor(0, 0, 0, hud.przez)) end dxSetRenderTarget() dxDrawImage(0, h - hud.szer, hud.szer + 5, hud.szer + 5, full) dxDrawRectangle(0, h - hud.szer, 170, 20, tocolor(0, 0, 0, hud.przez)) if isElementOutSide(localPlayer) then dxDrawText(getZoneName(zoneX, zoneY, zoneZ), 5, h - hud.szer + 2, 0, 0, tocolor(255, 255, 255, hud.przez), 1.0, 1.0, "default"--[[, "left", "top", false, false, false, false, false, rz]]) else dxDrawText("Interior number " .. tostring(getElementInterior(localPlayer)), 5, h - hud.szer, 0, 0, tocolor(255, 255, 0, hud.przez), 1.0, 1.0, "default-bold"--[[, "left", "top", false, false, false, false, false, rz]]) end dxSetTextureEdge(minimap, "border", tocolor(0, 0, 0, hud.przez)) end end) bindKey("n", "down", function() if isPlayerHudComponentVisible("radar") then setPlayerHudComponentVisible("radar", false) ustawienia.dispHud = true else setPlayerHudComponentVisible("radar", true) ustawienia.dispHud = false end end) Output is nothing.
  17. I mean, I have render target, and dxDraw widgets in it. And so, how can I hide parts of widgets, which are apart from edges of render target? Look at this: [click].
  18. Nope I've already managed it to work successfully, but thank you for recommendation!
  19. Maybe I asked in wrong way, maybe yes, maybe no. But the point is, that the image I am rendering has set 0, 0 pos into left upper corner, not in the middle of it. So maybe I need to set center of image, but I don't know how.
  20. I mean, how do I can show exact image section, that player is standing on in the real world now, using dxDrawImageSection()? Like, when mini map is in size of 3000px by 3000px, how to show exact same pos, that local player is on? I tried a lot with: local x, y = getElementPosition(localPlayer) local x = (x * hud.width) / 3000 local y = (y * hud.height) / 3000 --Rest of code or hud.units = 3000 / 6000 local x, y = getElementPosition(localPlayer) local x = x * hud.units local y = y * hud.units --Rest of code (I even tried with just): lo local x, y = getElementPosition(localPlayer) --Rest of code But I guess, that I'm showing w r o n g image section. How can I fix it, or make it better? I tried to understand others' code, but I couldn't. So, I'm writing my, but still, I need some help. So how can I fix something? BTW, if someone want to see full code, please, visit here: [click, Code v2]. And if you will manage something, please, share it with me, I want to learn how to do something correctly.
  21. K, that helped. I didnt knew about it :O
×
×
  • Create New...