Jump to content

Malak

Members
  • Posts

    51
  • Joined

  • Last visited

Posts posted by Malak

  1. Hello guys,

    Today i am asking you about a problem of optimisation of the recording a video in mta.

    I want to record a sentance of 15 secondes and then replay it after sent it to the guy who get killed by the killer.

    There is my code for testing the recording :

    local Replay = {} 
    Replay.state = 0 
    Replay.count = 0 
    Replay.decount = 0 
    local screenWidth,screenHeight = guiGetScreenSize() 
    function onRecordReplay() 
        Replay.screensource = dxCreateScreenSource ( screenWidth/2, screenHeight/2 )   
        Replay.state = 1 
        Replay.record = {} 
        addEventHandler("onClientRender",root,ReplayFunction) 
    end 
    function onStopReplay() 
        removeEventHandler("onClientRender",root,ReplayFunction) 
        Replay.screensource = nil 
        Replay.state = 0 
        Replay.record = {} 
    end 
    function checkPlayerDeath() 
        if getElementData(source,"replay") == true then 
            outputDebugString("Replay Launch") 
            Replay.state = 2 
        end 
    end 
    addEventHandler("onClientPlayerWasted", root, checkPlayerDeath) 
      
    addCommandHandler("replay", function() 
        if getElementData(localPlayer,"replay") == true then 
            setElementData(localPlayer,"replay",false) 
            onStopReplay() 
        else 
            setElementData(localPlayer,"replay",true) 
            onRecordReplay() 
        end 
    end) 
      
    function ReplayFunction() 
        if Replay.state == 1 then 
            if  Replay.count < 151 then 
                outputDebugString("Record ".. Replay.count) 
                 dxUpdateScreenSource( Replay.screensource )   
                 Replay.record[Replay.count] =  dxCreateTexture(dxGetTexturePixels (Replay.screensource)) 
                 Replay.count = Replay.count+1 
            end 
        elseif Replay.state == 2 then 
            if Replay.decount < Replay.count then 
                outputDebugString("Show "..Replay.decount) 
                dxDrawImage( screenWidth - screenWidth,  screenHeight - screenHeight,  screenWidth, screenHeight, Replay.record[Replay.decount], 0, 0, 0, tocolor (255, 255, 255, 255), true)       
                Replay.decount = Replay.decount+1 
            end 
        end 
    end 
    

    Actually this little code work but when i am recording i am lagging so hard and fps drop to 5. due to dxCreateTexture and dxGetTexturePixels so i ask you if you have another idea to stock my image for record it after.

  2. logo-tourny.png

    Hello MTA players,

    I am glad to announce you today a new tournament for the community !

    http://www.mtasa-dd.com team present :

    "The international destruction derby championships"

    Registration is already open, and tournament will be started when we will get 16 teams!

    First is group stage with 8 teams in each group, both groups will fight all vs all (3vs3...vs3)

    Then play off with upper and lower brackets, first 4 places from each group - upper bracket, another teams - lower bracket.

    Prize for the clan winner is 100 euros, more details in our special page (see below).

    What is mtasa-dd team ?

    This is the place specially for Descturction Derby community.

    The main target of this site, to make clan wars more fair, because now there is a lot of problems like guys who abusing admin rights during cw, or not existence of "official" rules for cws, etc.

    So we wrote the rules for clan wars and made the forum for results of cws, if someone was abusing admin rights, you just put the screen with proofs, and their team get -1 karma or +1 warning (such function will be added soon). Before cw you can check profile of any team and see their karma to make decision if its good idea to play against them. Btw this is resolving the problem when teams dont want add their defeats on their site, now all will see results on our site.

    This is will works only if teams and players will support this site and idea. We are welcome for your questions and suggestions on our forum, everything in your hands.

    Except this, we made another things like media page, list of clans, function to get subforum for guys who wanna make the tournament or any event, etc

    We will continue to work with it till we have ideas, but as we said - everything in your hands because its nothing without your support.

    Site: http://www.mtasa-dd.com/

    Special page for tournament: http://international.mtasa-dd.com/

    Forum of tournament (registration, rules, etc): http://www.forum.mtasa-dd.com/viewforum.php?f=25

  3.         function onDeleteCharacter() 
        if editBoxState == true then 
            textEdited = string.sub(textEdited,1,string.len(textEdited)-1) 
        end 
    end 
    bindKey("backspace", "down", onDeleteCharacter) 
    function onEditCharacter(character) 
        if editBoxState == true then 
            local count =  string.len(textEdited) 
            if count < 23 then 
                textEdited = textEdited..character 
            end 
        end 
    end 
    addEventHandler("onClientCharacter", getRootElement(), onEditCharacter) 
    

    u just add to add ur variable textEdited on ur dxDrawText and make your click state (focus on edit box)

  4. Hello guys, i am working on a little browser for only one website.

    Its work fine but i have some question about injectBrowserMouseDown(webBrowser, button).

    Atm only form and input can be clicked, all Link wont work how can i see where i clicked on the page rendering by webbrowser ?

    For exemple i want to switch my page or launch a video how can i do it ?

  5. You need to say if the admin will have an another vehicle of normal players, then you make like he said at client-side the code for load TXD/DFF for ALL and you only give this type of vehicle for players.

    If you want different skins for same vehicle its not possible (u can but normal player will see their skin and not the admin skin, and admin skin will see player skin).

    I hope ou will understand.

    You need to be clear.

  6. hello guys i have a little question do you know if its possible to make a line feed or back to the line into a dxDrawText ?

    For exemple i have this text into a var :

    local varText = "Hello guys, 
      
    How are you today ? 
    Yes i am fine and you ? 
    Yes" 
    

    its just an exemple to explain you how my var is set.

    and my code

    dxDrawText(varText,etc.) 
    

    I want to keep my lines, how i could do it ?

  7. Guys if i want to make another one like this It shows in the same time, how to change it ?

    setTimer(function ()  
    outputChatBox("Message 1", getRootElement(), 255, 255, 255, true)  
    outputChatBox("Message 2", getRootElement(), 255, 255, 255, true) end, 300000, 0) 
    

×
×
  • Create New...