Files
xmas/s_commands.lua
2020-12-19 12:59:49 +01:00

22 lines
671 B
Lua

addCommandHandler("xmas",
function(player, arg1, arg2)
local accName = getAccountName ( getPlayerAccount ( player ) )
local isAdmin = isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" )) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "Administrator" ))
if arg2 == "update" then
updateTop(player)
elseif arg2 == "clearstats" then
if accName ~= "Greenlander" then return end
if isAdmin then
outputDebugString('[xmas]: Clearing the Xmas presents account stats.')
executeSQLQuery("DELETE FROM `xmas`")
g_data["leaders"] = {}
updateTop()
end
elseif arg2 == "top" then
if (isAdmin) then
updateTop()
showTop()
end
end
end)