2018-11-11 06:58:57 +02:00
|
|
|
local Game = require 'utils.game'
|
|
|
|
local Event = require 'utils.event'
|
2018-11-26 14:40:38 +02:00
|
|
|
local UserGroups = require 'features.user_groups'
|
2018-11-11 06:58:57 +02:00
|
|
|
|
|
|
|
local function player_joined(event)
|
|
|
|
local player = Game.get_player_by_index(event.player_index)
|
|
|
|
if not player or not player.valid then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2018-11-26 14:40:38 +02:00
|
|
|
local message = UserGroups.get_donator_welcome_message(player.name)
|
2018-11-11 06:58:57 +02:00
|
|
|
if not message then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
game.print(table.concat({'*** ', message, ' ***'}), player.chat_color)
|
|
|
|
end
|
|
|
|
|
2018-11-11 17:12:04 +02:00
|
|
|
Event.add(defines.events.on_player_joined_game, player_joined)
|