Chaos Posted August 17, 2014 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 )
Et-win Posted August 17, 2014 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)
Castillo Posted August 17, 2014 Posted August 17, 2014 Because you are triggering it to 'source', not to 'root'.
Chaos Posted August 17, 2014 Author 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
Chaos Posted August 17, 2014 Author 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)
Et-win Posted August 17, 2014 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.
Et-win Posted August 17, 2014 Posted August 17, 2014 Oops, sorry. The first source, remove it. And replace root with source again.
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