IRC announcer cleanup

This commit is contained in:
Remy Marquis 2017-03-08 22:31:54 +01:00
parent f2b2cbad20
commit 35689ebe0d

View file

@ -4,7 +4,7 @@
]]-- ]]--
modname = "IRC announcer" modname = "IRC announcer"
version = "0.3" version = "1.0"
function et_InitGame() function et_InitGame()
et.RegisterModname(modname.." "..version) et.RegisterModname(modname.." "..version)
@ -71,7 +71,6 @@ function et_ClientConnect(_clientNum, _firstTime, _isBot)
local clientname local clientname
-- note pers.netname is empty on first connect -- note pers.netname is empty on first connect
clientname = ircColorStr(et.Info_ValueForKey(et.trap_GetUserinfo(_clientNum), "name")) clientname = ircColorStr(et.Info_ValueForKey(et.trap_GetUserinfo(_clientNum), "name"))
-- clientname = et.Q_CleanStr(et.Info_ValueForKey(et.trap_GetUserinfo(_clientNum), "name"))
-- get player type and team count -- get player type and team count
local free, axis, allies, spec = 0, 0, 0, 0 local free, axis, allies, spec = 0, 0, 0, 0
@ -95,10 +94,8 @@ function et_ClientConnect(_clientNum, _firstTime, _isBot)
humans = humans + 1 humans = humans + 1
-- send message -- send message
local msg = "irc_say \"" .. clientname .. " connected to server. Playing now:^7 " .. humans .. "^9(+" .. bots .. ")\"" local msg = "irc_say \"" .. clientname .. " connected to server. Now online:^7 " .. humans .. "^9(+" .. bots .. ")\""
et.trap_SendConsoleCommand(et.EXEC_NOW , ircColorStr(msg)) et.trap_SendConsoleCommand(et.EXEC_NOW , ircColorStr(msg))
-- local msg = "irc_say \"" .. clientname .. " connected to server. Playing now: " .. humans .. "(+" .. bots .. ")\""
-- et.trap_SendConsoleCommand(et.EXEC_NOW , msg)
end end
end end
@ -106,8 +103,4 @@ end
-- local clientname = ircColorStr(et.gentity_get(_clientNum ,"pers.netname")) -- local clientname = ircColorStr(et.gentity_get(_clientNum ,"pers.netname"))
-- local msg = "irc_say \"" .. clientname .. " disconnected from server\"" -- local msg = "irc_say \"" .. clientname .. " disconnected from server\""
-- et.trap_SendConsoleCommand(et.EXEC_NOW , ircColorStr(msg)) -- et.trap_SendConsoleCommand(et.EXEC_NOW , ircColorStr(msg))
--
-- local clientname = et.Q_CleanStr(et.gentity_get(_clientNum ,"pers.netname"))
-- local msg = "irc_say \"" .. clientname .. " disconnected from server\""
-- et.trap_SendConsoleCommand(et.EXEC_NOW , msg)
-- end -- end