Chaos Posted August 17, 2014 Share Posted August 17, 2014 hey, so the question is why when others logged in it's won't appear his login log in memo and only show my login log ? server side : function showStatus () name = getPlayerName(source) account = getPlayerAccount(source) accountName = getAccountName (account) triggerClientEvent(source,"showStatus",source,name,accountName) end addEventHandler ("onPlayerLogin", getRootElement(), showStatus) Client side: GUIEditor = { button = {}, window = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() wnd = guiCreateWindow(194, 118, 349, 331, "Info Panel", false) guiWindowSetSizable(wnd, false) guiSetVisible ( wnd, false ) memo = guiCreateMemo(10, 22, 328, 261, "", false, wnd) end ) function otworz () if ( guiGetVisible ( wnd )) == false then guiSetVisible ( wnd, true ) showCursor ( true ) else guiSetVisible ( wnd, false ) showCursor ( false ) end end addCommandHandler("showlog",otworz) function changer (name,accountName) local gText = guiGetText(memo) if (gText ~= false) then guiSetText(memo,"\n"..name.." has logged in as "..accountName) end end addEvent ( "showStatus", true ) addEventHandler ( "showStatus", getRootElement(), changer ) Link to comment
Et-win Posted August 17, 2014 Share Posted August 17, 2014 guiSetText(memo,"\n"..name.." has logged in as "..accountName) To: local gText = guiGetText(memo) guiSetText(memo, gText.."\n"..name.." has logged in as "..accountName) Link to comment
Castillo Posted August 17, 2014 Share Posted August 17, 2014 Because you are triggering it to 'source', not to 'root'. Link to comment
Chaos Posted August 17, 2014 Author Share Posted August 17, 2014 guiSetText(memo,"\n"..name.." has logged in as "..accountName) To: local gText = guiGetText(memo) guiSetText(memo, gText.."\n"..name.." has logged in as "..accountName) [/quotem] my bad thanks a lot Link to comment
Chaos Posted August 17, 2014 Author Share Posted August 17, 2014 Because you are triggering it to 'source', not to 'root'. thanks a lot so should be ? triggerClientEvent(source,"showStatus",root,name,accountName) Link to comment
Et-win Posted August 17, 2014 Share Posted August 17, 2014 Because you are triggering it to 'source', not to 'root'. That too yes. Because you are triggering it to 'source', not to 'root'. thanks a lot so should be ? triggerClientEvent(source,"showStatus",root,name,accountName) Yush. Link to comment
Chaos Posted August 17, 2014 Author Share Posted August 17, 2014 but it keeps appear only for me Link to comment
Et-win Posted August 17, 2014 Share Posted August 17, 2014 Oops, sorry. The first source, remove it. And replace root with source again. Link to comment
Chaos Posted August 17, 2014 Author Share Posted August 17, 2014 yeah it worked thanks again. 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