mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-25 02:00:37 +01:00
improve _misc mod nointeract_messages.lua and noshout_messages.lua
This commit is contained in:
parent
bd5ffcf50d
commit
4d5607e849
@ -1,17 +1,31 @@
|
|||||||
local TIMER = 0
|
|
||||||
minetest.register_globalstep(function(dtime)
|
local players = {}
|
||||||
TIMER = TIMER + dtime
|
|
||||||
if TIMER < 20 then return end
|
local function tick(name)
|
||||||
TIMER = 0
|
if players[name] == nil then return end
|
||||||
for _,player in ipairs(minetest.get_connected_players()) do
|
if not minetest.get_player_by_name(name) or minetest.check_player_privs(name, {interact=true}) == true then
|
||||||
local name = player:get_player_name()
|
players[name] = nil
|
||||||
if not minetest.check_player_privs(name, {interact=true}) then
|
return
|
||||||
if not interact.blacklist[name] then
|
end
|
||||||
if minetest.check_player_privs(name, {shout=true}) then
|
if minetest.check_player_privs(name, {shout=true}) then
|
||||||
minetest.chat_send_player(name, "Hey " .. name .. " ! Pour pouvoir construire et intéragir sur ce serveur, tu dois lire les règles du serveur et les accepter. Tape /rules.")
|
minetest.chat_send_player(name, "Hey " .. name .. " ! Pour pouvoir construire et intéragir sur ce serveur, tu dois lire les règles du serveur et les accepter. Tape /rules.")
|
||||||
minetest.chat_send_player(name, "Hey " .. name .. " ! To build and interact on this server, you have to read the rules of our server and agree them. Type /rules.")
|
minetest.chat_send_player(name, "Hey " .. name .. " ! To build and interact on this server, you have to read the rules of our server and agree them. Type /rules.")
|
||||||
end
|
end
|
||||||
|
minetest.after(20, tick, name)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
|
minetest.register_on_joinplayer(function(player)
|
||||||
|
local name = player:get_player_name()
|
||||||
|
if not minetest.check_player_privs(name, {interact=true}) and players[name] == nil then
|
||||||
|
minetest.after(7, tick, name)
|
||||||
|
players[name] = true
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_on_leaveplayer(function(player)
|
||||||
|
local name = player:get_player_name()
|
||||||
|
if not name then return end
|
||||||
|
players[name] = nil
|
||||||
|
end)
|
||||||
|
@ -1,13 +1,30 @@
|
|||||||
local TIMER = 0
|
|
||||||
minetest.register_globalstep(function(dtime)
|
local players = {}
|
||||||
TIMER = TIMER + dtime
|
|
||||||
if TIMER < 25 then return end
|
local function tick(name)
|
||||||
TIMER = 0
|
if players[name] == nil then return end
|
||||||
for _,player in ipairs(minetest.get_connected_players()) do
|
if not minetest.get_player_by_name(name) or minetest.check_player_privs(name, {shout=true}) == true then
|
||||||
local name = player:get_player_name()
|
players[name] = nil
|
||||||
if not minetest.check_player_privs(name, {shout=true}) then
|
return
|
||||||
|
end
|
||||||
|
|
||||||
minetest.chat_send_player(name, "Hey " .. name .. " ! Pour pouvoir communiquer avec les autres joueurs sur ce serveur, tu dois lire les règles de l'irc et les accepter. Tape /irc.")
|
minetest.chat_send_player(name, "Hey " .. name .. " ! Pour pouvoir communiquer avec les autres joueurs sur ce serveur, tu dois lire les règles de l'irc et les accepter. Tape /irc.")
|
||||||
minetest.chat_send_player(name, "Hey " .. name .. " ! To speak to other people on this server, you have to read the rules of our irc channel and agree them. Type /irc.")
|
minetest.chat_send_player(name, "Hey " .. name .. " ! To speak to other people on this server, you have to read the rules of our irc channel and agree them. Type /irc.")
|
||||||
|
minetest.after(20, tick, name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_on_joinplayer(function(player)
|
||||||
|
local name = player:get_player_name()
|
||||||
|
if not minetest.check_player_privs(name, {interact=true}) and players[name] == nil then
|
||||||
|
minetest.after(5, tick, name)
|
||||||
|
players[name] = true
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
|
minetest.register_on_leaveplayer(function(player)
|
||||||
|
local name = player:get_player_name()
|
||||||
|
if not name then return end
|
||||||
|
players[name] = nil
|
||||||
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user