كلنت
local me = getLocalPlayer()
addEventHandler("onClientResourceStart",resourceRoot,function()
Main = guiCreateWindow(0.2,0.2,0.6,0.6,"ACL Management",true)
guiSetVisible(Main,false)
ComboBox = guiCreateComboBox(0.05,0.05,0.9,0.6,"Admin",true,Main)
Grid = guiCreateGridList(0.05, 0.2, 0.9, 0.65, true,Main)
guiSetEnabled(Grid, false)
C_O = guiGridListAddColumn(Grid, "Object name", 0.5)
C_N = guiGridListAddColumn(Grid, "Nick", 0.6)
C_T = guiGridListAddColumn(Grid, "Last login", 0.6)
addObj = guiCreateButton(0.05,0.9,0.45,0.07,"Add object",true,Main)
removeObj = guiCreateButton(0.5,0.9,0.45,0.07,"Remove object",true,Main)
end)
addEvent("onOpenACLWindow",true)
addEventHandler("onOpenACLWindow",getRootElement(),function()
if guiGetVisible(Main) == true then
guiSetVisible(Main,false)
showCursor(false)
else
guiGridListClear(Grid)
guiComboBoxClear(ComboBox)
guiSetProperty(removeObj, "Disabled", "True")
guiSetVisible(Main,true)
showCursor(true)
end
end)
addEvent("returnGROUPSNAMES",true)
addEventHandler("returnGROUPSNAMES",getRootElement(),function(Table)
for i,name in pairs(Table)do
guiComboBoxAddItem(ComboBox,name)
end
end)
addEventHandler ( "onClientGUIComboBoxAccepted", getRootElement(),function(box )
if box == ComboBox then
item = guiComboBoxGetSelected(box)
group = guiComboBoxGetItemText(box, item)
guiGridListClear(Grid)
triggerServerEvent("getGroupObjects",me,group)
end
end)
addEvent("returnObjects",true)
addEventHandler("returnObjects",getRootElement(),function(name,nick,last,check)
row = guiGridListAddRow ( Grid )
guiGridListSetItemText ( Grid, row, C_O,tostring(name), false, false )
if tostring(nick) ~= "NONE" then
guiGridListSetItemText ( Grid, row, C_N,tostring(nick), false, false )
end
if tostring(last) ~= "NONE" then
guiGridListSetItemText ( Grid, row, C_T,tostring(last), false, false )
end
if tostring(check) == "yes" then
guiGridListSetItemColor ( Grid, row, C_T, 0,255,0 )
guiGridListSetItemColor ( Grid, row, C_N, 0,255,0 )
guiGridListSetItemColor ( Grid, row, C_O, 0,255,0 )
end
end)
addEventHandler ( "onClientGUIClick", getRootElement(),function()
if source == Grid then
guiSetProperty(removeObj, "Disabled", "False")
elseif source == removeObj then
selectedRow, selectedCol = guiGridListGetSelectedItem( Grid )
theObj = guiGridListGetItemText( Grid, selectedRow, C_O )
guiGridListRemoveRow ( Grid, selectedRow )
item = guiComboBoxGetSelected(ComboBox)
group = guiComboBoxGetItemText(ComboBox, item)
action = "remove"
triggerServerEvent("onManageACL",me,action,theObj,group)
elseif source == addObj then
win = guiCreateWindow(250,200,400,90,"Object name",false)
objedit = guiCreateEdit(0.03,0.1,0.97,0.3,"",true,win)
btnAdd = guiCreateButton(0.03,0.5,0.97,0.5,"Add object",true,win)
guiSetInputEnabled(true)
elseif source == btnAdd then
guiSetInputEnabled(false)
obj = guiGetText(objedit)
if tostring(obj) ~= "" then
item = guiComboBoxGetSelected(ComboBox)
group = guiComboBoxGetItemText(ComboBox, item)
action = "add"
row = guiGridListAddRow ( Grid )
guiGridListSetItemText ( Grid, row, C_O,tostring(obj), false, false )
guiSetVisible(win,false)
triggerServerEvent("onManageACL",me,action,obj,group)
end
elseif source == btnCLSLOG then
showCursor(false)
destroyElement(winLOG)
guiSetInputEnabled(false)
end
end)
addEvent("returnACLLog",true)
addEventHandler("returnACLLog",getRootElement(),function()
winLOG = guiCreateWindow(170,130,600,360,"ACL Log",false)
memo = guiCreateMemo(5,5,590,325,"",false,winLOG)
btnCLSLOG = guiCreateButton(5,333,590,26,"Close",false,winLOG)
showCursor(true)
guiSetText(memo,getElementData(resourceRoot,"log"))
guiMemoSetReadOnly(memo,true)
end)
function pass()
guiSetEnabled(Grid, true)
outputChatBox("acl is enabled", 0, 200, 0)
end
addCommandHandler ("your pass" , pass)
-- استبدل كلمه your pass
-- بالباس حقك
حط ذا مكان الى مكتوب عندك بالكلنت