*FuN Posted February 12, 2012 Posted February 12, 2012 Hi guys, I have a problem , when a guy join in my server appears #000fffNo#000000Ne and when a player die Appears the same way someone can fix ?? thankz
Kenix Posted February 12, 2012 Posted February 12, 2012 In resources joinquit,killmessages use this function: _getPlayerName = getPlayerName function getPlayerName( el ) if isElement( el ) then local name = _getPlayerName( el ) if name then return string.gsub( name, '#%x%x%x%x%x%x', '' ) or name end return false end return false end Example _getPlayerName = getPlayerName function getPlayerName( el ) if isElement( el ) then local name = _getPlayerName( el ) if name then return string.gsub( name, '#%x%x%x%x%x%x', '' ) or name end return false end return false end -- .... code Example resource joinquit: joinquit.lua g_Root = getRootElement() _getPlayerName = getPlayerName function getPlayerName( el ) if isElement( el ) then local name = _getPlayerName( el ) if name then return string.gsub( name, '#%x%x%x%x%x%x', '' ) or name end return false end return false end addEventHandler('onClientPlayerJoin', g_Root, function() outputChatBox('* ' .. getPlayerName(source) .. ' has joined the game', 255, 100, 100) end ) addEventHandler('onClientPlayerChangeNick', g_Root, function(oldNick, newNick) outputChatBox('* ' .. oldNick .. ' is now known as ' .. newNick, 255, 100, 100) end ) addEventHandler('onClientPlayerQuit', g_Root, function(reason) outputChatBox('* ' .. getPlayerName(source) .. ' has left the game [' .. reason .. ']', 255, 100, 100) end )
*FuN Posted February 12, 2012 Author Posted February 12, 2012 In resources joinquit,killmessages use this function: _getPlayerName = getPlayerName function getPlayerName( el ) if isElement( el ) then local name = _getPlayerName( el ) if name then return string.gsub( name, '#%x%x%x%x%x%x', '' ) or name end return false end return false end Example _getPlayerName = getPlayerName function getPlayerName( el ) if isElement( el ) then local name = _getPlayerName( el ) if name then return string.gsub( name, '#%x%x%x%x%x%x', '' ) or name end return false end return false end -- .... code In joinquit what file i have replace??
Kenix Posted February 12, 2012 Posted February 12, 2012 Find file joinquit.lua in resource joinquit. Open and replace with this: g_Root = getRootElement() _getPlayerName = getPlayerName function getPlayerName( el ) if isElement( el ) then local name = _getPlayerName( el ) if name then return string.gsub( name, '#%x%x%x%x%x%x', '' ) or name end return false end return false end addEventHandler('onClientPlayerJoin', g_Root, function() outputChatBox('* ' .. getPlayerName(source) .. ' has joined the game', 255, 100, 100) end ) addEventHandler('onClientPlayerChangeNick', g_Root, function(oldNick, newNick) outputChatBox('* ' .. oldNick .. ' is now known as ' .. newNick, 255, 100, 100) end ) addEventHandler('onClientPlayerQuit', g_Root, function(reason) outputChatBox('* ' .. getPlayerName(source) .. ' has left the game [' .. reason .. ']', 255, 100, 100) end ) In other resources paste this: _getPlayerName = getPlayerName function getPlayerName( el ) if isElement( el ) then local name = _getPlayerName( el ) if name then return string.gsub( name, '#%x%x%x%x%x%x', '' ) or name end return false end return false end Upper code.
Kenix Posted February 12, 2012 Posted February 12, 2012 (edited) Paste the code it up. _getPlayerName = getPlayerName function getPlayerName( el ) if isElement( el ) then local name = _getPlayerName( el ) if name then return string.gsub( name, '#%x%x%x%x%x%x', '' ) or name end return false end return false end Edited February 12, 2012 by Guest
*FuN Posted February 12, 2012 Author Posted February 12, 2012 Paste it up code. _getPlayerName = getPlayerName function getPlayerName( el ) if isElement( el ) then local name = _getPlayerName( el ) if name then return string.gsub( name, '#%x%x%x%x%x%x', '' ) or name end return false end return false end But where?
*FuN Posted February 12, 2012 Author Posted February 12, 2012 In script files resource. Sorry , but i'm not understand
Kenix Posted February 12, 2012 Posted February 12, 2012 In script files resource. Sorry , but i'm not understand Open folder:mta_folder/server/mods/deathmatch/ Find resource killmessages.zip Open it for example with winrar. Open script files for example with notepad++ : killmessages_client.lua/killmessages_server.lua ( lua expansion ) And paste it: _getPlayerName = getPlayerName function getPlayerName( el ) if isElement( el ) then local name = _getPlayerName( el ) if name then return string.gsub( name, '#%x%x%x%x%x%x', '' ) or name end return false end return false end At the top of the script file.
*FuN Posted February 12, 2012 Author Posted February 12, 2012 In script files resource. Sorry , but i'm not understand Open folder:mta_folder/server/mods/deathmatch/ Find resource killmessages.zip Open it for example with winrar. Open script files for example with notepad++ : killmessages_client.lua/killmessages_server.lua ( lua expansion ) And paste it: _getPlayerName = getPlayerName function getPlayerName( el ) if isElement( el ) then local name = _getPlayerName( el ) if name then return string.gsub( name, '#%x%x%x%x%x%x', '' ) or name end return false end return false end At the top of the script file. thankz
Kenix Posted February 12, 2012 Posted February 12, 2012 No problem. Do the same but with a resource joinquit. Open folder:mta_folder/server/mods/deathmatch/ Find resource joinquit.zip Open it for example with winrar. Open script files for example with notepad++ : joinquit.lua ( lua expansion ) And paste it: _getPlayerName = getPlayerName function getPlayerName( el ) if isElement( el ) then local name = _getPlayerName( el ) if name then return string.gsub( name, '#%x%x%x%x%x%x', '' ) or name end return false end return false end At the top of the script file.
*FuN Posted February 12, 2012 Author Posted February 12, 2012 Now appears none but not show the colour ??? Its a error ou bug ??
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