Jump to content

x[ مساعدة ]x fetchRemote ما يبي يزبط


Recommended Posts

سلام عليكم ورحمة الله

اليوم يا جماعة كنت اجرب كم فنكشن ، ولقيت fetchRemote

وجات على بالي فكرة كويسة بس المشكلة انو ما يبي يشتغل المثا اللي بالويكي

عشان اعدل عليه وكذا و من ثم أفهم الفنكشن

-- server side
function startImageDownload( playerToReceive )
    fetchRemote ( "http://a.top4top.net/p_52221hhc1.jpg", myCallback, "", false, playerToReceive )
end

function myCallback( responseData, errno, playerToReceive )
    if errno == 0 then
        triggerClientEvent( playerToReceive, "onClientGotImage", resourceRoot, responseData )
    end
end
-- client side 
addEvent( "onClientGotImage", true )
addEventHandler( "onClientGotImage", resourceRoot,
    function( pixels )
        if myTexture then
            destroyElement( myTexture )
        end
        myTexture = dxCreateTexture( pixels )
    end
)

addEventHandler("onClientRender", root,
    function()
        if myTexture then
            local w,h = dxGetMaterialSize( myTexture )
            dxDrawImage( 200, 100, w, h, myTexture )
        end
    end
)

يا ريت ما تبخلو علينا بالمساعدة

وسلام عليكم ورحمة الله

Link to comment
2 hours ago, Abdul KariM said:

@Default يب يب يعطيك العافية


fetchRemote("http://a.top4top.net/p_52221hhc1.jpg",
    function ( response )

	if response ~= "ERROR" then

	triggerClientEvent("onClientGotImage", root, response )
		
		end
    end
	) 

 

 

2 hours ago, Default said:

@Abdul KariM سطر 6 responseData مو معرفة .

لبى قلوبكم يا شيخ ،

تم حل المشكل #

 

  • Like 1
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...