Jump to content

no nametag/healthbar and


SirniNamaz

Recommended Posts

aName = string.gsub(name or something in string here,"_"," ") 

Off-topic: Your prefix is wrong, actually should be "sz" and not "a" as the function returns a string not an array. Read Hungarian notation: http://en.wikipedia.org/wiki/Hungarian_notation

On-topic: Here's a better code:

addEventHandler( 'onPlayerChat', root, 
    function( szMessage ) 
        local pPlayer = getPlayerName( source ):gsub( '_', '' ); 
        if( pPlayer ) then 
            cancelEvent( ); 
            outputChatBox( pPlayer .. '#FFFFFF: ' .. szMessage, root, 255, 255, 255, true ); 
            outputServerLog( 'CHAT: ' .. pPlayer .. ': ' .. szMessage ); 
        end 
    end 
); 

Note: This is a server-side code.

Link to comment

Off-topic: Your prefix is wrong, actually should be "sz" and not "a" as the function returns a string not an array. Read Hungarian notation: http://en.wikipedia.org/wiki/Hungarian_notation

I don't think I've seen anyone bother with Hungarian notation in Lua. Or... most languages, really. As long as the naming scheme makes sense, who cares.

If that guy wants to use notation, then he should use it right otherwise it makes no sense of using it.

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