Jump to content
  • 0

Help(java) CastleLord


Question

Posted
package mitsos.CastleLord;

 

import com.l2jserver.gameserver.instancemanager.CastleManager;

import com.l2jserver.gameserver.model.entity.Castle;

 

private void notifyCastleOwner(L2PcInstance activeChar)

{

L2Clan clan = activeChar.getClan();

 

if (clan != null)

{

if (clan.getHasCastle() > 0)

{

Castle castle = CastleManager.getInstance().getCastleById(clan.getHasCastle());

if ((castle != null) && (activeChar.getObjectId() == clan.getLeaderId()))

Announcements.getInstance().announceToAll( activeChar.getName() + " Lord Of " + castle.getName() + " Castle is Now Online!");

}

}

}

 

and the error i had is this:

1. ERROR in \CastleLord.java (at line 15)
        package mitsos.CastleLord;
                ^^^^^^^^^^^^^^^^^
The package mitsos.CastleLord collides with a type
----------
2. ERROR in \CastleLord.java (at line 20)
        private void notifyCastleOwner(L2PcInstance activeChar)
                ^^^^
Syntax error on token "void", @ expected
----------
3. ERROR in \CastleLord.java (at line 20)
        private void notifyCastleOwner(L2PcInstance activeChar)
                                       ^^^^^^^^^^^^
Syntax error on token(s), misplaced construct(s)
----------
4. ERROR in \CastleLord.java (at line 20)
        private void notifyCastleOwner(L2PcInstance activeChar)
                                                              ^
Syntax error, insert "enum Identifier" to complete EnumHeader
----------
5. ERROR in \CastleLord.java (at line 21)
        {
        ^
Syntax error on token "{", ; expected after this token
----------
6. ERROR in \CastleLord.java (at line 22)
        L2Clan clan = activeChar.getClan();
                                          ^
Syntax error on token ";", { expected after this token
----------
7. ERROR in \CastleLord.java (at line 33)
        }
        ^
Syntax error, insert "}" to complete EnumBody
----------
7 problems (7 errors)Failed executing script: C:\Users\Developer\Desktop\Test Se
rver\gameserver\data\scripts\mitsos\CastleLord.java. See CastleLord.java.error.l
og for details.

 

can you give me the fix or at least the fix of the errors?

10 answers to this question

Recommended Posts

  • 0
Posted

I don't think so, sample:

 

Syntax error on token "{", ; expected after this token

 

You really don't know what does it mean?

  • 0
Posted

i do not compile it with eclipse i try to import it in l2jserver. in scripts folder you can add you own scripts folders.

i add one i register it i add the code. and i had this error.

  • 0
Posted

You're author... of this code?

 

First of all, Im wondering where is class name?

 

sample...

 

public class ClassName

{

      //and now class body here ...

}

  • 0
Posted

Man, my advice is really simple, You have to read few basic guides about java/etc first.

 

Its really bad if you don't know what is CLASS and how does it should look.

  • 0
Posted

Man, my advice is really simple, You have to read few basic guides about java/etc first.

 

Its really bad if you don't know what is CLASS and how does it should look.

 

agree 100%

 

public class CastleLord

{

       CastleLord;

}

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock