KillerNico Posted April 13, 2011 Share Posted April 13, 2011 Ok for my Script i need a 2nd GUI function. In the Edit field anobody can type in anything and then it shows in text in chatbox! For example: I write in the editfield: LTR Tower, In the chatbox it show it so: Everybode come to LTR Tower! addEventHandler("onClientResourceStart",resourceRoot, function() GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Window[1] = guiCreateWindow(3,178,261,208,"Uebungs Menu",false) GUIEditor_Button[1] = guiCreateButton(12,29,119,45,"Zur Zentrale",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(12,84,119,48,"Zu einem Ort",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(133,156,102,28,"Wohin ?",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) GUIEditor_Edit[1] = guiCreateEdit(11,140,121,43,"",false,GUIEditor_Window[1]) end ) Sry for bad English, im German Link to comment
Castillo Posted April 13, 2011 Share Posted April 13, 2011 --client side GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Window[1] = guiCreateWindow(3,178,261,208,"Uebungs Menu",false) GUIEditor_Button[1] = guiCreateButton(12,29,119,45,"Zur Zentrale",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(12,84,119,48,"Zu einem Ort",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(133,156,102,28,"Wohin ?",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"left",false) GUIEditor_Edit[1] = guiCreateEdit(11,140,121,43,"",false,GUIEditor_Window[1]) addEventHandler("onClientGUIClick",getRootElement(), function () if (source == GUIEditor_Button[1]) then local text = guiGetText(GUIEditor_Edit[1]) triggerServerEvent("sendText",getLocalPlayer(),text) elseif (source == GUIEditor_Button[2]) then local text = guiGetText(GUIEditor_Edit[1]) triggerServerEvent("sendText",getLocalPlayer(),text) end end) --server side addEvent("sendText",true) addEventHandler("sendText",getRootElement(), function (text) outputChatBox(tostring(text),getRootElement(),255,0,0) 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