w7sH Posted April 13, 2017 Posted April 13, 2017 السلام عليكم ابي كود يخفي لي أزرار معينه ممكن 10 أزرار اذا دخلت عالم غير عالم 0
' A F . Posted April 13, 2017 Posted April 13, 2017 سوي يوم يفتح اللوحة تحقق انه بالعالم رقم 0 اذا فيه يفتح له الازرار اذا مو فية يقفل الازرار مثال bindKey ( "b" , "down" , function ( ) if ( getElementDimension ( localPlayer ) == 0 ) then guiSetVisible ( ... , true ); else guiSetVisible ( ... , false ); end end ); بدل ... لـ اسم الزر الي تبي تخفية وتظهره
w7sH Posted April 13, 2017 Author Posted April 13, 2017 (edited) مافهمتني انت انا ابي كود اذا دخل عالم غير عالم 0 يخفي له جميع الازرار وانا احددها مثل اف 1 واف2 مايقدر يستعملها وهو في غيرعالم 0 Edited April 13, 2017 by w7sH
' A F . Posted April 13, 2017 Posted April 13, 2017 لو بحثت بالقسم تلاقي كثير local Keys = { ["F1"] = true, ["F2"] = true, } addEventHandler ( "onClientKey" , root , function ( button , press ) then if ( press and getElementDimension ( localPlayer ) ~= 0 and Keys [ button ] ) then cancelEvent ( ); end end );
AE. Posted April 13, 2017 Posted April 13, 2017 اجل روح المود اللي محطوط فيه اف1 وحط تحقق اذا كان ماهو بعالم 0 :3
w7sH Posted April 13, 2017 Author Posted April 13, 2017 انا عندي أزرار كثير أبي كود يخفيهم بمود واحد ..
AE. Posted April 13, 2017 Posted April 13, 2017 Just now, w7sH said: انا عندي أزرار كثير أبي كود يخفيهم بمود واحد .. ماظن تقدر :3 ..
w7sH Posted April 13, 2017 Author Posted April 13, 2017 الكود كان عندي لكن ضاع.. مافيه شي أسمه ماتقدر :]
#Soking Posted April 14, 2017 Posted April 14, 2017 aTable = { 'F1' , 'F2' } addEventHandler ( 'onClientKey' , root , function ( aKey ) for aCounter = 1 , #aTable do return ( ( aTable [ aCounter ] ) and ( getElementDimension ( localPlayer ) == 0 or cancelEvent ( ) ) ) end end ) الازرار الـ بدك توقفهأ حطهأ بـ اول سطر
w7sH Posted April 15, 2017 Author Posted April 15, 2017 الكود حقك تمام بس فيه مشكله وهي يخفي كل الازرار حتى مايقدر يتحرك ولا يسوي شي
Adham Posted April 15, 2017 Posted April 15, 2017 local buttons ={ [ "F1" ] = true, }; addEventHandler( "onClientKey", root, function(button , press) if press and getElementDimension(localPlayer) == 0 then if buttons[button]then cancelEvent() end end end )
^iiEcoo'x_) Posted April 15, 2017 Posted April 15, 2017 local aButtons = { "aButton1", "aButton2", } addEventHandler("onClientKey",root, function ( aButton , aPress ) for _,button in ipairs ( aButtons )do if ( aPress ) and ( not getElementDimension ( localPlayer ) == 0 ) then if aButton == button then cancelEvent ( ) end end end end ) هذا الكود للأزرار معينة , إذا ودك كل الأزرار إستعمل هذا الكود :- addEventHandler("onClientKey",root, function ( aButton , aPress ) for _,button in ipairs(getElementsByType("gui-button")) do if ( aPress ) and ( not getElementDimension ( localPlayer ) == 0 ) then if aButton == button then cancelEvent ( ) end end end end )
^iiEcoo'x_) Posted April 15, 2017 Posted April 15, 2017 9 minutes ago, w7sH said: شكراً لكم جميعاً تمت الإفادة. حياكـ الله , العفو
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now