Page 1 of 1

Forbidden zone ,kick out of it

Posted: Tue Jun 22, 2010 1:16 pm
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 :)

Re: Forbidden zone ,kick out of it

Posted: Tue Jun 22, 2010 2:21 pm
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.

Re: Forbidden zone ,kick out of it

Posted: Tue Jun 22, 2010 4:56 pm
by kama3a
im thinking to add new zone with restrict for level ...
when im dont will write what happend :)

Re: Forbidden zone ,kick out of it

Posted: Wed Jun 23, 2010 10:56 pm
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.