1
Fork 0
mirror of https://bitbucket.org/Ioncannon/project-meteor-server.git synced 2025-04-22 20:57:47 +00:00
project-meteor-server/data/scripts/commands/LogoutCommand.lua

53 lines
1 KiB
Lua
Raw Normal View History

--[[
LogoutCommand Script
Functions:
eventConfirm()
eventCountDown()
eventLogoutFade()
Menu Ids:
Menu: 0
Countdown: 1
--]]
function onEventStarted(player, command)
2016-06-15 03:41:23 +01:00
--player:SetCurrentMenuId(0);
--player:RunEventFunction("delegateCommand", command, "eventConfirm");
player:logout();
end
function onEventUpdate(player, command, triggerName, step, arg1, arg2)
2016-06-15 03:41:23 +01:00
currentMenuId = player:GetCurrentMenuId();
--Menu Dialog
if (currentMenuId == 0) then
if (arg1 == 1) then --Exit
player:quitGame();
2016-06-15 03:41:23 +01:00
player:EndCommand();
elseif (arg1 == 2) then --Character Screen
player:logout();
2016-06-15 03:41:23 +01:00
player:EndCommand();
--player:SetCurrentMenuId(1);
--player:RunEventFunction("delegateCommand", command, "eventCountDown");
elseif (arg1 == 3) then --Cancel
2016-06-15 03:41:23 +01:00
player:EndCommand();
end
--Countdown Dialog
elseif (currentMenuId == 1) then
if (arg2 == 1) then --Logout Complete
player:logout();
2016-06-15 03:41:23 +01:00
player:EndCommand();
elseif (arg2 == 2) then --Cancel Pressed
2016-06-15 03:41:23 +01:00
player:EndCommand();
end
end
end