SirniNamaz Posted September 5, 2012 Share 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]) Link to comment
Castillo Posted September 5, 2012 Share 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. Link to comment
SirniNamaz Posted September 5, 2012 Author Share Posted September 5, 2012 is this also disableing healthbar? Link to comment
Castillo Posted September 5, 2012 Share Posted September 5, 2012 Yes, it should hide the whole nametag. Link to comment
SirniNamaz Posted September 5, 2012 Author Share 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] Link to comment
scratcher911 Posted September 5, 2012 Share Posted September 5, 2012 aName = string.gsub(name or something in string here,"_"," ") Link to comment
Anderl Posted September 5, 2012 Share 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. Link to comment
robhol Posted September 5, 2012 Share 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. Link to comment
Anderl Posted September 5, 2012 Share 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. Link to comment
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