Jump to content

What's Wrong?


papam77

Recommended Posts

function onlog (player) 
local g_Name = getPlayerName() 
    Label = guiCreateLabel(0.35, 0.97, 0.29, 0.03,""..g_Name.." has been logged in !", true) 
    guiLabelSetHorizontalAlign(Label, "center", false) 
    guiLabelSetVerticalAlign(Label, "center")  
    font = guiCreateFont( "lithos.ttf", 20 ) 
    guiSetFont( Label, font ) 
     end    
     addEvent( "onlog", true ) 
     addEventHandler( "onlog", getRootElement(), onlog ) 

Why it doesn't get my name in label?

Link to comment
function onlog ( thePlayer ) 
    Label = guiCreateLabel(0.35, 0.97, 0.29, 0.03,"[LOGIN] "..getPlayerName( thePlayer )" has been logged in !", true) 
    guiLabelSetHorizontalAlign(Label, "center", false) 
    guiLabelSetVerticalAlign(Label, "center")  
    font = guiCreateFont( "lithos.ttf", 20 ) 
    guiSetFont( Label, font ) 
     end    
     addEvent( "onlog", true ) 
     addEventHandler( "onlog", getRootElement(), onlog ) 

I've tryied this, and nothing.

Link to comment

And this please

function onlog ( source ) 
  
    Label = guiCreateLabel(0.00, 0.97, 1.00, 0.03,gsub("#%x%x%x%x%x%x"),getPlayerName( source ).." has been logged in !", true) 
    guiLabelSetHorizontalAlign(Label, "center", false) 
    guiLabelSetVerticalAlign(Label, "center")  
    font = guiCreateFont( "lithos.ttf", 17 ) 
    guiSetFont( Label, font ) 
     end    
     addEvent( "onlog", true ) 
     addEventHandler( "onlog", getRootElement(), onlog ) 
      
  

Why doesn't work player's name hex color in label?

Link to comment
function onlog ( source ) 
  
    Label = guiCreateLabel(0.00, 0.97, 1.00, 0.03,getPlayerName( source ):gsub("#%x%x%x%x%x%x", "") .." has been logged in !", true) 
    guiLabelSetHorizontalAlign(Label, "center", false) 
    guiLabelSetVerticalAlign(Label, "center")  
    font = guiCreateFont( "lithos.ttf", 17 ) 
    guiSetFont( Label, font ) 
    if ( Label ) then 
    setTimer (destroyElement ( Label ), 5000, 1 ) 
  
     end     
    end  

I've tryied this and nothing.

Link to comment

And last ask

function onlog ( source ) 
  
    Label = guiCreateLabel(0.00, 0.97, 1.00, 0.03,getPlayerName( source ):gsub("#%x%x%x%x%x%x", "") .." has been logged in !", true) 
    guiLabelSetHorizontalAlign(Label, "center", false) 
    guiLabelSetVerticalAlign(Label, "center")  
    font = guiCreateFont( "lithos.ttf", 17 ) 
    guiSetFont( Label, font ) 
    if ( Label ) then 
    setTimer ( destroyElement, 3000, 1, Label ) 
     end     
    end  
addEvent( "onlog", true ) 
     addEventHandler( "onlog", getRootElement(), onlog ) 
      
      
      
      
          function onlogout ( source ) 
          Label2 = guiCreateLabel(0.00, 0.97, 1.00, 0.03,getPlayerName( source ):gsub("#%x%x%x%x%x%x", "") .." has been logged out !", true) 
          guiLabelSetHorizontalAlign(Label2, "center", false) 
     guiLabelSetVerticalAlign(Label2, "center")  
    font = guiCreateFont( "lithos.ttf", 17 ) 
    guiSetFont( Label2, font ) 
    if ( Label2 ) then 
    setTimer ( destroyElement, 3000, 1, Label2 ) 
     end   
     end    
     addEvent( "onlogout", true ) 
     addEventHandler( "onlogout", getRootElement(), onlogout ) 
  
  
  
        
     function onjoin ( source ) 
     Label1 = guiCreateLabel(0.00, 0.97, 1.00, 0.03,getPlayerName( source ):gsub("#%x%x%x%x%x%x", "") .." has been joined to server !", true) 
     guiLabelSetHorizontalAlign(Label1, "center", false) 
     guiLabelSetVerticalAlign(Label1, "center")  
    font = guiCreateFont( "lithos.ttf", 17 ) 
    guiSetFont( Label1, font ) 
     if ( Label1 ) then 
     setTimer ( destroyElement, 3000, 1, Label1 ) 
     end   
     end    
     addEvent( "onjoin", true ) 
     addEventHandler( "onjoin", getRootElement(), onjoin ) 
      

How can do this: When it show "Label" then destroy "Label1" if is on the screen.

Because i made this:

if ( Label ) then 
destroyElement ( Label1 ) 
end 

And it is making bugs.

Link to comment

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...