Code: Select all
function LogOutSecurity()
-- Check if the ForceLogout value has been set, in which case we have to go.
if _ForceLogout ~= nil and not Player:IsBusy() then
-- Wait until the alert dialog is shown before closing the script.
if DialogList:GetDialog( "quit_alert_dialog" ):IsVisible() then
Close();
return;
end
-- Use the console to logout.
PlayerInput:Console( "/Logout" );
end
-- Iterate through all entities
for ID, Entity in DictionaryIterator( EntityList:GetList()) do
-- Check if the entiy is valid.
if Entity ~= nil then
-- Check if this is a player.
if Entity:IsPlayer() and self:SecurePlayer(Entity:GetName()) == true then
_ForceLogout=true;
Write("Not secure player: " ..Entity:GetName());
return;
end
end
end
end
function SecurePlayer(name)
secureNickName = {"PlayerNick1", "PlayerNick2", "PlayerNick3"} ;
-- check nick name
for i,v in ipairs(secureNickName) do
if name==v then
return false;
end
end
return true;
end