From 47595e78698f59938c8693cc2df4a593b2e05ae0 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Sun, 9 Jul 2023 03:11:34 +0200 Subject: [PATCH] effect give compass to player moved to yl_npc --- yl_local_server_do_on_reload.lua | 45 -------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 yl_local_server_do_on_reload.lua diff --git a/yl_local_server_do_on_reload.lua b/yl_local_server_do_on_reload.lua deleted file mode 100644 index 04df660..0000000 --- a/yl_local_server_do_on_reload.lua +++ /dev/null @@ -1,45 +0,0 @@ --- hand out a preconfigured waypoint compass to the player -yl_speak_up.custom_functions_r_[ "give_compass" ] = { - description = "Hand out a preconfigured compass to the player.", - param1_text = "X coordinate:", - param1_desc = "The compass will be set to this x coordinate.", - param2_text = "Y coordinate:", - param2_desc = "The compass will be set to this y coordinate.", - param3_text = "Z coordinate:", - param3_desc = "The compass will be set to this z coordinate.", - param4_text = "Name of target location:", - param4_desc = "This is how the target location will be called on the compass, i.e. \"Tribe Micoene Camp\".", - param5_text = "Color code in Hex:", - param5_desc = "Give the color for the compass here. Example: \"FFD700\". Needs to be 6 characters long, with each character ranging from 0-9 or beeing A, B, C, D, E or F.", - code = function(player, n_id, r) - local pname = player:get_player_name() - local coords = core.string_to_pos((r.r_param1 or "0")..",".. - (r.r_param2 or "0")..",".. - (r.r_param3 or "0")) - local town = (r.r_param4 or "- some place somewhere -") - local color = "0x"..(r.r_param5 or "FFFFFF") - -- so that players cannot change the compass - local compass_owner = "Service" - if(not(coords)) then - minetest.chat_send_player(pname, "Sorry. There was an internal error with the ".. - "coordinates. Please inform whoever is responsible for this NPC.") - - return false - end - -- TODO: mostly for debugging - minetest.chat_send_player(pname, "You received a compass to location \"".. - town.."\" located at "..minetest.pos_to_string(coords)..".") - -- no compass mod? then no way to hand one out - if(not(minetest.global_exists("waypoint_compass"))) then - minetest.chat_send_player(pname, "Error: Missing waypoint compass mod!") - return false - end - -- the compass will be owned by Service (so the player can't reset it) - --core.get_player_by_name(player):get_inventory():add_item("main",waypoint_compass.make_compass(coords,"Service",town,0xFFD700)) - player:get_inventory():add_item("main", - waypoint_compass.make_compass(coords, compass_owner, town, 0xFFD700)) - - -- the function was successful (effects only return true or false) - return true - end, -}