Jump to content

Hydra

Members
  • Posts

    372
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Hydra

  1. Version 1.4.0(WIP) - Added coronas and lighting for the objects that don't have it
  2. UPDATED Current Version: 1.3.0 News: - Added more lights - Exact colors for different lampposts - Now all the lampposts have the new lighting Download from here: https://community.multitheftauto.com/?p=resources&s=details&id=18637
  3. because I don't want others to edit it
  4. Just an example: local blips = {} function onJoin() if not blips[source] then blips[source] = createBlipAttachedTo(etc...) end end addEventHandler("onPlayerJoin", root, onJoin) function onQuit() if blips[source] then blips[source] = nil destroyElement(blips[source]) end end addEventHandler("onPlayerQuit", root, onQuit) function hideBlip(thePlayer, command) if blips[thePlayer] then setBlipColor(blips[thePlayer], r, g, b, 0) end end addCommandHandler("hideblip", hideBlip) you can use https://wiki.multitheftauto.com/wiki/IsObjectInACLGroup or https://wiki.multitheftauto.com/wiki/IsPlayerInACL(the same thing but the 2nd is shorter) to check if the player is an admin.
  5. As the title says, I made a new lighting system for the lampposts, this script is still in working and some lampposts may not have that reflection. About The default command to enable/disable the lighting system is /lighting. The default color for the lampposts is 255, 167, 0 at the moment The reflection has a smooth fade in/out effect Current script version: v1.2 Video First video: Download Link (MTA Community): https://community.multitheftauto.com/index.php?p=resources&s=details&id=18637 EDIT (02.10.2023) For newcomers, this resource is outdated and abandoned
  6. All the info about the resource is in the video description.
  7. Un mod mai usor de detectat daca un element este un obiect sau nu: function isElementObject(element) if isElement(element) and getElementType(element) == "object" then return element end end
  8. function disableClouds() setCloudsEnabled(false) end addEventHandler("onClientResourceStart", resourceRoot, disableClouds) or put setCloudsEnabled(false) directly at the beginning of the code. also you can make it with command: local cloudsState = false function clouds() if cloudsState == false then cloudsState = true setCloudsEnabled(true) elseif cloudsState == true then cloudsState = false setCloudsEnabled(false) end end addCommandHandler("clouds", clouds)
  9. Plin de buguri cand s-a lansat dar am vazut ca au facut actualizari la el care chiar au fixat unele chestii. Daca o tin tot asa poate merita cumparat la un pret mai mic desigur, 60 de EURO este cam mult pentru niste jocuri din 2004 chiar daca is remastere. Si in plus ca unreal engine le-a facut toata treaba la shadere pentru ca erau default deci nu se merita 60 de euro.
  10. use setElementVisibleTo if you want to make an element visible to an another element. setElementVisibleTo ( element theElement, element visibleTo, bool visible )
  11. O simpla functie care te ajuta sa salvezi coordonatele tale intr-un fisier .txt: function pos(thePlayer, command) local x, y, z = getElementPosition(thePlayer) if not fileExists("posave.txt") then local pathFile = fileCreate("posave.txt") fileClose(pathFile) elseif fileExists("posave.txt") then local openFile = fileOpen("posave.txt") local sizeFile = fileGetSize(openFile) local dataFile = fileRead(openFile, sizeFile) fileWrite(openFile, "\n"..x..", "..y..", "..z.."") outputChatBox("Saved: "..x..", "..y..", "..z.."", root, 255, 255, 255, true) fileClose(openFile) end end addCommandHandler("gpos", pos) O functie care iti zice daca se aude sunetul sau nu: Poate fi gasita si aici: https://wiki.multitheftauto.com/wiki/IsSoundPlaying function isSoundPlaying(theSound) return (getSoundPosition(theSound)) end O functie care iti zice daca elementul este in aer sau nu: Poate fi gasita si aici: https://wiki.multitheftauto.com/wiki/IsElementInAir --// Varianta 1 (Valoarea default este 10) function isElementInAir(element) local x, y, z = getElementPosition(element) if element and isElement(element) then if z >= 10 then return z end end end --// Varianta 2 (Pui tu valoare la Z) function isElementInAir(element, ZPos) local x, y, z = getElementPosition(element) if element and isElement(element) then if z >= tonumber(ZPos) then return z end end end O functie care creeaza un dreptunghi 3D deasupra jucatorului: Poate fi gasita si aici: https://wiki.multitheftauto.com/wiki/DxDrawRectangleOnPlayer function dxDrawRectangleOnPlayer(x, y, width, height, color) local players = getElementsByType("player", root, true) if players then local x, y, z = getElementPosition(localPlayer) for _, v in ipairs(players) do if v and isElement(v) then local px, py, pz = getElementPosition(v) if getDistanceBetweenPoints3D(x, y, z, px, py, pz) <= 20 then local sx, sy = getScreenFromWorldPosition(px, py, pz + 1.3) if sx and sy then dxDrawRectangle(sx + x, sy + y/1.6, width, height, color, false) end end end end end end
  12. Thank you for the answer. I know about onSettingChange and I use it in the resource and it's working fine(I get the old and the new values). I will do what you said, killing the timer and make another one.
  13. So I made a setting in meta but it's not working when I change the values. What I did wrong? meta.xml <settings> <setting name="*outputNewsTimer" value="10000" friendlyname="Messages Timer" group="General" accept="100,10000,50000" desc="set news timer" /> </settings> server.lua local timerMessages = get("outputNewsTimer") function showMessages() if timerMessages then local randomMsg = messages[math.random(1, #messages)] outputChatBox("#FFBB00[NEWS]: #FFFfff"..randomMsg.."", root, 255, 255, 255, true) else set("outputNewsTimer", 10000) end end setTimer(showMessages, timerMessages, 0)
  14. onClientGUIClick guiSetText
  15. Yea, I want to get the count of users from discord server in mta. Sorry for my bad english btw.
  16. Hello, it is possible to get the members count from a discord server on mta using webhook?
  17. If you want to create your panel in GUI then you will need: --// Functions: guiCreateWindow() - for windows guiCreateButton() - for buttons guiCreateStaticImage() - for images guiSetVisible() playSound() - for music stopSound() - to stop the music bindKey() - to bind a key to open/close the gui --// Events: onClientGUIClick - when you click the button If you want to create your panel in DX then you will need: --// Functions dxDrawRectangle() - create window or buttons dxDrawImage() - create images dxDrawText() - create texts playSound() - for music stopSound() - to stop the music bindKey() isMouseInPosition() --// Events onClientRender - to render dx elements onClientClick - when you click an dx element using isMouseInPosition()
  18. The other informations are not showing because you didn't put any getElementData for them Example: local getJob = getElementData(localPlayer, "myJob") or "N/A" dxDrawText("Munkád: "..getJob.."", x - 335, y - 600 , sx - 20, y, tocolor(255, 255, 255), 1, Lato, "left", "center")
×
×
  • Create New...