Jump to content

Hydra

Members
  • Posts

    372
  • Joined

  • Last visited

  • Days Won

    11

Posts posted by Hydra

  1. On 28/12/2023 at 22:17, JamesDragon said:

    there's an issue with the isMouseInPosition function where it doesn't return false when the conditions aren't met. It's recommended to add a return false statement outside the if block to cover the case when the cursor isn't in the specified area:

    function isMouseInPosition(x, y, w, h)
        if isCursorShowing() then
            local sx, sy = guiGetScreenSize()
            local cx, cy = getCursorPosition()
            local cx, cy = (cx * sx), (cy * sy)
            if (cx >= x and cx <= x + w) and (cy >= y and cy <= y + h) then
                return true
            end
        end
        return false -- Add this line to return false if conditions aren't met
    end

     

    function isMouseInPosition ( x, y, width, height )
    	if ( not isCursorShowing( ) ) then
    		return false
    	end
    	local sx, sy = guiGetScreenSize ( )
    	local cx, cy = getCursorPosition ( )
    	local cx, cy = ( cx * sx ), ( cy * sy )
    	
    	return ( ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) )
    end

    Try this one

  2. On 30/10/2023 at 04:52, pedro157 said:

    hello I wanted to congratulate the mta developer that time this function Rich Presence mta was very cool but I came here to ask how I make it appear to the player who is in the dicord that he is playing on my server with name and logo

    local app_id = "my_app_id"
    
    addEventHandler("onClientResourceStart", resourceRoot, function()
        local name = getPlayerName(localPlayer)
        setDiscordApplicationID(app_id)
        if isDiscordRichPresenceConnected() then
           setDiscordRichPresenceAsset("your_app_logo_name", "This is my logo!")
           setDiscordRichPresenceSmallAsset("your_second_app_logo_name", "This is my second logo!")
           setDiscordRichPresenceState("In-game")
           setDiscordRichPresenceDetails("currently as "..name)
        end
    end)
    
    addEventHandler("onClientResourceStop", resourceRoot, function()
        resetDiscordRichPresenceData()
    end)

     

  3. Hello, I am selling my chatbox resource from a project I was working on

    Preview:


    Description:

    • Supports client/server side commands
    • Outputs default messages (player muted, player banned, etc..)
    • Press T to talk with all players
    • Press Y to talk with your team
    • Smooth fade in when a message is typed
    • Supports admin tags


    Contact & Info:
    Price: 15-20 euro, only paypal
    Contact: Gabriel45#6859 (Dirscord)

    • Like 2
  4. On 23/10/2023 at 21:53, Mr.FiFA said:

    Hello everyone , that's my very first post in this website , i really loved the community and the people and how they respond so fast
    - i Need y'all help :
    - i am now developing a server of mine and i had a issue , i made a rank and called it events , so this rank is for events and for making the server more fun
    i added derby mod to the server but the problem is when i get that rank to test it like to run the mod it says
    ACL : access denied for 'start'
    even when i added the

    <object name="resource.Derby"></object>
    it doesn't work
    that was my question and i hope y'all are going to give me a good answer
    😃

    Have you granted yourself admin access at least? To use commands like /start, /restart, /stop etc.. you must be an adminr or use the console for starting the resources. Also, if your resource contains commands that are used by the admins like the ones above, you will have to add <object name="resource.Derby"></object> in Admin ACL group

  5. You can use something more simplier

     

    --// Example
    local borderSize = 1
    
    dxDrawBorderedText(borderSize, etc..)
    function dxDrawBorderedText (outline, text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY)
        for oX = (outline * -1), outline do
            for oY = (outline * -1), outline do
                dxDrawText (text, left + oX, top + oY, right + oX, bottom + oY, tocolor(0, 0, 0, 255), scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY)
            end
        end
        dxDrawText (text, left, top, right, bottom, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, colorCoded, subPixelPositioning, fRotation, fRotationCenterX, fRotationCenterY)
    end

     

  6. Show your code, so people can help you. Only with an explanation, we have no way of knowing where the exact problem is. Also HTML colors must contain 6 characters like #FFBB00 

  7. Project:V

    Project:V este un server bazat pe modul de joc din GTA:V Online. Încercăm să aducem fiecare caracteristică din GTA V pe acest server pentru a crea ceva unic și de lungă durată. Serverul este încă în lucru, dar s-au făcut destul de multe progrese, nu voi posta fiecare actualizare aici și vă voi lăsa să mergeți la serverul nostru de discord pentru a vedea cum arată serverul în acest moment

    Screens:
    https://streamable.com/ghma0r
    https://streamable.com/vdffx6
    https://youtu.be/eRnhSLEADxI

    spacer.png
    spacer.png
    spacer.png

    Discord Server: https://discord.gg/XcPJeahDQE

    • Like 1
  8. You are not doing it correctly, it should be:
     

    function GripTyre()
        engineSetSurfaceProperties(9, "tyregrip", 255)
        engineSetSurfaceProperties(10, "tyregrip", 255)
        engineSetSurfaceProperties(11, "tyregrip", 255)
        engineSetSurfaceProperties(12, "tyregrip", 255)
        engineSetSurfaceProperties(13, "tyregrip", 255)
        engineSetSurfaceProperties(14, "tyregrip", 255)
        engineSetSurfaceProperties(15, "tyregrip", 255)
        engineSetSurfaceProperties(16, "tyregrip", 255)
        engineSetSurfaceProperties(17, "tyregrip", 255)
        engineSetSurfaceProperties(20, "tyregrip", 255)
        engineSetSurfaceProperties(80, "tyregrip", 255)
        engineSetSurfaceProperties(81, "tyregrip", 255)
        engineSetSurfaceProperties(82, "tyregrip", 255)
        engineSetSurfaceProperties(115, "tyregrip", 255)
        engineSetSurfaceProperties(116, "tyregrip", 255)
        engineSetSurfaceProperties(117, "tyregrip", 255)
        engineSetSurfaceProperties(118, "tyregrip", 255)
        engineSetSurfaceProperties(119, "tyregrip", 255)
        engineSetSurfaceProperties(120, "tyregrip", 255)
        engineSetSurfaceProperties(121, "tyregrip", 255)
        engineSetSurfaceProperties(122, "tyregrip", 255)
        engineSetSurfaceProperties(125, "tyregrip", 255)
        engineSetSurfaceProperties(146, "tyregrip", 255)
        engineSetSurfaceProperties(147, "tyregrip", 255)
        engineSetSurfaceProperties(148, "tyregrip", 255)    
        engineSetSurfaceProperties(149, "tyregrip", 255)
        engineSetSurfaceProperties(150, "tyregrip", 255)
        engineSetSurfaceProperties(151, "tyregrip", 255)
        engineSetSurfaceProperties(152, "tyregrip", 255)
        engineSetSurfaceProperties(153, "tyregrip", 255)
        engineSetSurfaceProperties(160, "tyregrip", 255)
        iprint("Tyre grip started")
    end
    addCommandHandler( "grip", GripTyre)

     

    • Like 1
  9. 15 hours ago, Lance_Delmago said:

    Then the question is, how do I get a first-person view by VORON 3.0 and add new cars to the mta without using fastman92?

    You can search for resources on this forum or its community:

    https://community.multitheftauto.com
    https://forum.multitheftauto.com/forum/87-resources/

    Or you can learn scripting and create your own first person mode


    For car mods you can download them from:
    https://www.gtainside.com/en/news.php
    https://www.gtaall.com

    Make a folder and create meta.xml client.lua files
    In meta.xml you will need to put:
     

    <meta>
    
    <script src="client.lua" type="client" />
    
    --// Now the mods
    <file src="themodname.dff" />
    <file src="themodname.txd" />
    
    </meta>

    In client.lua you will need to put:
     

    local dff = engineLoadDFF("themodname.dff")
    engineReplaceModel(dff, theIDForVehicle)
    
    local txd = engineLoadTXD("themodname.txd")
    engineImportTXD(txd, theIDForVehicle)
    
    
    --// Example replacing infernus
    
    local dff = engineLoadDFF("infernus.dff")
    engineReplaceModel(dff, 411)
    
    local txd = engineLoadTXD("infernus.txd")
    engineImportTXD(txd, 411)

    You can see all vehicles ID's on these websites:
    https://wiki.multitheftauto.com/wiki/Vehicle_IDs
    http://weedarr.wikidot.com/veh


    I hope you understood what I explained to you and if you still have problems enter the official discord server to get more detailed help
    Official MTA Discord: https://discord.gg/mtasa

  10. You have a variable called g_peso, but it doesn't exist in your script.
    Also instead of
     

    dxDrawRectangle(x-4, y-4 -sroll,52, 53, i == selected and dxDrawImage(x-4, y-4 -sroll,52, 53, "assets/img/slot-effect.png") or scrollColor)

    Change in:
     

    dxDrawRectangle(x-4, y-4 -sroll,52, 53, tocolor(255, 255, 255, 255), false)
    dxDrawImage(x-4, y-4 -sroll,52, 53, "assets/img/slot-effect.png", 0, 0, 0, scrollColor, false)

    Furthermore, I can't help you with your script. From what I can see, it's not something you did and it's from a gamemode on the net, maybe I'm wrong but this is how I see it

  11. 29 minutes ago, lima said:
    because this code is inside the render.

    Even if it's inside a render you are using it wrong. You have dxDrawRectangle(x-4, y-4 -sroll,52, 53, i == selected and dxDrawImage(x-4, y-4 -sroll,52, 53,"assets/img/slot-effect.png") or scrollColor). Calling dxDrawImage inside dxDrawRectangle it is not possible according to my experience and that is why you have errors in your code. But wait for more answers maybe there are people that disagree with me. My advice is to use them separate, I hope you understood what I was talking
     

  12. 15 minutes ago, lima said:

    my code

    dxDrawRectangle(x-4, y-4 -sroll,52, 53, i == selected and dxDrawImage(x-4, y-4 -sroll,52, 53,"assets/img/slot-effect.png") or scrollColor)

     

    error : Bad argument   @     'dxDrawRectangle'    [expected number at argument 5 , got boolean]

    Almost nothing you posted can be understood.
    The correct way to use dxDrawRectangle and dxDrawImage is:
     

    dxDrawRectangle(posX, posY, width, height, color, postGUI)
    dxDrawImage(posX, posY, width, height, imagePath, rotationX, rotationY, rotationZ, color, postGUI)

     

  13. Cu aceasta functie vei putea detecta daca un jucator/npc foloseste o animatie sau nu
     

    Exemplu:
    bindKey("i", "down", function()
        if isPedDoingAnim(localPlayer) then
           outputChatBox("Folosesti o animatie", 255, 255, 255, true)
        else
           outputChatBox("Nu folosesti o animatie", 255, 255, 255, true)
        end
    end)
    
    
    function isPedDoingAnim(theElement)
       if isElement(theElement) and getElementType(theElement) == "ped" or getElementType(theElement) == "player" then
          local block, anim = getPedAnimation(theElement)
          if block ~= nil and anim ~= nil then
             return true
          else
             return false
          end
       end
    end

     

    • Like 1
  14. 10 hours ago, pedro157 said:

    Good morning, good evening, good afternoon, I need some help to counter hacks for my server. Lots of hacks here in Brazil! servers are simply being taken down by hacks. I have some resources against hacks but it's not enough I wanted to know how I can do to put this function that the player is kicked out by the console for not leaving the screenshot enabled in the options


    removed by staff

    Discord from a team of hackers

    There are no hacks/trainers to run on this platform and if there really are, they are few. Someone from the staff can tell you more, so wait for a more detailed answer

  15. By saying:

    Quote

    How can I give false data to the gui button from the server side?

    Do you mean how to disable that button?
    If yes then you could use
     

    --// Client
    
    addEvent("ButtonState", true)
    addEventHandler("ButtonState", root, function(state)
        if state == true then
           guiSetEnabled(spawnButton, true)
        elseif state == false then
           guiSetEnabled(spawnButton, false)
        end
    end)
    
    
    --// Server
    
    addCommandHandler("button", function(player, cmd, newstate)
        if not newstate then return end
        triggerClientEvent(player, "ButtonState", player, newstate)
    end)

     

  16. Client:

    bindKey("e", "down", function()
        local getJob = getElementData(localPlayer, "Jobs") or "NONE"
        if getJob == "Dealer" then
           if not isElementWithinColShape(localPlayer, Col) then
              return outputChatBox("You must be inside the farming zone", 255, 255, 255, true)
           end
           if not exports.global:hasItem(localPlayer, 285) then return end
           if TSK == false then return end
           TSK = false
           setPedAnimation(localPlayer, "BOMBER", "BOM_Plant", -1, false, false, false, false)
           triggerServerEvent("TakeSeedfromPlayer", localPlayer)
           setTimer(function()
             local x, y, z = getElementPosition(localPlayer)
             local Object = createObject(677, x, y, z - 1)
             outputChatBox("You planted seed", 255, 255, 255, true)
             TSK = true
             setTimer(function()
               if isElement(Object) then
                  destroyElement(Object)
                  triggerServerEvent("GiveDrugtoPlayer", localPlayer)
               end
             end, 6000, 1)
           end, 2000, 1)
        end
    end)

    Server:
     

    addEvent("TakeSeedfromPlayer", true)
    addEventHandler("TakeSeedfromPlayer", root, function(takeseed)
        if exports.global:hasItem(source, 285) then
           exports.global:takeItem(source, 285)
        else
           outputChatBox("#ffffff[ #FC861DDrug-System#ffffff ] : You don't have enough seeds.",source,255, 255, 255,true)
        end
    end)

    The problem was solved on discord, so I think this topic can be closed

×
×
  • Create New...