Hello,
would like to request an script that warns or send a message to the gods or gamemaster when a player has logged in to the game, sending the player name in the default channel
i use tfs 1.5 protocol 8.6
onlineMods = onlineMods or {}
local cLogin = CreatureEvent("weON")
function cLogin.onLogin(player)
if player:getAccountType() >= ACCOUNT_TYPE_GAMEMASTER then
onlineMods[player:getName()] = true
else
local msg = ('%s has logged in.'):format(player:getName())
for name, _ in pairs(onlineMods) do
local p = Player(name)
if p then
p:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE,msg)
end
end
end
return true
end
cLogin:register()
Hello,
would like to request an script that warns or send a message to the gods or gamemaster when a player has logged in to the game, sending the player name in the default channel
i use tfs 1.5 protocol 8.6
onlineMods = onlineMods or {}
local cLogin = CreatureEvent("weON")
function cLogin.onLogin(player)
if player:getAccountType() >= ACCOUNT_TYPE_GAMEMASTER then
onlineMods[player:getName()] = true
else
local msg = ('%s has logged in.'):format(player:getName())
for name, _ in pairs(onlineMods) do
local p = Player(name)
if p then
p:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE,msg)
end
end
end
return true
end
cLogin:register()
thank, it works. but it warns to players that are in gamemaster account too. would be possible to change thisLUA:onlineMods = onlineMods or {} local cLogin = CreatureEvent("weON") function cLogin.onLogin(player) if player:getAccountType() >= ACCOUNT_TYPE_GAMEMASTER then onlineMods[player:getName()] = true else local msg = ('%s has logged in.'):format(player:getName()) for name, _ in pairs(onlineMods) do local p = Player(name) if p then p:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE,msg) end end end return true end cLogin:register()
thank, it works. but it warns to players that are in gamemaster account too. would be possible to change this
if player:getAccountType() >= ACCOUNT_TYPE_GAMEMASTER then for something like if character is gamemaster? and not the whole acc
Yes,thank, it works. but it warns to players that are in gamemaster account too. would be possible to change this
if player:getAccountType() >= ACCOUNT_TYPE_GAMEMASTER then for something like if character is gamemaster? and not the whole acc
onlineMods = onlineMods or {}
local cLogin = CreatureEvent("weON")
function cLogin.onLogin(player)
if player:getGroup():getAccess() then
onlineMods[player:getName()] = true
else
local msg = ('%s has logged in.'):format(player:getName())
for name, _ in pairs(onlineMods) do
local p = Player(name)
if p then
p:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE,msg)
end
end
end
return true
end
cLogin:register()
local mods = {}
local minAccountType = ACCOUNT_TYPE_GAMEMASTER
local minGroup = 3
local cLogin = CreatureEvent("weON")
function cLogin.onLogin(player)
if player:getAccountType() >= minAccountType and player:getGroup():getId() >= minGroup then
mods[player:getName()] = true
else
local msg = ('%s has logged in.'):format(player:getName())
for modName, _ in pairs(mods) do
local mod = Player(modName)
if not mod then
mods[modName] = nil
else
mod:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, msg)
end
end
end
return true
end
cLogin:register()
not workingSomething like this (untested):
* Not sure if enumerators exist for group ID'sLUA:local mods = {} local minAccountType = ACCOUNT_TYPE_GAMEMASTER local minGroup = 3 local cLogin = CreatureEvent("weON") function cLogin.onLogin(player) if player:getAccountType() >= minAccountType and player:getGroup():getId() >= minGroup then mods[player:getName()] = true else local msg = ('%s has logged in.'):format(player:getName()) for modName, _ in pairs(mods) do local mod = Player(modName) if not mod then mods[modName] = nil else mod:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, msg) end end end return true end cLogin:register()