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
Helix
Posts: 34 Joined: Sun Apr 25, 2010 6:33 pm
Post
by Helix » Sun Mar 27, 2011 6:44 pm
L2J Revision
Number : newest
L2JDP Revision
Number : newest
Hello,
i am very new at developing own sourcecodes for l2j cores and i got now my first question. Why does my script not work?
i added in Enterworld.java the following lines:
Code: Select all
if (activeChar.isGM()) { activeChar.sendMessage("Hallo GM!"); } else { activeChar.sendMessage("Hallo Spieler"); }
if i log in as a gm char there is a "Hallo GM!" in the System Window. But for normal players there doesnt happen anything...why?
hope
Posts: 1160 Joined: Thu Aug 30, 2007 5:17 pm
Post
by hope » Sun Mar 27, 2011 7:08 pm
if (activeChar.isGM())
because of this line only gms will see it
Helix
Posts: 34 Joined: Sun Apr 25, 2010 6:33 pm
Post
by Helix » Sun Mar 27, 2011 7:10 pm
ah okay i got it now working with these lines:
Code: Select all
if (activeChar.isGM()) { activeChar.sendMessage("Hallo GM!"); } else if (!activeChar.isGM()) { activeChar.sendMessage("Hallo") ; }
can anyone explain to me how i can set a variable with the "HalloGM!" text and how to use it?
jurchiks
Posts: 6769 Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe
Post
by jurchiks » Mon Mar 28, 2011 9:58 am
The first code should work perfectly code-wise... there's no need to check the gm status twice for that.
About the second - do you mean smth like:
Code: Select all
String helloMsg1 = "Hallo GM!";String helloMsg2 = "Hallo Spieler!";if (activeChar.isGM()) activeChar.sendMessage(helloMsg1);else activeChar.sendMessage(helloMsg2);
?
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.