Skip to content

Commit

Permalink
/postool resetHUD
Browse files Browse the repository at this point in the history
  • Loading branch information
SwissalpS committed Nov 10, 2019
1 parent b24faec commit f94b0c0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
6 changes: 5 additions & 1 deletion chatcommands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ postool.chatcommand = {
return false, S('Player not found')
end

postool.showConfigFormspec(oPlayer)
if 'resethud' == string.lower(sParam) then
postool.resetHud(oPlayer)
else
postool.showConfigFormspec(oPlayer)
end

end
}
Expand Down
12 changes: 12 additions & 0 deletions huds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ postool.savePlayerToggles = function(oPlayer)
end -- savePlayerToggles


-- return to default values
postool.resetHud = function(oPlayer)

local sName = postool.removeHud(oPlayer)

oPlayer:get_meta():set_string('postoolHUDflags', '')

postool.initHud(oPlayer)

end -- resetHud


-- return the runtime cache for player
-- if bRef == true then only a tableref is returned
postool.getPlayerTables = function(oPlayer, bRef)
Expand Down

0 comments on commit f94b0c0

Please sign in to comment.