1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-09-28 23:40:34 +02:00

Forbidden the control over two boats by a single player

- Sent a chat message when a player wants to ride a new boat while he is
   attached on another one.
This commit is contained in:
LeMagnesium 2015-05-06 11:05:20 +02:00
parent 896d090e84
commit 95c37b3f1d

View File

@ -52,13 +52,17 @@ boats.register_boat = function(parameters)
default.player_attached[name] = false default.player_attached[name] = false
default.player_set_animation(clicker, "stand" , 30) default.player_set_animation(clicker, "stand" , 30)
elseif not self.driver then elseif not self.driver then
self.driver = clicker if not default.player_attached[name] == true then
clicker:set_attach(self.object, "", {x = 0, y = 11, z = -3}, {x = 0, y = 0, z = 0}) self.driver = clicker
default.player_attached[name] = true clicker:set_attach(self.object, "", {x = 0, y = 11, z = -3}, {x = 0, y = 0, z = 0})
minetest.after(0.2, function() default.player_attached[name] = true
default.player_set_animation(clicker, "sit" , 30) minetest.after(0.2, function()
end) default.player_set_animation(clicker, "sit" , 30)
self.object:setyaw(clicker:get_look_yaw() - math.pi / 2) end)
self.object:setyaw(clicker:get_look_yaw() - math.pi / 2)
else
minetest.chat_send_player(name, "You're already on a boat")
end
end end
end end