A request from Sportacus from our thread.
Included is manual install and ill release a mod if anyone wants.
login.lua
logout.lua
Included is manual install and ill release a mod if anyone wants.
login.lua
Lua:
function onLogin(cid)
--configuration--
local config = {
texttype = TALKTYPE_CHANNEL_W,
channelID = 11,
textprefix = "Login:",
textsuffix = "has logged in!"
}
--end config--
local showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand'))
for _, pid in ipairs(getChannelUsers(config.channelID)) do
if((showGamemasters or getPlayerCustomFlagValue(pid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES) or not getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) and (not isPlayerGhost(cid) or getPlayerGhostAccess(pid) >= getPlayerGhostAccess(cid))) then
doPlayerSendChannelMessage(pid, cid, config.textprefix.." "..getCreatureName(cid).." "..config.textsuffix, config.texttype, config.channelID)
end
end
return true
end
logout.lua
Lua:
function onLogout(cid)
--configuration--
local config = {
texttype = TALKTYPE_CHANNEL_RA,
channelID = 11,
textprefix = "Logout:",
textsuffix = "has left!"
}
--end config--
local showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand'))
for _, pid in ipairs(getChannelUsers(config.channelID)) do
if((showGamemasters or getPlayerCustomFlagValue(pid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES) or not getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) and (not isPlayerGhost(cid) or getPlayerGhostAccess(pid) >= getPlayerGhostAccess(cid))) then
doPlayerSendChannelMessage(pid, cid, config.textprefix.." "..getCreatureName(cid).." "..config.textsuffix, config.texttype, config.channelID)
end
end
return true
end