mirror of
https://github.com/niwla23/playerinfo.git
synced 2024-12-22 13:52:28 +01:00
Adding check if player is valid
This commit is contained in:
parent
8b9c5bf8cf
commit
3dbcebac0a
3
init.lua
3
init.lua
@ -13,6 +13,9 @@ minetest.register_chatcommand("seeinfo", {
|
||||
description = "Sets your info",
|
||||
func = function(name, param)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if not player then
|
||||
return false, "Player not found"
|
||||
end
|
||||
local player2getinfo = minetest.get_player_by_name(param)
|
||||
minetest.chat_send_player(player:get_player_name(), player2getinfo:get_attribute("info"))
|
||||
end,
|
||||
|
Loading…
Reference in New Issue
Block a user