Tedypig wrote:/setspawn - Sets the default spawn location.
/set static_spawn x,y,zTedypig wrote:/motd - Sets the message of the day.
/set motd Awesome message!/jail <player> - Sends <player> to jail.
/unjail <player> - Releases <player> from jail.
/setjail <x,y,x/blank for current location> - Sets where the jail is.
rarkenin wrote:/jail <player> - Sends <player> to jail.
/unjail <player> - Releases <player> from jail.
/setjail <x,y,x/blank for current location> - Sets where the jail is.
Can be implemented by forcing binding of entities. Moving jail requires old and new locations are in a loaded chunk.
minetest.register_chatcommand ("onjoin", {
params = "<message>",
description = "Sets your Onjoin message",
privs = {onjoin=true}
func = function (name,param)
minetest.chat_send_all ('<name> just set their onjoin message to "[message]"'),
end
if param = nil then
return minetest.chat_send_player ('Invalid name'),
end
if param = true then
minetes.register_on_joinplayer (function(player)
)
})Tedypig wrote:For /onjoin am I heading in the right direction?Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.register_chatcommand ("onjoin", {
params = "<message>",
description = "Sets your Onjoin message",
privs = {onjoin=true}
func = function (name,param)
minetest.chat_send_all ('<name> just set their onjoin message to "[message]"'),
end
if param = nil then
return minetest.chat_send_player ('Invalid name'),
end
if param = true then
minetes.register_on_joinplayer (function(player)
)
})
I am new to coding and this is just what I get from the API tab on the homepage. Feedback?
minetest.register_chatcommand ("onjoin", {
params = "<message>",
description = "Sets your Onjoin message",
privs = {onjoin=true},
func = function(name, param)
if param = nil then
return minetest.chat_send_player ('Invalid name'),
end
if param ~= nil or param ~= "" then
minetest.chat_send_all (name..' just set their onjoin message to '..param)
minetest.register_on_joinplayer (function(player)
--DOSTUFF--
end)
end
end
})
Traxie21 wrote:Tedypig wrote:For /onjoin am I heading in the right direction?Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.register_chatcommand ("onjoin", {
params = "<message>",
description = "Sets your Onjoin message",
privs = {onjoin=true}
func = function (name,param)
minetest.chat_send_all ('<name> just set their onjoin message to "[message]"'),
end
if param = nil then
return minetest.chat_send_player ('Invalid name'),
end
if param = true then
minetes.register_on_joinplayer (function(player)
)
})
I am new to coding and this is just what I get from the API tab on the homepage. Feedback?
Not bad!
Correcting:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.register_chatcommand ("onjoin", {
params = "<message>",
description = "Sets your Onjoin message",
privs = {onjoin=true},
func = function(name, param)
[b] if param = nil then [/b]
return minetest.chat_send_player ('Invalid name'),
end
if param ~= nil or param ~= "" then
minetest.chat_send_all (name..' just set their onjoin message to '..param)
minetest.register_on_joinplayer (function(player)
--DOSTUFF--
end)
end
end
})
local SAVE_FILE_NAME = "player_onjoin.ser"
local function openSaveFile(mode)
local worldDir = minetest.get_worldpath()
local filePath = worldDir.."/"..SAVE_FILE_NAME
return io.open(filePath, mode)
end
local function saveOnjoinData(data)
local saveFile = openSaveFile("w+")
-- Might be better as minetest.log() or something, so we don't crash the server
assert(saveFile, "Could not write onjoin save file")
saveFile:write(minetest.serialize(data))
saveFile:flush()
saveFile:close()
end
local function loadOnjoinData()
local saveFile = openSaveFile("r")
if not saveFile then return nil end
local data = minetest.deserialize(saveFile:read("*a"))
saveFile:close()
return data
end
Traxie21 wrote:Oh boy, thats going to be quite a task for you if you have never done it before....
PilzAdam wrote:Tedypig wrote:/setspawn - Sets the default spawn location.Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
/set static_spawn x,y,zTedypig wrote:/motd - Sets the message of the day.Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
/set motd Awesome message!
/set -n static_spawn x,y,z/set -n motd Awesome message!Users browsing this forum: Bing [Bot] and 15 guests