Jump to content

question about log


Chaos

Recommended Posts

Posted

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 ) 
  
  
  

Posted

Because you are triggering it to 'source', not to 'root'.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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

Posted
Because you are triggering it to 'source', not to 'root'.

thanks a lot so should be ?

triggerClientEvent(source,"showStatus",root,name,accountName) 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...