Jump to content

I got the video thing but.....


Deepu

Recommended Posts

Posted

There is this problem that I wanna create 10 windows that shows different criminals who are wanted with 6 level.

How can I make that? Tell the functions and explain how I can put different criminals in different windows....

Posted

Not entirely sure what you're on about, but...

getPlayerWantedLevel 
guiCreateWindow 

As for designating criminals to the windows, it depends on how your system is made.

Posted
  
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 
  

Posted

Keep in mind that syncing like that will most likely end up laggy, so instead of setting on each frame, build your own "packet" system by limiting these 1 per 50 ms.

Posted

what do you mean by packet? :o and btw cheezed, how you make criminals appear in the window with dxCreateScreenSource? You only make yourself appear in the window with screenSource......

Posted

That is why you have to execute the function on the player's client, not on yours, and then transfer the data to your client and draw the image.

Posted

Triggering events. Client -> Server -> Client.

Is it efficient? No. But as far as I know, the only way of doing it without some serious modifications.

Posted

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?

Posted

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

Posted

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?

Posted

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) 

Posted
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) 

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