Mr.Mostafa Posted May 7, 2018 Share Posted May 7, 2018 سلام عليكم ابي لما اضغط حرف x يفتح لوحة - بس ابي اللوحة تفتح لرتبة معينة فقط وسويتها لكن في خطا بالكود ابي تصليحه وشكرا محاولتي كلنت : local KEDDX="x" function OpenDerby() triggerServerEvent('openderbywnd', localPlayer) end ) bindKey(KEDDX,"down",OpenDerby) local KEDX="x" addEvent ( "openderby", true ) addEventHandler ( "openderby", root, function OPEDDN() if getElementDimension(localPlayer) == 30 then guiSetVisible( GUIEditor.window[1], not guiGetVisible( GUIEditor.window[1] ) ) showCursor( guiGetVisible( GUIEditor.window[1] ) ) guiMoveRightToLeft(GUIEditor.window[1]) end ) bindKey(KEDX,"down",OPEDDN) سيرفر : addEvent ( "openderbywnd", true) addEventHandler( "openderbywnd",root, function ( ) local acc = getPlayerAccount ( source ) if acc and not isGuestAccount ( acc ) then if isObjectInACLGroup ( "user."..getAccountName ( acc ), aclGetGroup ( "system" ) ) then triggerClientEvent ( source, "openderby", resourceRoot ) outputChatBox("تم فتح لوحة",source,125,125,125,true) else outputChatBox("ليس لديك خآصية لفتح لوحة",source,125,125,125,true) end end end end ) Link to comment
LoOs Posted May 7, 2018 Share Posted May 7, 2018 السلام عليكم , عندك اسم للوظيفة نشيت تشيله بعد ماربطت فيه الحدث local KEDDX="x" function OpenDerby() triggerServerEvent('openderbywnd', localPlayer) end ) bindKey(KEDDX,"down",OpenDerby) local KEDX="x" addEvent ( "openderby", true ) addEventHandler ( "openderby", root, function () if getElementDimension(localPlayer) == 30 then guiSetVisible( GUIEditor.window[1], not guiGetVisible( GUIEditor.window[1] ) ) showCursor( guiGetVisible( GUIEditor.window[1] ) ) guiMoveRightToLeft(GUIEditor.window[1]) end ) bindKey(KEDX,"down",OPEDDN) Link to comment
Mr.Mostafa Posted May 7, 2018 Author Share Posted May 7, 2018 1 hour ago, LoOs said: السلام عليكم , عندك اسم للوظيفة نشيت تشيله بعد ماربطت فيه الحدث local KEDDX="x" function OpenDerby() triggerServerEvent('openderbywnd', localPlayer) end ) bindKey(KEDDX,"down",OpenDerby) local KEDX="x" addEvent ( "openderby", true ) addEventHandler ( "openderby", root, function () if getElementDimension(localPlayer) == 30 then guiSetVisible( GUIEditor.window[1], not guiGetVisible( GUIEditor.window[1] ) ) showCursor( guiGetVisible( GUIEditor.window[1] ) ) guiMoveRightToLeft(GUIEditor.window[1]) end ) bindKey(KEDX,"down",OPEDDN) للاسف ما اشتغل - ما تفتح Link to comment
Mr.Mostafa Posted May 8, 2018 Author Share Posted May 8, 2018 3 hours ago, #Bangladsh said: سطر 6 فيه قوس زايد شيلة وين هادا ؟؟ + بالكود حقي ولا كود @LoOs Link to comment
Mr.Mostafa Posted May 9, 2018 Author Share Posted May 9, 2018 Just now, #Bangladsh said: كود لوس وكودك if isObjectInACLGroup ( "user."..getAccountName ( acc ), aclGetGroup ( "system" ) then تقصد بيكون كدا؟ Link to comment
#Bangladsh Posted May 9, 2018 Share Posted May 9, 2018 local KEDDX = "x" bindKey ( KEDDX , 'down' , function () triggerServerEvent('openderbywnd', localPlayer) end ) local KEDX = "x" addEvent ( "openderby", true ) addEventHandler ( "openderby", root,function () if getElementDimension(localPlayer) == 30 then guiSetVisible( GUIEditor.window[1], not guiGetVisible( GUIEditor.window[1] ) ) showCursor( guiGetVisible( GUIEditor.window[1] ) ) guiMoveRightToLeft(GUIEditor.window[1]) end end ) bindKey(KEDX,"down",OPEDDN) Link to comment
+Source|> Posted May 10, 2018 Share Posted May 10, 2018 جرب كذا طيب -- --server local KEDX="x" function rr( player ) local acc = getPlayerAccount ( player ) if acc and not isGuestAccount ( acc ) then if isObjectInACLGroup ( "user."..getAccountName ( acc ), aclGetGroup ( "system" ) ) then triggerClientEvent ( player, "openderby", resourceRoot ) outputChatBox("تم فتح لوحة",player,125,125,125,true) else outputChatBox("ليس لديك خآصية لفتح لوحة",player,125,125,125,true) end end end function pl ( player ) bindKey( source, KEDX, "down", rr ) end addEventHandler("onPlayerLogin", root, pl ) --client local KEDDX="x" function OpenDerby() triggerServerEvent('openderbywnd', localPlayer) end bindKey(KEDDX,"down",OpenDerby) addEvent ( "openderby", true ) addEventHandler ( "openderby", root, function () if getElementDimension(localPlayer) == 30 then if guiGetVisible( GUIEditor.window[1] ) then guiSetVisible( GUIEditor.window[1], false ) showCursor( false ) else guiSetVisible( GUIEditor.window[1], true ) showCursor( true ) end end end ) كذا قصدك ؟ Link to comment
فاّرس Posted May 10, 2018 Share Posted May 10, 2018 (edited) ^ ليه كل ذا؟ الفكره بسيطه #Client Side : local KEDDX = 'x'; function sendTrigger () if getElementDimension ( localPlayer ) == 30 then triggerServerEvent ( 'openCommand', localPlayer ) end end bindKey ( KEDDX, 'down', sendTrigger ) addEvent ( 'open', true ) addEventHandler ( 'open', root, function () -- هنا أكواد فتح اللوحه فقط --guiSetVisible, guiGetVisible, showCursor end ) #Server Side : addEvent ( 'openCommand', true ) addEventHandler ( 'openCommand', root, function () local pA = getPlayerAccount ( source ); if pA and not isGuestAccount ( pA ) then if isObjectInACLGroup ( 'user.'..getAccountName ( pA ), aclGetGroup ( 'system' ) then triggerClientEvent ( source, 'open', source ) -- outputChatBox .. else -- outputChatBox .. end end end ) Edited May 10, 2018 by Sha67 إضافة تعليق. Link to comment
|M.r|LooFe| Posted May 11, 2018 Share Posted May 11, 2018 بما اني فاضي سويت لك الكود الصحيح طبعا تقدر تعدل عليهه وككل ششي موضح كلينت : --Client key = "x" -- الزر bindKey(key,"down", function () triggerServerEvent("onPlayerOpenDerbyWnd",localPlayer) end ) addEvent("OpenDerbyWnd",true) addEventHandler("OpenDerbyWnd",root, function () if guiGetVisible (GUIEditor.window[1] ) == false then -- اسم اللوحة guiSetVisible (GUIEditor.window[1],true) -- اسم اللوحة showCursor(true) playSoundFrontEnd(20) else guiSetVisible (GUIEditor.window[1],false) -- اسم اللوحة showCursor(false) end end ) سيرفر : --Server addEvent("onPlayerOpenDerbyWnd",true) addEventHandler("onPlayerOpenDerbyWnd",root, function () acc = getPlayerAccount(source) if not isGuestAccount(acc) then if isObjectInACLGroup( "user.".. getAccountName(acc),aclGetGroup ( "system" ) ) then -- اسم قروب فتح اللوحة triggerClientEvent(source,"OpenDerbyWnd",source) outputChatBox("تم فتح لوحة",source,125,125,125,true) else outputChatBox("ليس لديك خآصية لفتح لوحة",source,125,125,125,true) end end end ) 8 hours ago, Sha67 said: ^ ليه كل ذا؟ الفكره بسيطه #Client Side : #Server Side : addEvent ( 'openCommand', true ) addEventHandler ( 'openCommand', root, function () local pA = getPlayerAccount ( source ); if pA and not isGuestAccount ( pA ) then if isObjectInACLGroup ( 'user.'..getAccountName ( pA ), aclGetGroup ( 'system' ) then triggerClientEvent ( source, 'open', source ) -- outputChatBox .. else -- outputChatBox .. end end end ) بالنسبة لذا الكود هو صحيح لكن ناقصه end Link to comment
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