hello Community..
i have problem in my script pls help me !
server
addEvent ("text", true )
addEventHandler( "text", getRootElement(),
function ()
local accName = getAccountName ( getPlayerAccount ( source ) ) -- get his account name
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then
else
cancelEvent ()
end
end )
client
GUIEditor_Label = {}
GUIEditor_Window = {}
GUIEditor_Button = {}
GUIEditor_Edit = {}
GUIEditor_Label[1] = guiCreateLabel(218,558,387,41,"",false)
guiLabelSetColor(GUIEditor_Label[1],255,255,255)
guiLabelSetVerticalAlign(GUIEditor_Label[1],"top")
guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false)
GUIEditor_Window[1] = guiCreateWindow(221,83,310,341,"",false)
guiSetVisible ( GUIEditor_Window[1] , false )
GUIEditor_Edit[1] = guiCreateEdit(10,25,287,47,"",false,GUIEditor_Window[1])
GUIEditor_Button[1] = guiCreateButton(9,295,126,35,"Send Text",false,GUIEditor_Window[1])
close = guiCreateButton(173,294,126,35,"Close",false,GUIEditor_Window[1])
addCommandHandler ( "text",
function ()
guiSetVisible ( GUIEditor_Window[1], true )
showCursor ( true )
end )
--------------------
addEventHandler ( "onClientGUIClick", root,
function ()
local send = guiGetText(GUIEditor_Edit[1])
if ( source == GUIEditor_Button[1] ) then
guiSetText ( GUIEditor_Label[1], " admin : "..send)
guiSetFont(GUIEditor_Label[1], guiCreateFont("font.ttf", 12))
guiLabelSetColor ( GUIEditor_Label[1], 255, 0, 0 )
triggerServerEvent("text", localPlayer, accName )
end
end )
-----------------
addEventHandler ( "onClientGUIClick", root,
function ()
if ( source == close ) then
guiSetVisible ( GUIEditor_Window[1], false )
showCursor ( false )
end
end )
i want only admin can use it !