Forbidden zone ,kick out of it

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
kama3a
Posts: 125
Joined: Mon Jul 07, 2008 4:01 pm

Forbidden zone ,kick out of it

Post by kama3a »

If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number:
L2JDP Revision Number:

ok here is my idea... u make level zone and when u reach XXX level u get kicked out of it .. and u cant teleport back to it...
about teleportation ok in teleport html u can do it ...
but i cant make the kick on xx level .. so can u help me with ideas or code

regards kama3a :)
User avatar
JIV
L2j Veteran
L2j Veteran
Posts: 1882
Joined: Sun Jan 06, 2008 8:17 pm
Location: Slovakia
Contact:

Re: Forbidden zone ,kick out of it

Post by JIV »

1. you will need create some custom zone
2. add your code to increase lvl method and check for zone restriction.
3a. nothing happen
3b. teleport player somewhere else.
kama3a
Posts: 125
Joined: Mon Jul 07, 2008 4:01 pm

Re: Forbidden zone ,kick out of it

Post by kama3a »

im thinking to add new zone with restrict for level ...
when im dont will write what happend :)
User avatar
Szponiasty
Advanced User
Advanced User
Posts: 557
Joined: Mon Apr 21, 2008 1:31 pm
Location: Eastern Poland

Re: Forbidden zone ,kick out of it

Post by Szponiasty »

1). Add your custom zone in zones.xml. (eg. with id 22505) and in zone_verticles.
2). Write script with onEnterZone method, where you should write sth like that, to control who's entering zone:

Code: Select all

 public String onEnterZone(L2Character character, L2ZoneType zone){        if (character instanceof L2PcInstance)	{            if (zone.getId() == 22505)  //-- player entered your "level restricted zone", so check him out            {                if (((L2PcInstance)character).getLevel() < 76 && !((L2PcInstance)character).isGM())                {			character.teleToLocation(TeleportWhereType.Town); //-- player is not allowed to enter, move him to nearest town...			return "You are not allowed to be here...";                }                else                {			//-- player can enter zone, but do sth else with him here if you like...                }            }	}	return "";}
That should be all.
And in the next chronicle they went into space, fighting the evil empire... In a galaxy far, far away xD
Post Reply