Minetest_game: Improve 'killme' mod

Created on 28 Jan 2018  路  8Comments  路  Source: minetest/minetest_game

No idea why we added this, should be in builtin if it is that useful, it is not game-specific.
EDIT: It seems this might be a universally useful feature for all games so is perhaps best in builtin?
See https://github.com/minetest/minetest_game/issues/2033#issuecomment-414838401

Request / Suggestion

Most helpful comment

Once more for the record: It should be kill, not killme.

There's a world of difference, there.

All 8 comments

It's game play specific, which is why I added it here. I'm not that tied to it, however

I've always felt it shouldn't be included, but people will now be used to it and may moan if it's removed.

With that said, in the absolute least it should be a more generically named "commands" mod instead with the potential for expansion, rather than a whole mod devoted to one specific command.

Sorry rubenwardy that's a good point. I now see i supported this, approved it and merged it, duh.
Is there a case for a certain game not having access to this, since it's for a player in an unescapable situation?

This shouldn't be in builtin. Since it works without privilege, it's a gameplay change. The privilege part is the crucial thing here.

Yes, there is a case for a subgame not wanting it. Take Labyrinthus for example. Or the Inside The Box server. Or basically any game in which suicide is discouraged. I also don't want this in my own subgames because free suicide is odd. I would also be horribly annoyed if players can just instantly selfkill in the middle of a PvP combat.

I have no opinion about keeping it in MTG or not. Let subgames decide.

Also, we shouldn't add killme into builtin, but instead the more general kill command which needs the privilege.

Once more for the record: It should be kill, not killme.

There's a world of difference, there.

https://github.com/jastevenson303/dcbl_default/blob/master/serveressentials.lua#L139

Here I have modified GunshipPenguin's kill command to assume the issuer is the recipient if no argument to the command was provided. kill, in this case, is general.

minetest.unregister_chatcommand("killme")
minetest.register_chatcommand("kill", {
    params = "[player name]",
    description = "Set HP to 0.",
    privs = {interact = true},
    func = function(name, param)
        local player = minetest.get_player_by_name(name)
        if not player then
            return false, "Player not found."
        end
        if param == name or param == "" then
            local player = minetest.get_player_by_name(name)
            if not player then
                return false, "Player not found."
            end
            player:set_hp(0)
            return true, "Setting your HP to 0."
        elseif players[param] and minetest.check_player_privs(name, "kill") then
            minetest.get_player_by_name(param):set_hp(0)
            return true, "Setting player's HP to 0."
        end
    end
})

Thanks for input, i won't pursue this further.

in the absolute least it should be a more generically named "commands" mod instead with the potential for expansion, rather than a whole mod devoted to one specific command.

Reopening as i agree with Ezhh this needs work.
The mod name is unpleasant and a little disturbing.
The mod lacks README and license.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cx384 picture cx384  路  6Comments

paanrama picture paanrama  路  4Comments

cdqwertz picture cdqwertz  路  6Comments

MarkuBu picture MarkuBu  路  5Comments

TekhnaeRaav picture TekhnaeRaav  路  5Comments