add support to detect hudbars and check if exits, then provide command
* added satation command if mod does not exits and already we have remade mod * added satiation command only if our mod is present
This commit is contained in:
parent
e50a08e5d3
commit
043d3fe7f1
@ -50,6 +50,7 @@ account at https://vpnapi.io/ and **if not configured, will be used a simple geo
|
|||||||
| `/geoip <playername>` | geoip | simple ip player info | no matter if geoip mod is present or not |
|
| `/geoip <playername>` | geoip | simple ip player info | no matter if geoip mod is present or not |
|
||||||
| `/cstats` | moderator | to see latest detected cheater | its not a privilegie, use config settings |
|
| `/cstats` | moderator | to see latest detected cheater | its not a privilegie, use config settings |
|
||||||
| `/cdebug` | moderator | to see even suspected cheats to be verified later | its not a privilegie, use config settings |
|
| `/cdebug` | moderator | to see even suspected cheats to be verified later | its not a privilegie, use config settings |
|
||||||
|
| `/satiation` | server | manipulates the satiation of a player | only provide if our mod its present, the original mod already has it |
|
||||||
|
|
||||||
#### privs
|
#### privs
|
||||||
|
|
||||||
|
42
commands.lua
42
commands.lua
@ -99,4 +99,46 @@ minetest.register_chatcommand("govip", {
|
|||||||
--[[ end of commands for geoip and ip location information ]]
|
--[[ end of commands for geoip and ip location information ]]
|
||||||
|
|
||||||
|
|
||||||
|
--[[ commands for stamina or satiation based on existing mods ]]
|
||||||
|
|
||||||
|
if not governing.modhbhunger then
|
||||||
|
if governing.modhudbars and not hb.redo then
|
||||||
|
minetest.register_chatcommand("satiation", {
|
||||||
|
privs = {["server"]=true},
|
||||||
|
params = S("[<player>] <satiation>"),
|
||||||
|
description = S("Set satiation of player or yourself"),
|
||||||
|
func = function(name, param)
|
||||||
|
if minetest.settings:get_bool("enable_damage") == false then
|
||||||
|
return false, S("Not possible, damage is disabled.")
|
||||||
|
end
|
||||||
|
local targetname, satiation = string.match(param, "(%S+) (%S+)")
|
||||||
|
if not targetname then
|
||||||
|
satiation = param
|
||||||
|
end
|
||||||
|
satiation = tonumber(satiation)
|
||||||
|
if not satiation then
|
||||||
|
return false, S("Invalid satiation!")
|
||||||
|
end
|
||||||
|
if not targetname then
|
||||||
|
targetname = name
|
||||||
|
end
|
||||||
|
local target = minetest.get_player_by_name(targetname)
|
||||||
|
if target == nil then
|
||||||
|
return false, S("Player @1 does not exist.", targetname)
|
||||||
|
end
|
||||||
|
if satiation > hbhunger.SAT_MAX then
|
||||||
|
satiation = hbhunger.SAT_MAX
|
||||||
|
elseif satiation < 0 then
|
||||||
|
satiation = 0
|
||||||
|
end
|
||||||
|
hbhunger.hunger[targetname] = satiation
|
||||||
|
hbhunger.set_hunger_raw(target)
|
||||||
|
return true
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
--[[ end commands for stamina or satiation based on existing mods ]]
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
default?
|
default?
|
||||||
mail?
|
mail?
|
||||||
boneworld?
|
boneworld?
|
||||||
|
hudbars?
|
4
init.lua
4
init.lua
@ -27,6 +27,8 @@ local modcreative = minetest.get_modpath("creative") -- if creative is available
|
|||||||
local modantispawn = minetest.get_modpath("antispam") -- if rnd1 anticheat mod is loaded, cos only wolrs with mt4
|
local modantispawn = minetest.get_modpath("antispam") -- if rnd1 anticheat mod is loaded, cos only wolrs with mt4
|
||||||
local modanticheat = minetest.get_modpath("anticheat") -- if rnd1 anticheat mod is loaded, cos only wolrs with mt4
|
local modanticheat = minetest.get_modpath("anticheat") -- if rnd1 anticheat mod is loaded, cos only wolrs with mt4
|
||||||
local modbeowulf = minetest.get_modpath("beowulf") -- if rnd1 anticheat mod is loaded, cos only wolrs with mt4
|
local modbeowulf = minetest.get_modpath("beowulf") -- if rnd1 anticheat mod is loaded, cos only wolrs with mt4
|
||||||
|
local modhudbars = minetest.get_modpath("hudbars") -- if the hudbars mod is loaded and working, from wuzzy
|
||||||
|
local modhbhunger = minetest.get_modpath("hbhunger") -- if the hudbars hunger mod is loaded and working, from wuzzy
|
||||||
local checkapikey = minetest.settings:get("governing.checkapikey") or "" -- need for geoip improved ip information, then geoip normal will be used
|
local checkapikey = minetest.settings:get("governing.checkapikey") or "" -- need for geoip improved ip information, then geoip normal will be used
|
||||||
|
|
||||||
local is_46 = minetest.has_feature("add_entity_with_staticdata") -- detect minetest engine 4.0.16 or mayor
|
local is_46 = minetest.has_feature("add_entity_with_staticdata") -- detect minetest engine 4.0.16 or mayor
|
||||||
@ -96,6 +98,8 @@ governing.modcommand = modcommand -- if same killme and commands is present as m
|
|||||||
governing.modantispawn = modantispawn -- autodetect if older mod antispan by appguru are present
|
governing.modantispawn = modantispawn -- autodetect if older mod antispan by appguru are present
|
||||||
governing.modanticheat = modanticheat -- if rnd1 anticheat mod is present cos only works with mt4
|
governing.modanticheat = modanticheat -- if rnd1 anticheat mod is present cos only works with mt4
|
||||||
governing.modbeowulf = modbeowulf -- if beowulf anticheat mod is present cos only works with mt5
|
governing.modbeowulf = modbeowulf -- if beowulf anticheat mod is present cos only works with mt5
|
||||||
|
governing.modhudbars = modhudbars -- if hudbars is present or the mproved hudbars redo
|
||||||
|
governing.modhbhunger = modhbhunger -- if hbhunger is present or the mproved hudbars redo
|
||||||
governing.checkapikey = checkapikey -- need for geoip improved ip information, then geoip normal will be used
|
governing.checkapikey = checkapikey -- need for geoip improved ip information, then geoip normal will be used
|
||||||
|
|
||||||
--[[ end - namespace of the mod and varible usages ]]
|
--[[ end - namespace of the mod and varible usages ]]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user