Jump to content

setCameraMatrix


Stevenn

Recommended Posts

Hello, i got a problem with setCameraMatrix.

function respawn ( totalammo, killer, killwerweapon, bodypart, stealth ) 
    setTimer ( setCameraMatrix, 1000, 1, source,  1187, -1324, 14 ) 
    fadeCamera ( source, false, 1, 0, 0, 0 ) 
    setTimer ( fadeCamera, 1500, 1, source, true ) 
    setTimer ( spawnPlayer, 5000, 1, source, 1179, -1325, 15, getElementModel ( source ) ) 
end 
addEventHandler ( "onPlayerWasted", root, respawn ) 

the camera view never changes, it should cancel the cameramatrix and let me play as usual after 5 seconds ( 5000 milliseconds )

Link to comment

thank you, but how can I do this:

addEvent ( "respawn:allsaints", true ) 
function allsaints () 
        dxDrawText("Hello",454.0,425.0,886.0,581.0,tocolor(255,255,255,255),2.0,"pricedown","left","top",false,false,false) 
end 
addEventHandler ( "respawn:allsaints", root, allsaints ) 

Link to comment
Guest Guest4401
thank you, but how can I do this:
addEvent ( "respawn:allsaints", true ) 
    function allsaints() 
        dxDrawText("Hello",454.0,425.0,886.0,581.0,tocolor(255,255,255,255),2.0,"pricedown","left","top",false,false,false) 
    end 
addEventHandler ( "respawn:allsaints", root, allsaints ) 

Draws a string of text on the screen for one frame. In order for the text to stay visible continuously, you need to call this function with the same parameters on each frame update (see onClientRender)

You must use onClientRender event to show dxText in every frame.

addEvent("respawn:allsaints",true) 
addEventHandler("respawn:allsaints",root, 
    function() 
        addEventHandler("onClientRender",root,drawTheText) 
    end 
) 
  
function drawTheText() 
    dxDrawText("Hello",454.0,425.0,886.0,581.0,tocolor(255,255,255,255),2.0,"pricedown","left","top",false,false,false) 
end 

Link to comment
addEvent("respawn:allsaints",true) 
addEventHandler("respawn:allsaints",root, 
    function() 
        addEventHandler("onClientRender",root,drawTheText) 
    end 
) 
  
function drawTheText() 
    text = dxDrawText("Hello",454.0,425.0,886.0,581.0,tocolor(255,255,255,255),2.0,"pricedown","left","top",false,false,false) 
end 

setTimer ( destroyElement, 5000, 1, text ) 

Link to comment
Guest Guest4401

Try this

addEvent("respawn:allsaints",true) 
addEventHandler("respawn:allsaints",root, 
function() 
    addEventHandler("onClientRender",root,drawTheText); 
    setTimer( 
        function() 
            removeEventHandler("onClientRender",root,drawTheText) 
        end 
    ,5000,1 
    ) 
end 
); 
  
function drawTheText() 
    dxDrawText("Hello",454.0,425.0,886.0,581.0,tocolor(255,255,255,255),2.0,"pricedown"); 
end; 

Link to comment

Because you are not putting it correctly by yourself.

addEvent("respawn:allsaints",true) 
addEventHandler("respawn:allsaints",root, 
    function() 
        addEventHandler("onClientRender",root,drawTheText) 
    end 
) 
  
function drawTheText() 
    text = dxDrawText("Hello",454.0,425.0,886.0,581.0,tocolor(255,255,255,255),2.0,"pricedown","left","top",false,false,false) 
    setTimer ( destroyElement, 5000, 1, text ) 
end 
  

I suggest you to start learning lua first, you could have fixed this yourself. There are errors, so try to fix it yourself now.

Link to comment
Because you are not putting it correctly by yourself.
addEvent("respawn:allsaints",true) 
addEventHandler("respawn:allsaints",root, 
    function() 
        addEventHandler("onClientRender",root,drawTheText) 
    end 
) 
  
function drawTheText() 
    text = dxDrawText("Hello",454.0,425.0,886.0,581.0,tocolor(255,255,255,255),2.0,"pricedown","left","top",false,false,false) 
    setTimer ( destroyElement, 5000, 1, text ) 
end 
  

I suggest you to start learning lua first, you could have fixed this yourself. There are errors, so try to fix it yourself now.

oh my god

setTimer into onClientRender event? :o

also dxDrawText return bool NOT element.

I suggest you to start learning lua first << lol

Link to comment
Because you are not putting it correctly by yourself.
addEvent("respawn:allsaints",true) 
addEventHandler("respawn:allsaints",root, 
    function() 
        addEventHandler("onClientRender",root,drawTheText) 
    end 
) 
  
function drawTheText() 
    text = dxDrawText("Hello",454.0,425.0,886.0,581.0,tocolor(255,255,255,255),2.0,"pricedown","left","top",false,false,false) 
    setTimer ( destroyElement, 5000, 1, text ) 
end 
  

I suggest you to start learning lua first, you could have fixed this yourself. There are errors, so try to fix it yourself now.

oh my god

setTimer into onClientRender event? :o

also dxDrawText return bool NOT element.

I suggest you to start learning lua first << lol

I am not helping those who cannot have no effort to take a look into what is in the script, even.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...