Adham Posted May 23, 2016 Share Posted May 23, 2016 سلام عليكم ابي كود لما يضعط علي button يتقفل شات ال say ولما يضعط غعلي butotn اخر يتفح شات say # Link to comment
iMr.WiFi..! Posted May 23, 2016 Share Posted May 23, 2016 -- #Client addEventHandler -- "onClientGUIClick" setElementData -- #Server addEventHandler -- "onPlayerChat" if type == 0 -- سوي تحقق , getElementData -- True cancelEvent Link to comment
Adham Posted May 23, 2016 Author Share Posted May 23, 2016 كذا؟ addEventHandler("onClientGUIClick",resourceRoot, function() if source == GUIEditor.button[1] then setElementData (localPlayer,'LockChat') elseif source == GUIEditor.button[2] then setElementData (localPlayer,'LockChat') end end) SERVER # addEventHandler("onPlayerChat",resourceRoot, function() if type == 0 setElementData (localPlayer,'LockChat','true') cancelEvent() if isObjectInACLGroup("user." .. account, aclGetGroup("Console")) then end end ) Link to comment
SycroX Posted May 23, 2016 Share Posted May 23, 2016 كذا؟ addEventHandler("onClientGUIClick",resourceRoot, function() if source == GUIEditor.button[1] then setElementData (localPlayer,'LockChat') elseif source == GUIEditor.button[2] then setElementData (localPlayer,'LockChat') end end) SERVER # addEventHandler("onPlayerChat",resourceRoot, function() if type == 0 setElementData (localPlayer,'LockChat','true') cancelEvent() if isObjectInACLGroup("user." .. account, aclGetGroup("Console")) then end end ) --#Client Side addEventHandler("onClientGUIClick", root, function() if source == GUIEditor.button[1] then triggerServerEvent("Chat", localPlayer, "Open") elseif source == GUIEditor.button[2] then triggerServerEvent("Chat", localPlayer, "Close") end end) --#Server Side addEvent("Chat", true) addEventHandler("Chat", root, function(Event) if Event == "Open" then for index, value in ipairs(getElementsByType("player")) do setElementData(value, "ChatStat", "Lock") end elseif Event == "Close" then for index, value in ipairs(getElementsByType("player")) do setElementData(value, "ChatStat", "Open") end end end) addEventHandler("onPlayerChat", root, function() if getElementData(source, "ChatStat") == "Lock" then cancelEvent() outputChatBox("Chat is Locked!!", source, 255, 0, 0, true) else end end ) Link to comment
Adham Posted May 23, 2016 Author Share Posted May 23, 2016 طيب لو ابي اعمل اليتكلم فقط الكونسل لما الشات يتقفل Link to comment
SycroX Posted May 23, 2016 Share Posted May 23, 2016 طيب لو ابي اعملاليتكلم فقط الكونسل لما الشات يتقفل addEventHandler("onPlayerChat", root, function() local acc = getAccountName(getPlayerAccount(source)) if getElementData(source, "ChatStat") == "Lock" then if not isObjectInACLGroup ( "user."..acc, aclGetGroup("Console")) then cancelEvent() else setElementData(source, "ChatStat", "Open") end else end end) Link to comment
SycroX Posted May 23, 2016 Share Posted May 23, 2016 بقولك اسف الي فوق غلط اتفضل جربتو عندي --#Client addEventHandler("onClientGUIClick", root, function() if source == GUIEditor.button[1] then triggerServerEvent("ChatOpen", localPlayer) elseif source == GUIEditor.button[2] then triggerServerEvent("ChatLock", localPlayer) end end) ----#Server addEvent("ChatOpen", true) addEventHandler("ChatOpen", root, function() for index, value in ipairs(getElementsByType("player")) do setElementData(value, "ChatStat", "Open") end end) addEvent("ChatLock", true) addEventHandler("ChatLock", root, function() for index, value in ipairs(getElementsByType("player")) do setElementData(value, "ChatStat", "Lock") end end) addEventHandler("onPlayerChat", root, function() local acc = getAccountName(getPlayerAccount(source)) if getElementData(source, "ChatStat") == "Lock" then if not isObjectInACLGroup ( "user."..acc, aclGetGroup("Co1nsole")) then cancelEvent() outputChatBox("chat lock", source, 255, 0, 0, true) else end else end end) Link to comment
Me[Z]oO Posted May 23, 2016 Share Posted May 23, 2016 بقولك اسف الي فوق غلط اتفضل جربتو عندي --#Client addEventHandler("onClientGUIClick", root, function() if source == GUIEditor.button[1] then triggerServerEvent("ChatOpen", localPlayer) elseif source == GUIEditor.button[2] then triggerServerEvent("ChatLock", localPlayer) end end) ----#Server addEvent("ChatOpen", true) addEventHandler("ChatOpen", root, function() for index, value in ipairs(getElementsByType("player")) do setElementData(value, "ChatStat", "Open") end end) addEvent("ChatLock", true) addEventHandler("ChatLock", root, function() for index, value in ipairs(getElementsByType("player")) do setElementData(value, "ChatStat", "Lock") end end) addEventHandler("onPlayerChat", root, function() local acc = getAccountName(getPlayerAccount(source)) if getElementData(source, "ChatStat") == "Lock" then if not isObjectInACLGroup ( "user."..acc, aclGetGroup("Co1nsole")) then cancelEvent() outputChatBox("chat lock", source, 255, 0, 0, true) else end else 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