mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-25 02:00: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:
parent
896d090e84
commit
95c37b3f1d
@ -52,6 +52,7 @@ 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
|
||||||
|
if not default.player_attached[name] == true then
|
||||||
self.driver = clicker
|
self.driver = clicker
|
||||||
clicker:set_attach(self.object, "", {x = 0, y = 11, z = -3}, {x = 0, y = 0, z = 0})
|
clicker:set_attach(self.object, "", {x = 0, y = 11, z = -3}, {x = 0, y = 0, z = 0})
|
||||||
default.player_attached[name] = true
|
default.player_attached[name] = true
|
||||||
@ -59,6 +60,9 @@ boats.register_boat = function(parameters)
|
|||||||
default.player_set_animation(clicker, "sit" , 30)
|
default.player_set_animation(clicker, "sit" , 30)
|
||||||
end)
|
end)
|
||||||
self.object:setyaw(clicker:get_look_yaw() - math.pi / 2)
|
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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user