liwahadri

x[ مشكلة ]x في الزر

Recommended Posts

Posted (edited)

مشكله هنا ابغى حل :(
:cry:الي ابغاه انه اذا ضغطت علي الزر يجي النص

:/المشكله هنا كل ماضغط علي الزر يجي النص و يختفي ليه؟

if isMouseInPosition (187*sx, 50*sy, 74*sx, 27*sy) then
        dxDrawRectangle(159*sx, 95*sy, 128*sx, 1*sy, tocolor(255, 255, 255, 255), false)
			if getKeyState("mouse1") and not stateKey then
        dxDrawText("TEST", 372*sx, 244*sy, 938*sx, 329*sy, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false)
		end
		else
        dxDrawRectangle(159*sx, 95*sy, 128*sx, 1*sy, tocolor(255, 255, 255, 80), false)
		end

 

Edited by liwahadri

Share this post


Link to post
Posted (edited)

sx + sy بما ان كودك غير مطروح بالكامل, لا تنسى تتأكد من تعريف

local showText = false

addEventHandler ( "onClientRender", root,
    function ( )
        dxDrawRectangle(159*sx, 95*sy, 128*sx, 1*sy, tocolor(255, 255, 255, 255), false)
        dxDrawText("TEST", 372*sx, 244*sy, 938*sx, 329*sy, tocolor(255, 255, 255, showText and 255 or 0), 1.00, "default", "left", "top", false, false, false, false, false)
    end
)

addEventHandler ( "onClientClick", root,
    function ( button, state )
        if ( button == "left" and state == "down" ) then
            if ( isMouseInPosition ( 159*sx, 95*sy, 128*sx, 1*sy ) ) then
                showText = not showText
            end
        end
    end
)

 

Edited by N3xT
  • Like 1

Share this post


Link to post
10 minutes ago, N3xT said:

sx + sy بما ان كودك غير مطروح بالكامل, لا تنسى تتأكد من تعريف


local showText = false

addEventHandler ( "onClientRender", root,
    function ( )
        dxDrawRectangle(159*sx, 95*sy, 128*sx, 1*sy, tocolor(255, 255, 255, 255), false)
        if ( showText == true ) then
            dxDrawText("TEST", 372*sx, 244*sy, 938*sx, 329*sy, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false)
        end
    end
)
addEventHandler ( "onClientClick", root,
    function ( button, state )
        if ( button == "left" and state == "down" ) then
            if ( isMouseInPosition ( 159*sx, 95*sy, 128*sx, 1*sy ) ) then
                showText = not showText
            end
        end
    end
)

 

unexpected symbol near'

local showText = false

 

Share this post


Link to post

الكود شغال عندي

 

local showText = false

addEventHandler ( "onClientRender", root,
    function ( )
        dxDrawRectangle(159, 95, 128, 5, tocolor(255, 255, 255, 255), false)
        dxDrawText("TEST", 372, 244, 938, 329, tocolor(255, 255, 255, showText and 255 or 0), 1.00, "default", "left", "top", false, false, false, false, false)
    end
)

addEventHandler ( "onClientClick", root,
    function ( button, state )
        if ( button == "left" and state == "down" ) then
            if ( isMouseInPosition ( 159, 95, 128, 5 ) ) then
		showText = not showText
            end
        end
    end
)

function isMouseInPosition ( x, y, width, height )
	if ( not isCursorShowing( ) ) then
		return false
	end
    local sx, sy = guiGetScreenSize ( )
    local cx, cy = getCursorPosition ( )
    local cx, cy = ( cx * sx ), ( cy * sy )
    if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then
        return true
    else
        return false
    end
end

 

Share this post


Link to post
21 minutes ago, N3xT said:

الكود شغال عندي

 


local showText = false

addEventHandler ( "onClientRender", root,
    function ( )
        dxDrawRectangle(159, 95, 128, 5, tocolor(255, 255, 255, 255), false)
        dxDrawText("TEST", 372, 244, 938, 329, tocolor(255, 255, 255, showText and 255 or 0), 1.00, "default", "left", "top", false, false, false, false, false)
    end
)

addEventHandler ( "onClientClick", root,
    function ( button, state )
        if ( button == "left" and state == "down" ) then
            if ( isMouseInPosition ( 159, 95, 128, 5 ) ) then
		showText = not showText
            end
        end
    end
)

function isMouseInPosition ( x, y, width, height )
	if ( not isCursorShowing( ) ) then
		return false
	end
    local sx, sy = guiGetScreenSize ( )
    local cx, cy = getCursorPosition ( )
    local cx, cy = ( cx * sx ), ( cy * sy )
    if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then
        return true
    else
        return false
    end
end

 

	local sx, sy = guiGetScreenSize() 
    sx, sy = ( sx / 1280 ), ( sy / 720 )
local showText = false
function paneldx()

local playername = getPlayerName(getLocalPlayer())
local w2 = dxGetTextWidth(playername,4.00,fonts["normal"][2],false)
dxDrawImage(0,0, 1280*sy, 720*sx, ":guieditor/images/rank.png", 0, 0, 0, tocolor(200, 200,200, 255), false)
dxDrawLine(129*sx, 95*sy, 1280*sx, 95*sy, tocolor(255, 255, 255, 80), 1, false)
dxDrawLine(129*sx, 96*sy, 129*sx, 720*sy, tocolor(255, 255, 255, 80), 1, false)
dxDrawText("News", 146*sx, 27*sy, 301*sx, 95*sy, tocolor(255, 255, 255, 255), 2.40, "defaul-bold", "center", "center", false, false, true, false, false)
        dxDrawText("TEST", 372, 244, 938, 329, tocolor(255, 255, 255, showText and 255 or 0), 1.00, "default", "left", "top", false, false, false, false, false)
dxDrawText("Soon", 301*sx, 27*sy, 456*sx, 95*sy, tocolor(255, 255, 255, 255), 2.40, "defaul-bold", "center", "center", false, false, true, false, false)
dxDrawText("Soon", 456*sx, 27*sy, 611*sx, 95*sy, tocolor(255, 255, 255, 255), 2.40, "defaul-bold", "center", "center", false, false, true, false, false)
_dxDrawRectangleRounded(928*sx, 19*sy, 335*sx, 58*sy, tocolor(0, 0, 0, 190), false)
_dxDrawRectangle(928*sx, 19*sy, 335*sx, 58*sy, tocolor(0, 0, 0, 190), false)
dxDrawText(playername, s*0.7850,y*-0.8700,s,y, tocolor(255, 255, 255, 255), 1.50, "default-bold", "left", "center", false, false, false, true, false)
dxDrawImage(931*sx, 22*sy, 58*sx, 51*sy, ":guieditor/images/default-avatar.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
end

addEventHandler ( "onClientClick", root,
    function ( button, state )
	if ( button == "left" and state == "down" ) then
	if ( isMouseInPosition ( 159, 95, 128, 5 ) ) then
            end
        end
    end
)

setTimer ( function()
if removeEventHandler("onClientRender", root,render) then
addEventHandler("onClientRender", root, tworender)
else
removeEventHandler("onClientRender", root, tworender)
addEventHandler("onClientRender", root, paneldx)

end
end,1000,0)

end

expected near '

        dxDrawText("TEST", 372, 244, 938, 329, tocolor(255, 255, 255, showText  and 255 or 0), 1.00, "default", "left", "top", false, false, false, false, false)

 

حاولت ادور حل مالقيت :'( 

ابب ...

Share this post


Link to post

احذف المسافة اللي ببداية سطر 12, وسطر 40 احذف الاند الزايدة

Share this post


Link to post
Posted (edited)
4 hours ago, N3xT said:

احذف المسافة اللي ببداية سطر 12, وسطر 40 احذف الاند الزايدة

دست علي زر ماصار شيئ النص مافي

5 hours ago, N3xT said:

احذف المسافة اللي ببداية سطر 12, وسطر 40 احذف الاند الزايدة

حاولت اطلع نص في ديبوق سترينق ماطلع شيئ

addEventHandler ( "onClientClick", root,
function ()
	if ( button == "left" and state == "down" ) then
	if isMouseInPosition(43, 566, 61, 64) then
		outputDebugString("test")

end
end
end
)

شسالفه؟ :'( 

Edited by liwahadri

Share this post


Link to post
5 hours ago, N3xT said:

احذف المسافة اللي ببداية سطر 12, وسطر 40 احذف الاند الزايدة

حاولت اطلع نص في ديبوق سترينق ماطلع شيئ

addEventHandler ( "onClientClick", root,
function ()
	if ( button == "left" and state == "down" ) then
	if isMouseInPosition(43, 566, 61, 64) then
		outputDebugString("test")

end
end
end
)

حليته المشكله طلعت من 

function (button, state, absoluteX, absoluteY, clickedElement)

 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.