- --[[ ### Automatic Server Messages 1.1 ###]]--
- --[[ ### by H® Shaft for Phasor v2+ ###]]--
- -- Enable server admins to setup automatic server messages: single line messages that will be shown to players based on the delay frequency you set
- -- You can determine the order of the messages as sequential or random: default sequential (see random_order below)
- -- Default: 1 message shown per minute
- -- messages table: add your own, ensure the messages are within quotes, and separated by a comma between each message
- messages = {
- "Message 1",
- "Message 2",
- "Message 3",
- "Message 4",
- "Message 5",
- "Message 6",
- "Message 7",
- "Message 8",
- "Message 9",
- "Message 10"
- }
- -- message order: random order if set to true, sequential (1,2,3,etc) if set to false
- random_order = false
- -- message shown when player joins, followed by player name! Example: Welcome to the best server H® Shaft!
- join_message = "Welcome message here"
- -- message shown when game ends, followed by player name! Example: Thanks for playing in the best server H® Shaft!
- end_message = "Thanks for playing [here]"
- -- delay in minutes between each message, Default: 1 message shown per minute
- message_delay = 1
- function GetRequiredVersion()
- return 200
- end
- function OnScriptLoad(process, game, persistent)
- message_no = 1
- timedmessage = registertimer(message_delay * 60000, "TimedMessages")
- end
- function OnPlayerJoin(player)
- if getplayer(player) then
- privatesay(player, join_message .. " " .. getname(player) .. "! ")
- end
- end
- function TimedMessages(id, count)
- for i = 0,15 do
- if getplayer(i) then
- privatesay(i, messages[message_no])
- if not random_order then
- message_no = message_no + 1
- if message_no > #messages then
- message_no = 1
- end
- else
- if #messages > 1 then
- message_no = getrandomnumber(1, #messages)
- end
- end
- end
- end
- return true
- end
- function OnGameEnd(stage)
- if stage == 1 then
- message_no = 1
- elseif stage == 2 then
- for i = 0,15 do
- if getplayer(i) then
- privatesay(i, end_message " " .. getname(i) .. "!")
- end
- end
- end
- end
- -- Created by H® Shaft thank you to Oxide, AelitePrime, Nugget & Wizard.
- -- Visit http://halorace.org/forum/index.php?topic=514.0 or
- -- Visit http://pastebin.com/u/HR_Shaft for more phasor scripts
Recent Pastes