Jump to content

مطلوب كود يحرك الدي اكس يمين او يسار


Recommended Posts

local screenW, screenH = guiGetScreenSize()

addEventHandler("onClientRender", root,
    function()
    
        dxDrawImage(screenW - 185 - 10, (screenH - 187) / 2, 185, 187, "YourLogo.png", math.random (6) , 0 , math.random (5), tocolor(255, 255, 255, 255), false)
    end
)

 

Edited by KhaledX
Link to post
local left = 10 -- تحقق مكان الوقوف بجهة اليسار
local right = 400 -- تحقق مكان الوقوف بجهة اليمين
local xpos = right -- احداثيات البدايه يسار او يمين انا مخليها تبدء من اليمين
-- اليوزفل
function DxDrawMove(i)
if xpos < left then xpos = left elseif xpos > right then xpos = right end
xpos = xpos+tonumber (i == 'left' and -3 or i == 'right' and 3 ) return xpos
end
-- اللوحه تتحرك يمين عند الضغط علي زر اف 3
function dx1()
dxDrawImage(DxDrawMove('right'),250, 354, 270, "image.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
end
-- اللوحه تتحرك يسار عند الضغط علي زر اف 3
function dx2()
dxDrawImage(DxDrawMove('left'),250, 354, 270, "image.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
end
-- فتح اللوحه
bindKey("F2","down", function () 
if v then addEventHandler("onClientRender", root,dx1) removeEventHandler("onClientRender", root,dx2) 
else addEventHandler("onClientRender", root,dx2) removeEventHandler("onClientRender", root,dx1)  end  
v = not v
end )
  

 جرب 

  • Like 1
Link to post

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