Jump to content

Gr0x

Members
  • Posts

    109
  • Joined

  • Last visited

Posts posted by Gr0x

  1. 1 hour ago, koragg said:

    It is :D Idk why it says 0, like they're not of type 'marker' or something.

    Then I don't know what the problem is, it totally worked fine for me. I could hide the markers and blips using runcode
    These are the commands I used:

    crun for q,w in pairs(getElementsByType("marker")) do setMarkerSize(w,0) end
    crun for q,w in pairs(getElementsByType("blip")) do setBlipColor(w,255,255,255,0) end

     

  2. 27 minutes ago, koragg said:

    Well the easiest way to see if they get detected is this, and it shows 0 in chatbox.

    
    function markersTest()
    	local markers = getElementsByType("marker")
      	outputChatBox(#markers)
    end
    addCommandHandler("markerstest", markersTest)
    

    While doing the same for blips shows 2.

    I'm assuming that's not a client sided script then, is it?

  3. I downloaded MTA again a few weeks ago, after not playing it for about 1-2 years.

    Every time I open it, GTA opens, I can see the GTA San Andreas "splash/title" screen, but right before it would fade away and take me to the main menu, my client crashes without any errors. I can see the cursor changing to the loading one for about half a second, and then there is nothing. mtasa/gtasa/proxysa is not running after that.

    There is a version that worked however, which was this: mtasa-1.5.4-full_rc-11690-20170927

    I have no idea why that particular version works. I've tried other ones, but all of them only works after I install MTA, and click "Run" at the end of the install. If i close the game after that, I can not run it anymore, (except when I use the version i mentioned). But of course it's an older one since 1.5.5 is out, and it autopatches it every time.

    There are administrator rights for everything, there are no viruses on my computer, and I'm using Windows 10 (64-bit), GTASA works fine w/o MTA.
    Any ideas? I have been trying to figure it out for days, but for some reason couldn't... I have no idea what could cause this.
    My friend had the same problem, so I'm pretty sure its a common problem, but I couldnt find any answers.

    Thanks in advance.

  4. That's the problem, it returns if it exists on the server.

    It doesnt. I just tested it myself.

    Make sure your script is client sided.

    However, seems like Walid's solution is much better, so you don't need fileExists anyways.

  5. downloadFile 
    

    The file should also be included in meta.xml with the download attribute set to "false".

    Haven't played MTA for a while, just checked the forums, but I think that might help you.

  6. For clicking i guess.

    For example, onClientGUIClick triggers when you press the left, right, or middle mouse button, and the state will be "down" in this case.

    If you press the left, obviously button will be equal to "left", if you press right, it will be "right", if you press the middle one (the scrollwheel) it will be "middle".

    It also triggers, when you release the button, which makes the state variable "up".

    With this, you will only trigger the event once, and you will only be able to click a button for example with the left click, instead of triggering it twice.

  7. I really don't understand what it is you're asking for here, you want a command to mute a specific player?
    thats an example man!

    thats a question man!

  8. Server-side:

    function handleCommand(player) 
        if isPedInVehicle(player) then 
            -- Code. 
        end 
    end 
    addCommandHandler("useme",handleCommand) 
    

    Client-side:

    function handleCommand() 
        if isPedInVehicle(localPlayer) then 
            -- Code. 
        end 
    end 
    addCommandHandler("useme",handleCommand) 
    

  9. lastTick = 0 
    function updateFuel() 
        if isPedInVehicle ( localPlayer ) then 
            local veh = getPedOccupiedVehicle( localPlayer ) 
            if getVehicleEngineState ( veh ) == true then 
                CurrentFuelValue = getElementData(veh,"Fuel") 
                if (CurrentFuelValue == 0) then 
                    setVehicleEngineState(veh,false) 
                    return 
                end 
                if getTickCount() - lastTick <= 10000 then 
                    lastTick = getTickCount() 
                    setElementData(veh,"Fuel",CurrentFuelValue-1) 
                end 
            end 
        end 
    end 
    addEventHandler ("onClientRender", getLocalPlayer(), updateFuel) 
    

  10. An easy way to achieve what you wanted is this.

    local HOST = "localhost" 
    local USERNAME = "root" 
    local PASSWORD = "" 
    local DATABASE = "mta" 
    local connection = false 
      
    function getConnection() 
        return connection 
    end 
      
    function connect() 
        connection = dbConnect("mysql","dbname="..DATABASE..";host="..HOST..";",USERNAME,PASSWORD) 
    end 
    addEventHandler("onResourceStart",resourceRoot,connect) 
    

    Just add an export for the getConnection, and change the first line of the other code to

    local handler = exports.SQL:getConnection() 
    

  11. function getip() 
        outputChatBox("* " ..getPlayerName(source).. " has joined the server", root, 155, 155, 0) 
        for _,thePlayer in pairs(getElementsByType("player")) do 
            if not isGuestAccount(getPlayerAccount(thePlayer)) then 
                if isObjectInACLGroup ("user.".. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin")) then 
                    outputChatBox("** " ..getPlayerName(source).."'s IP:" ..getPlayerIP(source), thePlayer, 0, 255, 0) 
                end 
            end 
        end 
    end 
    addEventHandler("onPlayerLogin", getRootElement(), getip) 
    

×
×
  • Create New...