papam77 Posted June 16, 2013 Posted June 16, 2013 Hello, i am making my own Join Quit, but i have really stupid problem. addEventHandler("onPlayerLogin", root, function() GUIEditor.label[1] = guiCreateLabel(0.89, 0.00, 0.11, 0.05, "ahoj", true, root) guiLabelSetVerticalAlign(GUIEditor.label[1], "center") GUIEditor.staticimage[1] = guiCreateStaticImage(0.86, 0.00, 0.14, 0.05, "img/join.png", true, root) guiSetAlpha(GUIEditor.staticimage[1], 0.39) end ) Why i don't see image and text "ahoj" ?
Blaawee Posted June 16, 2013 Posted June 16, 2013 ' onPlayerLogin ' it's a server event & The GUI functions a client side.
papam77 Posted June 16, 2013 Author Posted June 16, 2013 join_c.lua ----------------------------------------- -- Join & Quit by DeeJay ----------------------------------------- function ukazToGUI() joinPlayerShowName = guiCreateLabel(0.89, 0.00, 0.11, 0.05, "ahoj", true) guiLabelSetVerticalAlign(joinPlayerShowName, "center") joinPlayerShowImage = guiCreateStaticImage(0.86, 0.00, 0.14, 0.05, "img/join.png", true) guiSetAlpha(joinPlayerShowImage, 0.39) outputChatBox("Ukazano") end addEventHandler("ukazSe", getRootElement(), ukazToGUI ) addEvent("ukazSe",true) join_s.lua ----------------------------------------- -- Join & Quit by DeeJay ----------------------------------------- addEventHandler("onPlayerLogin", root, function() outputChatBox("Trigerovano") triggerClientEvent("ukazSe", getRootElement(), source) end) Where's error ? It doesn't work...
Blaawee Posted June 16, 2013 Posted June 16, 2013 ----------------------------------------- -- Join & Quit by DeeJay ----------------------------------------- addEvent("ukazSe",true) function ukazToGUI( playerName ) joinPlayerShowName = guiCreateLabel(0.89, 0.00, 0.11, 0.05, "ahoj " .. playerName .." ", true) guiLabelSetVerticalAlign(joinPlayerShowName, "center") joinPlayerShowImage = guiCreateStaticImage(0.86, 0.00, 0.14, 0.05, "img/join.png", true) guiSetAlpha(joinPlayerShowImage, 0.39) outputChatBox("Ukazano") end addEventHandler( "ukazSe", getRootElement(), ukazToGUI )
papam77 Posted June 16, 2013 Author Posted June 16, 2013 ERROR: JoinQuit\join_c.lua:7: attempt to concatenate local 'playerName' (a userdata value)
DNL291 Posted June 16, 2013 Posted June 16, 2013 joinPlayerShowName = guiCreateLabel(0.89, 0.00, 0.11, 0.05, "ahoj " .. getPlayerName(playerName), true)
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