Dim Posted September 13, 2011 Posted September 13, 2011 (edited) How do I get name server in client GUIEditor_Window = {} GUIEditor_Label = {} GUIEditor_Window[1] = guiCreateWindow(262,309,315,265,"",false) ServerNameLabel = guiCreateLabel(0.2825,0.1358,0.3587,0.1132,"name",true,GUIEditor_Window[1]) function onresourceStart () bindKey ("p", "down", dude) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onresourceStart) function dude () guiSetVisible (GUIEditor_Window[1], true) showCursor (true) local nameserver = getServerName( ) guiSetText ( ServerNameLabel, "Name: [ " .. nameserver .. " ]" ) end Edited September 13, 2011 by Guest
SnoopCat Posted September 13, 2011 Posted September 13, 2011 huh? VISIT TSW RACING SERVER http://tswracing.net/
Cadu12 Posted September 13, 2011 Posted September 13, 2011 getServerName server-side only Ingame nick: Cadu12
Castillo Posted September 13, 2011 Posted September 13, 2011 Firstly, stop spamming to get attention, that's not the way this works. Second, you are messing client & server functions in one script, that'll never work, you need triggers. -- client side GUIEditor_Window = {} GUIEditor_Label = {} GUIEditor_Window[1] = guiCreateWindow(262,309,315,265,"",false) ServerNameLabel = guiCreateLabel(0.2825,0.1358,0.3587,0.1132,"name",true,GUIEditor_Window[1]) function onresourceStart () bindKey ("p", "down", dude) end addEventHandler("onClientResourceStart", resourceRoot, onresourceStart) function dude () guiSetVisible (GUIEditor_Window[1], true) showCursor (true) triggerServerEvent("getServerName",localPlayer,localPlayer) end addEvent("returnServerName",true) addEventHandler("returnServerName",root, function (serverName) guiSetText ( ServerNameLabel, "Name: [ " .. tostring(serverName) .. " ]" ) end) -- server side addEvent("getServerName",true) addEventHandler("getServerName",root, function (client) local serverName = getServerName( ) triggerClientEvent(client,"returnServerName",client,serverName) end) Should work. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Dim Posted September 13, 2011 Author Posted September 13, 2011 crazy trigger you fuck I mean you crazy how doing that
Castillo Posted September 13, 2011 Posted September 13, 2011 I'm not crazy, triggers are used for this kind of script. P.S: Have you tested it? do you know how to setup a client and a server side script? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Dim Posted September 13, 2011 Author Posted September 13, 2011 Yes it working But I liked this craziness script Thanks, man!
Castillo Posted September 13, 2011 Posted September 13, 2011 You welcome. P.S: Try to understand the script, I'll not give you the code always. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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