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;

}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...