mirror of
https://github.com/APercy/airutils.git
synced 2025-03-22 19:02:20 +00:00
added an alias for set_vehicle_name
This commit is contained in:
parent
2da331dd2a
commit
844a677684
1 changed files with 38 additions and 28 deletions
24
init.lua
24
init.lua
|
@ -594,7 +594,7 @@ minetest.register_chatcommand("eject_from_plane", {
|
|||
minetest.register_chatcommand("ground_effect", {
|
||||
params = "<on/off>",
|
||||
description = S("Enables/disables the ground effect (for debug purposes)"),
|
||||
privs = {interact=true},
|
||||
privs = {server=true},
|
||||
func = function(name, param)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if minetest.check_player_privs(name, {server=true}) then
|
||||
|
@ -614,7 +614,7 @@ minetest.register_chatcommand("ground_effect", {
|
|||
minetest.register_chatcommand("show_lift", {
|
||||
params = "<on/off>",
|
||||
description = S("Enables/disables the lift printing (for debug purposes)"),
|
||||
privs = {interact=true},
|
||||
privs = {server=true},
|
||||
func = function(name, param)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if minetest.check_player_privs(name, {server=true}) then
|
||||
|
@ -632,13 +632,10 @@ minetest.register_chatcommand("show_lift", {
|
|||
})
|
||||
|
||||
if airutils._use_signs_api then
|
||||
minetest.register_chatcommand("set_vehicle_name", {
|
||||
params = "<name>",
|
||||
description = S("Sets the vehicle name (when supported by the vehicle)"),
|
||||
privs = {interact = true},
|
||||
func = function(name, param)
|
||||
local function prefix_change(name, param)
|
||||
local colorstring = core.colorize('#ff0000', S(" >>> you are not inside a vehicle"))
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if not player then return end
|
||||
local attached_to = player:get_attach()
|
||||
|
||||
if attached_to ~= nil then
|
||||
|
@ -663,5 +660,18 @@ if airutils._use_signs_api then
|
|||
minetest.chat_send_player(name,colorstring)
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_chatcommand("set_vehicle_name", {
|
||||
params = "<name>",
|
||||
description = S("this command is an aliasfor /set_prefix"),
|
||||
privs = {interact = true},
|
||||
func = prefix_change,
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("set_prefix", {
|
||||
params = "<name>",
|
||||
description = S("Sets the vehicle prefix"),
|
||||
privs = {interact = true},
|
||||
func = prefix_change,
|
||||
})
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue