diff options
Diffstat (limited to 'advtrains/protection.lua')
-rw-r--r-- | advtrains/protection.lua | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/advtrains/protection.lua b/advtrains/protection.lua index 36f4192..ac1cd66 100644 --- a/advtrains/protection.lua +++ b/advtrains/protection.lua @@ -25,13 +25,6 @@ minetest.register_privilege("railway_operator", { give_to_singleplayer= true, }); --- Other privileges -minetest.register_privilege("train_ghost", { - description = "Poskytuje imunitu proti sražení vlakem.", - give_to_singleplayer = false, -}); - - -- there is a configuration option "allow_build_only_owner". If this is active, a player having track_builder can only build rails and operate signals/turnouts in an area explicitly belonging to him -- (checked using a dummy player called "*dummy*" (which is not an allowed player name)) @@ -152,24 +145,12 @@ function advtrains.check_track_protection(pos, pname, near, prot_p) --atdebug("CTP: ",pos,pname,near,prot_p,"priv=",priv,"prot=",prot,"dprot=",dprot) if not priv and (not boo or prot or not dprot) then - local s - if near then - s = "Nemůžete stavět poblíž kolejí, protože vám chybí právo track_builder. Pokud toto právo chcete, domluvte se s Administrací." - else - s = "Nemůžete stavět koleje, protože vám chybí právo track_builder. Pokud toto právo chcete, domluvte se s Administrací." - end - minetest.chat_send_player(pname, s) + minetest.chat_send_player(pname, near and attrans("You are not allowed to build near tracks without the track_builder privilege.") or attrans("You are not allowed to build tracks without the track_builder privilege.")) minetest.log("action", pname.." tried to modify terrain "..nears.."track at "..minetest.pos_to_string(apos).." but is not permitted to (no privilege)") return false end if prot then - local s - if near then - s = "Zde nemůžete stavět, protože oblast je zastřežena!" - else - s = "Zde nemůžete stavět koleje, protože oblast je zastřežena!" - end - minetest.chat_send_player(pname, s) + minetest.chat_send_player(pname, near and attrans("You are not allowed to build near tracks at this protected position.") or attrans("You are not allowed to build tracks at this protected position.")) minetest.record_protection_violation(pos, pname) minetest.log("action", pname.." tried to modify "..nears.."track at "..minetest.pos_to_string(apos).." but position is protected!") return false @@ -200,7 +181,7 @@ function advtrains.check_turnout_signal_protection(pos, pname) nocheck=false return true else - minetest.chat_send_player(pname, "Nemůžete ovládat výhybky a návěstidla. (požadované právo: railway_operator)") + minetest.chat_send_player(pname, attrans("You are not allowed to operate turnouts and signals without the railway_operator privilege.")) minetest.log("action", pname.." tried to operate turnout/signal at "..minetest.pos_to_string(pos).." but does not have railway_operator") nocheck=false return false |