Jump to content

Controlled

Members
  • Posts

    167
  • Joined

  • Last visited

Posts posted by Controlled

  1. see that tis exmple how remove texture of vehicle from EngineApplyShaderToModel
    myShader = dxCreateShader( "hello.fx" ) 
      
    addEventHandler("onClientVehicleEnter", root, 
        function(thePlayer, seat) 
            local theVehicle = source 
            if seat == 0 and thePlayer == localPlayer then 
                engineApplyShaderToWorldTexture( myShader, "vehiclegrunge256", theVehicle ) 
                engineApplyShaderToWorldTexture( myShader, "?emap*", theVehicle ) 
            end 
        end 
    ) 
      
    addEventHandler("onClientVehicleExit", root, 
        function(thePlayer, seat) 
            local theVehicle = source 
            if seat == 0 and thePlayer == localPlayer then 
                engineRemoveShaderFromWorldTexture( myShader, "vehiclegrunge256", theVehicle ) 
                engineRemoveShaderFromWorldTexture( myShader, "?emap*", theVehicle ) 
            end 
        end 
    ) 
    

    Any idea on how to make a shader for this?

  2. Is it possible to make a window on a vehicle disappear? Like when you setPedDoingGangDriveby the window they use disappears.

    Is it possible to remove a window without doing a driveby?

    Example:

    f0c2e5a342.jpg

  3. I was bored so I come out with this code:
    aTable = {"Test", abc = "hello", "bla", "421312", www = "a1c234", "W2", "$!@#%!", ["AV"] = true} -- Your table 
    aTableMaxEx = 5 -- Max continuous executing. 
      
    function doLoop() 
        if not aTableKey then 
            aTableKey, aTableValue = next(aTable, nil) 
        end 
        while aTableKey do 
            if (aTableCount or 0) >= aTableMaxEx then 
                aTableCount = 0 
                setTimer(doLoop, 5000, 1) 
                break 
            end 
            --Your code 
            outputChatBox(tostring(aTableKey)..", "..tostring(aTableValue)) -- Example 
            -- 
            aTableKey, aTableValue = next(aTable, aTableKey) 
            aTableCount = (aTableCount or 0) + 1 
        end 
    end 
    doLoop() -- Start the loop 
    

    It works with both the numerical keys and the string keys.

    Cool thanks!

  4. [lua]

    someRandomTable = {}

    someRandomTabl = {}

    for i, v in ipairs(someRandomTable) do

    setTimer(runLoop, 5000, 1, someRandomTable)

    break

    end

    function runLoop(t)

    for i, v in ipairs(someRandomTable) do

    end

    end

    That would be the exact same outcome, just 5 seconds later. It wouldn't separate them by a time because your first loop is setting a timer really quick anyways....

  5. Is it possible to slow down how fast a loop runs? Normalling I know it just goes one after the other, is it possible to set some kind of delay there? Right now it causes the whole server to have some lag issues while it runs, I want to slow it down so it lasts longer but doesn't halt the server.

  6. Jusonex

    That's a problem, if the client didn't install it.. it won't work?

    Because I can't make every member in my community install it ._.

    He literally just explained how the client has to use his Awesomium client. It could be implemented into MTA at some point. But seriously just try for a second and read the replies he posted above.

  7. So I put a table in a shared file for both server and client to add to. When I add something to the table in server side,

    table[row][2] = value

    It doesn't return in the client side. I tried syncing it with a function in the shared file like this:

    Shared:

      
    function syncTables(row, value, info) 
      if row and value and info then 
        table[row][value] = info 
      end 
    end 
      
    

    Server:

      
    syncTables(1, 2, "Hi") 
      
    

    Client:

      
    for key, value in pairs(table) do 
    outputDebugString(value[2]) 
    end 
      
    

    Client will return nil whereas the server will return "Hi" properly...

×
×
  • Create New...