Extra commands(alpha 0.1)

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

Extra commands(alpha 0.1)

by jordan4ibanez » Post

Here's spawn & /afk command:

Code: Select all

spawn = {x = 47, y = 7.5, z = -40.5}

minetest.register_on_chat_message(function(name, message, playername, player)
    local cmd = "/spawn"
    if message:sub(0, #cmd) == cmd then
        if message == '/spawn' then
        local player = minetest.env:get_player_by_name(name)
        minetest.chat_send_player(player:get_player_name(), "Teleporting to spawn...")
        player:setpos(spawn)
        return true --deds to sfan5
        end
    end

    local cmd ="/afk"
    if message:sub(0, #cmd) == cmd then
            if message == '/afk' then
            local player = minetest.env:get_player_by_name(name)
            minetest.chat_send_all(name.." is AFK! ")
            return true --deds to sfan5
        end
    end
end)

--Deds to Kahrl
minetest.register_on_newplayer(function(player)
    player:setpos(spawn)
    return true
end)

--Deds to Kahrl
minetest.register_on_respawnplayer(function(player, pos)
    player:setpos(spawn)
    return true
end)
Replace x=0 y=0 z=0 with your spawn quards

Features:
-/spawn command (returns you to spawn)
-puts new players in the spawn
-puts players into spawn on death
-/afk command (prints playername is AFK!)

To do:
-Merge Randomproof's awesome code
-Make Admins ..that can set spawn(randomproof)
-Make /afk print "PLAYER is no longer AFK!" if player moves or if /afk is sent again
-Add a death notice using (minetest.register_on_dieplayer) ..so use (player, "has died!")
-When death notice is made then have the possibility of death information..if a player is in lava ..then print (player, "burned to death") or (player, "hit the ground too hard!")
-/jail command
-/setjail command
-/unjail command
Jail command would work better than in minecraft's bukkit server..basically /setjail would work like /setspawn would
/jail "player" would send a person into an unbreakable (hopefully) area which if they move ..they are sent back to the exact place where /setjail was sent this would also remove all their items ..and /unjail "player" would release the player back into the spawn
Last edited by jordan4ibanez on Thu Mar 08, 2012 22:42, edited 1 time in total.
hello, am program. do language in rust. make computer do. okay i go now.

User avatar
Death Dealer
Member
Posts: 1379
Joined: Wed Feb 15, 2012 18:46
Location: Limbo
Contact:

by Death Dealer » Post

Nice
Keep calm and code python^_^

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Post

Death Dealer wrote:Nice
thank you!
hello, am program. do language in rust. make computer do. okay i go now.

Gatharoth
Member
Posts: 196
Joined: Thu Dec 22, 2011 02:54

by Gatharoth » Post

Okay, so I remember you said something that even kahrl couldn't even force the respawn.

Now what if you used

minetest.register_on_dieplayer(func(ObjectRef))

or this

minetest.register_on_respawnplayer(func(ObjectRef))?

I can think of a work-around for the respawn with the register_on_respawnplayer. When the player respawns, you can check if the player has a set spawn, if he/she does, then you teleport the player to that spawn point.

I don't know if you can force a player respawn via lua or not. So I am not sure about the register_on_dieplayer.

sfan5
Moderator
Posts: 4094
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

by sfan5 » Post

Nice Mod!
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Post

Gatharoth wrote:Okay, so I remember you said something that even kahrl couldn't even force the respawn.

Now what if you used

minetest.register_on_dieplayer(func(ObjectRef))

or this

minetest.register_on_respawnplayer(func(ObjectRef))?

I can think of a work-around for the respawn with the register_on_respawnplayer. When the player respawns, you can check if the player has a set spawn, if he/she does, then you teleport the player to that spawn point.

I don't know if you can force a player respawn via lua or not. So I am not sure about the register_on_dieplayer.
oh i figured out what was wrong :P
sfan5 wrote:Nice mod!
thank you! hopefully i get more and more commands into it :D
hello, am program. do language in rust. make computer do. okay i go now.

Utilisatrice
Member
Posts: 103
Joined: Thu Feb 16, 2012 18:04

by Utilisatrice » Post

Hi,

How to use this ?

sfan5
Moderator
Posts: 4094
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

by sfan5 » Post

Look in the first Post!
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

Utilisatrice
Member
Posts: 103
Joined: Thu Feb 16, 2012 18:04

by Utilisatrice » Post

Hi sfan5,

No, I know how to use in game but where I must place this file, I need to recompile the source ? Or I myself was in the mod folder?

Jordach
Member
Posts: 4534
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach
Location: Blender Scene

by Jordach » Post

Nope. Copy and paste that into a file called init.lua

Now, move that into /minetest/data/mods/command/init.lua

Then the commands can be used.

randomproof
Member
Posts: 214
Joined: Thu Nov 17, 2011 06:31
Location: California, USA

by randomproof » Post

Here, I wrote a version that will save the players position to a file. I also fixed the chat commands a bit. To save a spawn point just got where you ant it and type "/setspawn" that is it. Right now a mod can not set what direction you are looking so you will be looking in whatever direction you were look in in when you died. Also you should set the variable 'default_spawn' to a good value.

Code: Select all

-- needed by 'table_save' and 'table_load'
local function exportstring( s )
  s = string.format( "%q",s )
  -- to replace
  s = string.gsub( s,"\\\n","\\n" )
  s = string.gsub( s,"\r","\\r" )
  s = string.gsub( s,string.char(26),"\"..string.char(26)..\"" )
  return s
end
--// The Save Function
local function table_save(  tbl,filename )
   local charS,charE = "   ","\n"
   local file,err
   -- create a pseudo file that writes to a string and return the string
   if not filename then
      file =  { write = function( self,newstr ) self.str = self.str..newstr end, str = "" }
      charS,charE = "",""
   -- write table to tmpfile
   elseif filename == true or filename == 1 then
      charS,charE,file = "","",io.tmpfile()
   -- write table to file
   -- use io.open here rather than io.output, since in windows when clicking on a file opened with io.output will create an error
   else
      file,err = io.open( filename, "w" )
      if err then return _,err end
   end
   -- initiate variables for save procedure
   local tables,lookup = { tbl },{ [tbl] = 1 }
   file:write( "return {"..charE )
   for idx,t in ipairs( tables ) do
      if filename and filename ~= true and filename ~= 1 then
         file:write( "-- Table: {"..idx.."}"..charE )
      end
      file:write( "{"..charE )
      local thandled = {}
      for i,v in ipairs( t ) do
         thandled[i] = true
         -- escape functions and userdata
         if type( v ) ~= "userdata" then
            -- only handle value
            if type( v ) == "table" then
               if not lookup[v] then
                  table.insert( tables, v )
                  lookup[v] = #tables
               end
               file:write( charS.."{"..lookup[v].."},"..charE )
            elseif type( v ) == "function" then
               file:write( charS.."loadstring("..exportstring(string.dump( v )).."),"..charE )
            else
               local value =  ( type( v ) == "string" and exportstring( v ) ) or tostring( v )
               file:write(  charS..value..","..charE )
            end
         end
      end
      for i,v in pairs( t ) do
         -- escape functions and userdata
         if (not thandled[i]) and type( v ) ~= "userdata" then
            -- handle index
            if type( i ) == "table" then
               if not lookup[i] then
                  table.insert( tables,i )
                  lookup[i] = #tables
               end
               file:write( charS.."[{"..lookup[i].."}]=" )
            else
               local index = ( type( i ) == "string" and "["..exportstring( i ).."]" ) or string.format( "[%d]",i )
               file:write( charS..index.."=" )
            end
            -- handle value
            if type( v ) == "table" then
               if not lookup[v] then
                  table.insert( tables,v )
                  lookup[v] = #tables
               end
               file:write( "{"..lookup[v].."},"..charE )
            elseif type( v ) == "function" then
               file:write( "loadstring("..exportstring(string.dump( v )).."),"..charE )
            else
               local value =  ( type( v ) == "string" and exportstring( v ) ) or tostring( v )
               file:write( value..","..charE )
            end
         end
      end
      file:write( "},"..charE )
   end
   file:write( "}" )
   -- Return Values
   -- return stringtable from string
   if not filename then
      -- set marker for stringtable
      return file.str.."--|"
   -- return stringttable from file
   elseif filename == true or filename == 1 then
      file:seek ( "set" )
      -- no need to close file, it gets closed and removed automatically
      -- set marker for stringtable
      return file:read( "*a" ).."--|"
   -- close file and return 1
   else
      file:close()
      return 1
   end
end

--// The Load Function
local function table_load( sfile )
   -- catch marker for stringtable
   if string.sub( sfile,-3,-1 ) == "--|" then
      tables,err = loadstring( sfile )
   else
      tables,err = loadfile( sfile )
   end
   if err then return _,err
   end
   tables = tables()
   for idx = 1,#tables do
      local tolinkv,tolinki = {},{}
      for i,v in pairs( tables[idx] ) do
         if type( v ) == "table" and tables[v[1]] then
            table.insert( tolinkv,{ i,tables[v[1]] } )
         end
         if type( i ) == "table" and tables[i[1]] then
            table.insert( tolinki,{ i,tables[i[1]] } )
         end
      end
      -- link values, first due to possible changes of indices
      for _,v in ipairs( tolinkv ) do
         tables[idx][v[1]] = v[2]
      end
      -- link indices
      for _,v in ipairs( tolinki ) do
         tables[idx][v[2]],tables[idx][v[1]] =  tables[idx][v[1]],nil
      end
   end
   return tables[1]
end

local spawn_locations_db_filename = minetest.get_worldpath() .. "/spawn_locations.tbl"

spawn_locations = table_load(spawn_locations_db_filename)

if type(spawn_locations) ~= "table" then
    spawn_locations = {}
end

default_spawn = {x = 0, y = 0, z = 0}

minetest.register_on_chat_message(function(name, message)
    cmd = "/setspawn"
    if message:sub(0, #cmd) == cmd then
        player = minetest.env:get_player_by_name(name)
        spawn_locations[name] = player:getpos()

        table_save( spawn_locations, spawn_locations_db_filename )
        return true
    end
    cmd = "/afk"
    if message:sub(0, #cmd) == cmd then
        minetest.chat_send_all(name, " is AFK!")
        return true
    end
    cmd = "/not_afk"
    if message:sub(0, #cmd) == cmd then
        minetest.chat_send_all(name, " is back from AFK!")
        return true
    end
end)

--Deds to Kahrl
minetest.register_on_newplayer(function(player)
    player:setpos(default_spawn)
    return true
end)

--Deds to Kahrl
minetest.register_on_respawnplayer(function(player, pos)
    name = player:get_player_name()
    if spawn_locations[name] ~= nil then
        player:setpos(spawn_locations[name])
    else
        player:setpos(default_spawn)
    end
    return true
end)
Last edited by randomproof on Thu Mar 08, 2012 16:40, edited 1 time in total.

Utilisatrice
Member
Posts: 103
Joined: Thu Feb 16, 2012 18:04

by Utilisatrice » Post

Hi,

Yes, it works there had a ")" in too, so the command /spawn works but the command /afk doesn't work :

Code: Select all

17:37:53: ERROR[ServerThread]: ERROR: An unhandled exception occurred: LuaError: error: ...t\minetest\bin\Release\..\data\mods\command\init.lua:19: bad argument #1 to 'chat_send_all' (string expected, got userdata)
17:37:53: ERROR[ServerThread]: stack traceback:

In thread 5080:
C:\Users\****\Desktop\Minetest\minetest\src\server.cpp:113: ServerThread::Thread: Assertion '0' failed.
Debug stacks:
DEBUG STACK FOR THREAD 5080:
#0  ServerThread::Thread
(Leftover data: #1  Server::Receive)
(Leftover data: #2  Server::ProcessData)
(Leftover data: #3  Server::getClient)
(Leftover data: #4  BlockEmergeQueue::addBlock)
DEBUG STACK FOR THREAD 51dc:
#0  main
(Leftover data: #1  ClientMap::renderMap)
(Leftover data: #2  ClientEnvironment::step)
(Leftover data: #3  Client::Receive)
(Leftover data: #4  Client::ProcessData)
(Leftover data: #5  MeshUpdateQueue::addBlock)
DEBUG STACK FOR THREAD 572c:
#0  MeshUpdateThread::Thread

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Post

Utilisatrice wrote:Hi,

Yes, it works there had a ")" in too, so the command /spawn works but the command /afk doesn't work :

Code: Select all

17:37:53: ERROR[ServerThread]: ERROR: An unhandled exception occurred: LuaError: error: ...t\minetest\bin\Release\..\data\mods\command\init.lua:19: bad argument #1 to 'chat_send_all' (string expected, got userdata)
17:37:53: ERROR[ServerThread]: stack traceback:

In thread 5080:
C:\Users\****\Desktop\Minetest\minetest\src\server.cpp:113: ServerThread::Thread: Assertion '0' failed.
Debug stacks:
DEBUG STACK FOR THREAD 5080:
#0  ServerThread::Thread
(Leftover data: #1  Server::Receive)
(Leftover data: #2  Server::ProcessData)
(Leftover data: #3  Server::getClient)
(Leftover data: #4  BlockEmergeQueue::addBlock)
DEBUG STACK FOR THREAD 51dc:
#0  main
(Leftover data: #1  ClientMap::renderMap)
(Leftover data: #2  ClientEnvironment::step)
(Leftover data: #3  Client::Receive)
(Leftover data: #4  Client::ProcessData)
(Leftover data: #5  MeshUpdateQueue::addBlock)
DEBUG STACK FOR THREAD 572c:
#0  MeshUpdateThread::Thread
fixed

FIXED:
-Made /spawn and /afk real commands
-Made /afk function correctly!
hello, am program. do language in rust. make computer do. okay i go now.

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Post

randomproof wrote:Here, I wrote a version that will save the players position to a file. I also fixed the chat commands a bit. To save a spawn point just got where you ant it and type "/setspawn" that is it. Right now a mod can not set what direction you are looking so you will be looking in whatever direction you were look in in when you died. Also you should set the variable 'default_spawn' to a good value.

Code: Select all

-- needed by 'table_save' and 'table_load'
local function exportstring( s )
  s = string.format( "%q",s )
  -- to replace
  s = string.gsub( s,"\\\n","\\n" )
  s = string.gsub( s,"\r","\\r" )
  s = string.gsub( s,string.char(26),""..string.char(26).."" )
  return s
end
--// The Save Function
local function table_save(  tbl,filename )
   local charS,charE = "   ","\n"
   local file,err
   -- create a pseudo file that writes to a string and return the string
   if not filename then
      file =  { write = function( self,newstr ) self.str = self.str..newstr end, str = "" }
      charS,charE = "",""
   -- write table to tmpfile
   elseif filename == true or filename == 1 then
      charS,charE,file = "","",io.tmpfile()
   -- write table to file
   -- use io.open here rather than io.output, since in windows when clicking on a file opened with io.output will create an error
   else
      file,err = io.open( filename, "w" )
      if err then return _,err end
   end
   -- initiate variables for save procedure
   local tables,lookup = { tbl },{ [tbl] = 1 }
   file:write( "return {"..charE )
   for idx,t in ipairs( tables ) do
      if filename and filename ~= true and filename ~= 1 then
         file:write( "-- Table: {"..idx.."}"..charE )
      end
      file:write( "{"..charE )
      local thandled = {}
      for i,v in ipairs( t ) do
         thandled[i] = true
         -- escape functions and userdata
         if type( v ) ~= "userdata" then
            -- only handle value
            if type( v ) == "table" then
               if not lookup[v] then
                  table.insert( tables, v )
                  lookup[v] = #tables
               end
               file:write( charS.."{"..lookup[v].."},"..charE )
            elseif type( v ) == "function" then
               file:write( charS.."loadstring("..exportstring(string.dump( v )).."),"..charE )
            else
               local value =  ( type( v ) == "string" and exportstring( v ) ) or tostring( v )
               file:write(  charS..value..","..charE )
            end
         end
      end
      for i,v in pairs( t ) do
         -- escape functions and userdata
         if (not thandled[i]) and type( v ) ~= "userdata" then
            -- handle index
            if type( i ) == "table" then
               if not lookup[i] then
                  table.insert( tables,i )
                  lookup[i] = #tables
               end
               file:write( charS.."[{"..lookup[i].."}]=" )
            else
               local index = ( type( i ) == "string" and "["..exportstring( i ).."]" ) or string.format( "[%d]",i )
               file:write( charS..index.."=" )
            end
            -- handle value
            if type( v ) == "table" then
               if not lookup[v] then
                  table.insert( tables,v )
                  lookup[v] = #tables
               end
               file:write( "{"..lookup[v].."},"..charE )
            elseif type( v ) == "function" then
               file:write( "loadstring("..exportstring(string.dump( v )).."),"..charE )
            else
               local value =  ( type( v ) == "string" and exportstring( v ) ) or tostring( v )
               file:write( value..","..charE )
            end
         end
      end
      file:write( "},"..charE )
   end
   file:write( "}" )
   -- Return Values
   -- return stringtable from string
   if not filename then
      -- set marker for stringtable
      return file.str.."--|"
   -- return stringttable from file
   elseif filename == true or filename == 1 then
      file:seek ( "set" )
      -- no need to close file, it gets closed and removed automatically
      -- set marker for stringtable
      return file:read( "*a" ).."--|"
   -- close file and return 1
   else
      file:close()
      return 1
   end
end

--// The Load Function
local function table_load( sfile )
   -- catch marker for stringtable
   if string.sub( sfile,-3,-1 ) == "--|" then
      tables,err = loadstring( sfile )
   else
      tables,err = loadfile( sfile )
   end
   if err then return _,err
   end
   tables = tables()
   for idx = 1,#tables do
      local tolinkv,tolinki = {},{}
      for i,v in pairs( tables[idx] ) do
         if type( v ) == "table" and tables[v[1]] then
            table.insert( tolinkv,{ i,tables[v[1]] } )
         end
         if type( i ) == "table" and tables[i[1]] then
            table.insert( tolinki,{ i,tables[i[1]] } )
         end
      end
      -- link values, first due to possible changes of indices
      for _,v in ipairs( tolinkv ) do
         tables[idx][v[1]] = v[2]
      end
      -- link indices
      for _,v in ipairs( tolinki ) do
         tables[idx][v[2]],tables[idx][v[1]] =  tables[idx][v[1]],nil
      end
   end
   return tables[1]
end

local spawn_locations_db_filename = minetest.get_worldpath() .. "/spawn_locations.tbl"

spawn_locations = table_load(spawn_locations_db_filename)

if type(spawn_locations) ~= "table" then
    spawn_locations = {}
end

default_spawn = {x = 0, y = 0, z = 0}

minetest.register_on_chat_message(function(name, message)
    cmd = "/setspawn"
    if message:sub(0, #cmd) == cmd then
        player = minetest.env:get_player_by_name(name)
        spawn_locations[name] = player:getpos()

        table_save( spawn_locations, spawn_locations_db_filename )
        return true
    end
    cmd = "/afk"
    if message:sub(0, #cmd) == cmd then
        minetest.chat_send_all(name, " is AFK!")
        return true
    end
    cmd = "/not_afk"
    if message:sub(0, #cmd) == cmd then
        minetest.chat_send_all(name, " is back from AFK!")
        return true
    end
end)

--Deds to Kahrl
minetest.register_on_newplayer(function(player)
    player:setpos(default_spawn)
    return true
end)

--Deds to Kahrl
minetest.register_on_respawnplayer(function(player, pos)
    name = player:get_player_name()
    if spawn_locations[name] ~= nil then
        player:setpos(spawn_locations[name])
    else
        player:setpos(default_spawn)
    end
    return true
end)
alright thank you very much..will put this in :)
hello, am program. do language in rust. make computer do. okay i go now.

Utilisatrice
Member
Posts: 103
Joined: Thu Feb 16, 2012 18:04

by Utilisatrice » Post

Script work 100%.

But maybe you should do a command indicating that the player no longer have afk.

Exemple :

/afk => Utilisatrice is now afk.

When i type /afk again => Utilisatrice do not have afk.

sfan5
Moderator
Posts: 4094
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

by sfan5 » Post

Utilisatrice wrote:Script work 100%.

But maybe you should do a command indicating that the player no longer have afk.

Exemple :

/afk => Utilisatrice is now afk.

When i type /afk again => Utilisatrice do not have afk.
Good Idea
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Post

Utilisatrice wrote:Script work 100%.

But maybe you should do a command indicating that the player no longer have afk.

Exemple :

/afk => Utilisatrice is now afk.

When i type /afk again => Utilisatrice do not have afk.
great idea!
hello, am program. do language in rust. make computer do. okay i go now.

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Post

Utilisatrice wrote:Script work 100%.

But maybe you should do a command indicating that the player no longer have afk.

Exemple :

/afk => Utilisatrice is now afk.

When i type /afk again => Utilisatrice do not have afk.
great idea!
&
if you move..it says Utilisatrice is no longer afk
hello, am program. do language in rust. make computer do. okay i go now.

User avatar
Death Dealer
Member
Posts: 1379
Joined: Wed Feb 15, 2012 18:46
Location: Limbo
Contact:

by Death Dealer » Post

jordan4ibanez wrote:Here's spawn & /afk command:

Code: Select all

spawn = {x = 47, y = 7.5, z = -40.5}

minetest.register_on_chat_message(function(name, message, playername, player)
    local cmd = "/spawn"
    if message:sub(0, #cmd) == cmd then
        if message == '/spawn' then
        local player = minetest.env:get_player_by_name(name)
        minetest.chat_send_player(player:get_player_name(), "Teleporting to spawn...")
        player:setpos(spawn)
        return true --deds to sfan5
        end
    end

    local cmd ="/afk"
    if message:sub(0, #cmd) == cmd then
            if message == '/afk' then
            local player = minetest.env:get_player_by_name(name)
            minetest.chat_send_all(name.." is AFK! ")
            return true --deds to sfan5
        end
    end
end)

--Deds to Kahrl
minetest.register_on_newplayer(function(player)
    player:setpos(spawn)
    return true
end)

--Deds to Kahrl
minetest.register_on_respawnplayer(function(player, pos)
    player:setpos(spawn)
    return true
end)
Replace x=0 y=0 z=0 with your spawn quards

Features:
-/spawn command (returns you to spawn)
-puts new players in the spawn
-puts players into spawn on death
-/afk command (prints playername is AFK!)

To do:
-Make /spawn a real command (with privs) DONE!
-Make Admins ..that can set spawn
-Make /afk a real commandDONE!
-Make /afk print the players name( so your name is celeron55 /afk = "celeron55 is AFK!")DONE!
-Add a death notice using (minetest.register_on_dieplayer) ..so use (player, "has died!")
-When death notice is made then have the possibility of death information..if a player is in lava ..then print (player, "burned to death") or (player, "hit the ground too hard!")
i really like the descriptions of death, very cool. good job.
Keep calm and code python^_^

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Post

thank you DD!

I am greatly requesting someone to make a /teleport playername playername command!
hello, am program. do language in rust. make computer do. okay i go now.

kahrl
Member
Posts: 236
Joined: Fri Sep 02, 2011 07:51
Location: Rös̓̇chenhof

by kahrl » Post

Idea: Maybe /afk should delay the message until somebody tries to chat with the afk person?
That would reduce afk message spam.

Example:

Alice: /afk
Server (to Alice): You are now AFK
...
Bob: what's up Alice
Server (to all): Alice is AFK!
Bob: dang it
Chris: Alice... I guess she's got her reasons, but I just don't want to know
...
Alice: /afk
Server (to Alice): You are no longer AFK
-- perhaps if somebody mentioned Alice while she was AFK, like Bob and Chris above, the server should now send
Server (to all): Alice is no longer AFK
Bob: greetings

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Post

kahrl wrote:Idea: Maybe /afk should delay the message until somebody tries to chat with the afk person?
That would reduce afk message spam.

Example:

Alice: /afk
Server (to Alice): You are now AFK
...
Bob: what's up Alice
Server (to all): Alice is AFK!
Bob: dang it
Chris: Alice... I guess she's got her reasons, but I just don't want to know
...
Alice: /afk
Server (to Alice): You are no longer AFK
-- perhaps if somebody mentioned Alice while she was AFK, like Bob and Chris above, the server should now send
Server (to all): Alice is no longer AFK
Bob: greetings
That is a bit over dramatic lmfao xD
BUT it is a good idea!
hello, am program. do language in rust. make computer do. okay i go now.

User avatar
bgsmithjr
Member
Posts: 436
Joined: Thu Mar 08, 2012 23:21
Location: USA,Michigan

by bgsmithjr » Post

Error about trying to register 'local player' which is nil, crashes my game. But, the /spawn command works. afk works. but doesnt return from afk, /setspawn works. new player spawn works, but on death respawn crashes.

TubbzChain

by TubbzChain » Post

where do i place the command thing at so it works?

User avatar
bgsmithjr
Member
Posts: 436
Joined: Thu Mar 08, 2012 23:21
Location: USA,Michigan

by bgsmithjr » Post

I am sorry, when running a server from a windows pc, and connecting with a linux client. The player respawn on death crashes the server. And the modified script crashes the server on startup from windows.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 19 guests