2016-03-12 02:54:03 -05:00
|
|
|
--[[
|
|
|
|
|
|
|
|
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");
|
2016-04-14 08:31:39 -04:00
|
|
|
player:logout();
|
2016-03-12 02:54:03 -05:00
|
|
|
end
|
|
|
|
|
2016-03-20 21:19:40 -04:00
|
|
|
function onEventUpdate(player, command, triggerName, step, arg1, arg2)
|
2016-03-12 02:54:03 -05:00
|
|
|
|
2016-06-15 03:41:23 +01:00
|
|
|
currentMenuId = player:GetCurrentMenuId();
|
2016-03-12 02:54:03 -05:00
|
|
|
|
|
|
|
--Menu Dialog
|
|
|
|
if (currentMenuId == 0) then
|
|
|
|
if (arg1 == 1) then --Exit
|
|
|
|
player:quitGame();
|
2016-06-15 03:41:23 +01:00
|
|
|
player:EndCommand();
|
2016-03-12 02:54:03 -05:00
|
|
|
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");
|
2016-03-12 02:54:03 -05:00
|
|
|
elseif (arg1 == 3) then --Cancel
|
2016-06-15 03:41:23 +01:00
|
|
|
player:EndCommand();
|
2016-03-12 02:54:03 -05:00
|
|
|
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();
|
2016-03-12 02:54:03 -05:00
|
|
|
elseif (arg2 == 2) then --Cancel Pressed
|
2016-06-15 03:41:23 +01:00
|
|
|
player:EndCommand();
|
2016-03-12 02:54:03 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|