Jump to content

I got the video thing but.....


Deepu

Recommended Posts

  
dxCreateScreenSource() -- get the screen of the criminals 
dxUpdateScreenSource() -- update the screen source every frame 
dxDrawImage() -- draw the texture returned by the function above 
setElementData() and getElementData() -- for transferring the textures from client to client 
  

Link to comment

eheh? oh I get it.....

function ppp () 
   ........ 
end 
addEvent("onPPP", true) 
addEventHandler("onPPP", getRootElement(), ppp) 

and then triggering it in server?

function hhh () 
   triggerClientEvent("onPPP", localPlayer) 
end 
addEvent("onHHH", true) 
addEventHandler("onHHH", getRootElement(), hhh) 

and then again to client?

function kkk () 
   triggerServerEvent("onHHH", localPlayer) 
end 
addEventHandler(.......) 

is this what you meant?

Link to comment

Wat?

Get the player's screen, send the result to the server via triggerServerEvent.

Send the data the Server received to the specified client via triggerClientEvent.

Player 1 -> Server -> Player 2

Not sure if it works, but you can try. I'd assume if it works, it's gonna lag quite a bit :P

Link to comment

hmm.....Well I dint call anyone to the server and I tested it out myself.... I did the triggerings the same way and it worked :) but I can see only my image (since only I am the one playing in the server). So will it work if 2 players are online?

Link to comment

I just tried it myself, but I got a black dxDraw.

--SERVER 
addCommandHandler ( "screens", function ( p, cmd, targetPlayer ) 
  
    if not targetPlayer then return end 
     
    local tName, tPlayer = exports.global:getPlayer ( p, targetPlayer ) 
    triggerClientEvent ( tPlayer, "updateSource", tPlayer ) 
    triggerClientEvent ( p, "viewSource", p, tPlayer ) 
     
end ) 
--CLIENT 
  
addEvent ( "updateSource", true ) 
addEventHandler ( "updateSource", root, function () 
    local sSource = dxCreateScreenSource ( 500, 500 ) 
    if isElement ( sSource ) then 
        outputChatBox ( "dxSource created" ) 
    else 
        outputChatBox ( "Error creating dxSource" ) 
    end 
    setElementData ( source, "screenSource", sSource ) 
end) 
  
addEvent ( "viewSource", true ) 
addEventHandler ( "viewSource", root, function ( tPlayer ) 
     
    function handle() 
        screenSource = getElementData ( tPlayer, "screenSource" ) 
        dxDrawImage (0, 0, 500, 500, screenSource ) 
  
    end 
     
    addEventHandler ( "onClientRender", root, handle )  
    --outputChatBox ( tostring ( getElementData ( tPlayer, "screenSource" ) ) )  
end) 

Link to comment
function screentis () 
        myScreenSource = dxCreateScreenSource ( 640, 480 ) 
end 
addCommandHandler("st", screentis) 
  
  
function donetis () 
   local players = getElementsByType("player") 
   dxUpdateScreenSource( myScreenSource )                   
   dxDrawImage( 10, 10, 800, 300, myScreenSource ) 
end 
  
function killstis () 
   addEventHandler("onClientRender", root, donetis) 
end 
addEvent("onPPP", true) 
addEventHandler("onPPP", getRootElement(), killstis) 
  
function kkk () 
   triggerServerEvent("onHHH", localPlayer) 
end 
addCommandHandler("onka", kkk) 

-- client

function hhh () 
   triggerClientEvent("onPPP", source) 
end 
addEvent("onHHH", true) 
addEventHandler("onHHH", getRootElement(), hhh) 

-- server

EDIT: I used the dxDrawImage3D but the height of the image is too much and the width is too low

dxDrawImage3D(-1234.98865, -87.49578, 14.14844, 5, -5, myScreenSource, tocolor(255,255,255,255), 90) 

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...