Extra commands(alpha 0.1)

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

by bgsmithjr » Post

TubbzChain wrote:where do i place the command thing at so it works?
create a folder minetest/data/mods/, named 'commands'. In that folder create a file named init.lua, in that file paste the code from the forum. Next to that file create a file named depends.txt, which contains the word default.

TubbzChain

by TubbzChain » Post

bgsmithjr wrote:
TubbzChain wrote:where do i place the command thing at so it works?
create a folder minetest/data/mods/, named 'commands'. In that folder create a file named init.lua, in that file paste the code from the forum. Next to that file create a file named depends.txt, which contains the word default.
ty XD ive been trying to figure it out for a while and i just was able to check the fourm again to see if anyone answered my question, thanks though :D

User avatar
jordan4ibanez
Member
Posts: 1895
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez
Location: Rhode Island, USA

by jordan4ibanez » Post

bgsmithjr wrote: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.
this is for latest github && this still works great btw
I've been gone for a long time

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

by bgsmithjr » Post

Yeah, it was my fault, I got it working.

User avatar
Element
Member
Posts: 269
Joined: Tue Jun 11, 2013 00:27
IRC: Elementwing4962
In-game: Elementwing4962
Location: New York
Contact:

by Element » Post

where do i put this code
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:
-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
Join Me And My Team - thornfyregaming-mc.noip.me:25565

My Server Is 1.7.9

User avatar
Neon
Member
Posts: 126
Joined: Thu Aug 15, 2013 02:03
In-game: Neon

by Neon » Post

Zombie Thread...

It looks like you'd have to create the file init.lua in the folder 'mods/extracmds' with the contents from above code snippit

User avatar
Menche
Member
Posts: 1001
Joined: Sat Jul 02, 2011 00:43
IRC: Menchers
In-game: Menche
Location: An island in a lava lake.

by Menche » Post

Element wrote:where do i put this code
--snip--
Make a folder in your mods folder, and in there paste the code into a file named "init.lua".
An innocent kitten dies every time you top-post.

User avatar
Element
Member
Posts: 269
Joined: Tue Jun 11, 2013 00:27
IRC: Elementwing4962
In-game: Elementwing4962
Location: New York
Contact:

by Element » Post

which mod folder, the one under minetest game or the other one
Menche wrote:
Element wrote:where do i put this code
--snip--
Make a folder in your mods folder, and in there paste the code into a file named "init.lua".
Join Me And My Team - thornfyregaming-mc.noip.me:25565

My Server Is 1.7.9

User avatar
LionsDen
Member
Posts: 530
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Post

If you want to be able to turn it on or off, the one under the main folder. The one under the game folder will only work when that game is used.

User avatar
Element
Member
Posts: 269
Joined: Tue Jun 11, 2013 00:27
IRC: Elementwing4962
In-game: Elementwing4962
Location: New York
Contact:

by Element » Post

what do i name the folder
Join Me And My Team - thornfyregaming-mc.noip.me:25565

My Server Is 1.7.9

User avatar
Element
Member
Posts: 269
Joined: Tue Jun 11, 2013 00:27
IRC: Elementwing4962
In-game: Elementwing4962
Location: New York
Contact:

by Element » Post

hello...any help here
Join Me And My Team - thornfyregaming-mc.noip.me:25565

My Server Is 1.7.9

User avatar
Topywo
Member
Posts: 1721
Joined: Fri May 18, 2012 20:27

by Topywo » Post

Element wrote:what do i name the folder
Whatever you like as long it follows the naming conventions. Try:

extracommands or
xtracommands

User avatar
Element
Member
Posts: 269
Joined: Tue Jun 11, 2013 00:27
IRC: Elementwing4962
In-game: Elementwing4962
Location: New York
Contact:

by Element » Post

both dont work
Join Me And My Team - thornfyregaming-mc.noip.me:25565

My Server Is 1.7.9

User avatar
Topywo
Member
Posts: 1721
Joined: Fri May 18, 2012 20:27

by Topywo » Post

Element wrote:both dont work
https://dl.dropboxusercontent.com/u/654 ... mmands.zip

Works like a charm.

Use:
/afk
/spawn

User avatar
LuxAtheris
Member
Posts: 169
Joined: Fri Oct 25, 2013 00:54
Location: Aether

by LuxAtheris » Post

Still wanna continue this mod?
Believe you can and you’re halfway there.

User avatar
Dan Duncombe
Member
Posts: 904
Joined: Thu May 09, 2013 21:11
Location: In the unknown depths of Earth

by Dan Duncombe » Post

The guy who made this is banned you know!
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.

AnFiadhChu
Member
Posts: 13
Joined: Thu Dec 19, 2013 18:16
GitHub: AnFiadhChu
IRC: AnFiadhChu
In-game: AnFiadhChu
Location: South Africa

by AnFiadhChu » Post

sfan5 wrote:
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
Done:

spawn = {x = 50, y = 1, z = 92}

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

local cmd ="/not afk"
if message:sub(0, #cmd) == cmd then
if message == '/not afk' then
local player = minetest.env:get_player_by_name(name)
minetest.chat_send_all(name.." is NOT AFK! ")
return true --added by AnFiadhChu
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)
Last edited by AnFiadhChu on Thu Dec 19, 2013 18:20, edited 1 time in total.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests