ChoTax Posted January 3, 2013 Posted January 3, 2013 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 !
Alen141 Posted January 3, 2013 Posted January 3, 2013 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
manve1 Posted January 3, 2013 Posted January 3, 2013 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 You forgot to close the event handler
Alen141 Posted January 3, 2013 Posted January 3, 2013 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 You forgot to close the event handler I see 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 )
ChoTax Posted January 3, 2013 Author Posted January 3, 2013 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 what you're changed ?
Alen141 Posted January 3, 2013 Posted January 3, 2013 you put ")" into same line as end EDIT : 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 )
ChoTax Posted January 3, 2013 Author Posted January 3, 2013 you put ")" into same line as endEDIT : 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 ) not work ;(
Alen141 Posted January 3, 2013 Posted January 3, 2013 addEvent ("text", true ) function text() local accName = getAccountName ( getPlayerAccount ( source ) ) -- get his account name if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then else cancelEvent () end end addEventHandler ( "text", getRootElement(), text ) try this
ChoTax Posted January 3, 2013 Author Posted January 3, 2013 addEvent ("text", true ) function text() local accName = getAccountName ( getPlayerAccount ( source ) ) -- get his account name if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then else cancelEvent () end end addEventHandler ( "text", getRootElement(), text ) try this not work
Alen141 Posted January 3, 2013 Posted January 3, 2013 then wait for some more experianced scripters to come like Solidsnake
Vision Posted January 3, 2013 Posted January 3, 2013 -- server side addCommandHandler( "text", function( ) for _, player in ipairs ( getElementsByType ( "player" ) ) do local accName = getAccountName ( getPlayerAccount( player ) ) -- get his account if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then triggerClientEvent( player, "text", root ) end end end ) -- client side 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]) addEvent ("text", true ) addEventHandler( "text", root, 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 ) end end ) ----------------- addEventHandler ( "onClientGUIClick", root, function () if ( source == close ) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor ( false ) end end )
ChoTax Posted January 3, 2013 Author Posted January 3, 2013 -- server side addCommandHandler( "text", function( ) for _, player in ipairs ( getElementsByType ( "player" ) ) do local accName = getAccountName ( getPlayerAccount( player ) ) -- get his account if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then triggerClientEvent( player, "text", root ) end end end ) -- client side 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]) addEvent ("text", true ) addEventHandler( "text", root, 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 ) end end ) ----------------- addEventHandler ( "onClientGUIClick", root, function () if ( source == close ) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor ( false ) end end ) same problem ! not work
Castillo Posted January 3, 2013 Posted January 3, 2013 -- client side: 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]) font = guiCreateFont("font.ttf", 12) addEvent ( "showWindow", true ) addEventHandler ( "showWindow", root, function ( ) guiSetVisible ( GUIEditor_Window[1], true ) showCursor ( true ) end ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor_Button[1] ) then local text = guiGetText(GUIEditor_Edit[1]) triggerServerEvent ( "sendText", localPlayer, text ) elseif ( source == close ) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor ( false ) end end ) addEvent ( "returnText", true ) addEventHandler ( "returnText", root, function ( text ) guiSetText ( GUIEditor_Label[1], " admin : "..text ) guiSetFont(GUIEditor_Label[1], font) guiLabelSetColor ( GUIEditor_Label[1], 255, 0, 0 ) end ) -- server side: addCommandHandler ( "text", function ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) -- get his account name if isObjectInACLGroup ( "user.".. accName, aclGetGroup ( "Admin" ) ) then triggerClientEvent ( thePlayer, "showWindow", thePlayer ) end end ) addEvent ( "sendText", true ) addEventHandler ( "sendText", root, function ( text ) triggerClientEvent ( "returnText", root, text ) end )
ChoTax Posted January 3, 2013 Author Posted January 3, 2013 -- client side: 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]) font = guiCreateFont("font.ttf", 12) addEvent ( "showWindow", true ) addEventHandler ( "showWindow", root, function ( ) guiSetVisible ( GUIEditor_Window[1], true ) showCursor ( true ) end ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor_Button[1] ) then local text = guiGetText(GUIEditor_Edit[1]) triggerServerEvent ( "sendText", localPlayer, text ) elseif ( source == close ) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor ( false ) end end ) addEvent ( "returnText", true ) addEventHandler ( "returnText", root, function ( text ) guiSetText ( GUIEditor_Label[1], " admin : "..text ) guiSetFont(GUIEditor_Label[1], font) guiLabelSetColor ( GUIEditor_Label[1], 255, 0, 0 ) end ) -- server side: addCommandHandler ( "text", function ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) -- get his account name if isObjectInACLGroup ( "user.".. accName, aclGetGroup ( "Admin" ) ) then triggerClientEvent ( thePlayer, "showWindow", thePlayer ) end end ) addEvent ( "sendText", true ) addEventHandler ( "sendText", root, function ( text ) triggerClientEvent ( "returnText", root, text ) end ) not work
ChoTax Posted January 3, 2013 Author Posted January 3, 2013 Here it works, I tested it. oh , thaaanx bro
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