1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-24 17:50:37 +01: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,6 +52,7 @@ boats.register_boat = function(parameters)
default.player_attached[name] = false
default.player_set_animation(clicker, "stand" , 30)
elseif not self.driver then
if not default.player_attached[name] == true then
self.driver = clicker
clicker:set_attach(self.object, "", {x = 0, y = 11, z = -3}, {x = 0, y = 0, z = 0})
default.player_attached[name] = true
@ -59,6 +60,9 @@ boats.register_boat = function(parameters)
default.player_set_animation(clicker, "sit" , 30)
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