matthew123456
New Member
- Joined
- Aug 24, 2013
- Messages
- 121
- Reaction score
- 3
looking for script that broadcasts when a gm or admin logs in
usenf tfs 1.3
usenf tfs 1.3
data\creaturescripts\scripts
add a script name it GMLogin.lua
then add this code inside itfunction onLogin(player)
if player:getAccountType() < ACCOUNT_TYPE_GAMEMASTER then
Game.broadcastMessage ("' .. player:getName() .. ' Has now logged in", MESSAGE_STATUS_WARNING)
end
end
data\creaturescripts\creaturescripts.xml
add this<event type="login" name="GMLogin" script="GMLogin.lua" />
data\creaturescripts\scripts\login.lua
add this (Not sure if its needed)player:registerEvent("GMLogin")
<event type="login" name="InnerCircleBadBoys" script="popo.lua" />
function onLogin(player)
if player:getAccountType() < ACCOUNT_TYPE_GAMEMASTER then
return true
end
-- GM message
local message = "The constabulary has arrived!"
-- God message
if player:getAccountType() == ACCOUNT_TYPE_GOD then
message = "Judgment day is here!"
end
-- Color choices
-- MESSAGE_STATUS_WARNING = 18, /*Red message in game window and in the console*/
-- MESSAGE_EVENT_ADVANCE = 19, /*White message in game window and in the console*/
-- MESSAGE_INFO_DESCR = 22, /*Green message in game window and in the console*/
Game.broadcastMessage(message, MESSAGE_STATUS_WARNING)
print("> Broadcasted message: \"" .. message .. "\".")
return true
end
-- in the middle
local string1 = "string text" .. player:getName() .. "more string text"
-- at the end, no dots, only use dots as a connector
local string2 = "string text" .. player:getName()
-- at the beginning
local string3 = player:getName() .. "string text"
-- example
local message = "The Gamemaster " .. player:getName() .. " has logged in! Cavebotters beware!"