multiserver_api/typeconv.lua

18 lines
358 B
Lua
Raw Normal View History

2021-01-23 08:49:04 -08:00
multiserver.tohex = function(n)
local r = string.format("%x", n)
if #r < 2 then r = "0" .. r end
return r
end
multiserver.fromhex = function(s)
return tonumber(s, 16)
end
multiserver.frombool = function(b)
if b then return "true" else return "false" end
end
multiserver.tobool = function(s)
if s == "true" then return true else return false end
end