SirniNamaz Posted September 5, 2012 Posted September 5, 2012 how to disable players nametag and healthbar (the one under player's nametag) and also how can i enable spaces in player's name (or repleace '_' with ' ' [space])
Castillo Posted September 5, 2012 Posted September 5, 2012 1: setPlayerNametagShowing. 2: You can't use spaces as name, but you could set the nametag text with spaces I guess.
SirniNamaz Posted September 5, 2012 Author Posted September 5, 2012 is this also disableing healthbar?
SirniNamaz Posted September 5, 2012 Author Posted September 5, 2012 is there any possibility just to make player's username (the one used in chat) have space in it [example: Firstname Lastname ,no Firstname_Lastname]
scratcher911 Posted September 5, 2012 Posted September 5, 2012 aName = string.gsub(name or something in string here,"_"," ")
Anderl Posted September 5, 2012 Posted September 5, 2012 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.
robhol Posted September 5, 2012 Posted September 5, 2012 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.
Anderl Posted September 5, 2012 Posted September 5, 2012 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.
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