Jump to content

طلب تصليح كود لوحة


Recommended Posts

سلام عليكم

 

ابي لما اضغط حرف 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

السلام عليكم ,

عندك اسم للوظيفة نشيت تشيله بعد ماربطت فيه الحدث

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

جرب كذا طيب

--

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

^ ليه كل ذا؟ الفكره بسيطه

#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 by Sha67
إضافة تعليق.
Link to comment

بما اني فاضي سويت لك الكود الصحيح

طبعا تقدر تعدل عليهه وككل ششي موضح

كلينت :

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

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