Logout with nick name check script

Post Reply
cooco
VIP
Posts: 218
Joined: Fri Feb 17, 2017 2:01 am
Has thanked: 58 times
Been thanked: 85 times

Logout with nick name check script

Post by cooco » Tue Mar 28, 2017 4:12 pm

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
Last edited by cooco on Sat Apr 01, 2017 1:31 am, edited 1 time in total.

agonic
VIP
Posts: 159
Joined: Tue Jan 10, 2017 6:39 pm
Has thanked: 34 times
Been thanked: 112 times

Re: Logout with nick name check script

Post by agonic » Fri Mar 31, 2017 10:22 am

I wanna ask something. In this script, why do you check the Entity State ? Because, state was not used.

cooco
VIP
Posts: 218
Joined: Fri Feb 17, 2017 2:01 am
Has thanked: 58 times
Been thanked: 85 times

Re: Logout with nick name check script

Post by cooco » Sat Apr 01, 2017 1:28 am

agonic wrote:
Fri Mar 31, 2017 10:22 am
I wanna ask something. In this script, why do you check the Entity State ? Because, state was not used.
My mistake. Not need EntityState.
Script edited.

User avatar
Diavolakos
Posts: 114
Joined: Thu Apr 20, 2017 5:05 am
Has thanked: 31 times
Been thanked: 13 times

Re: Logout with nick name check script

Post by Diavolakos » Sun Jun 11, 2017 6:04 am

Is there a way to logout/ or use return skill a town scroll if we find an enemy (like if I am asmodian, logout if elyos is found)?
I play on NA Server Siel

Online
User avatar
nucular
Site Admin
Posts: 260
Joined: Sat Jan 07, 2017 9:08 pm
Has thanked: 27 times
Been thanked: 388 times

Re: Logout with nick name check script

Post by nucular » Sun Jun 11, 2017 2:24 pm

Diavolakos wrote:
Sun Jun 11, 2017 6:04 am
Is there a way to logout/ or use return skill a town scroll if we find an enemy (like if I am asmodian, logout if elyos is found)?
Yes look inside AionScript.pdf

Code: Select all

Entity:IsEnemy()
for friendly player or enemy player

Code: Select all

	if Helper:CheckAvailable( "Return" )  then
		Helper:CheckExecute( "Return" );
		return false;
	end
for return use this example:

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest