i have try:
else
p.sendPacket(new CreatureSay(activeChar.getObjectId(), Say2.ALL, activeChar.getName() + "message"));
and
else
p.sendPacket(new CreatureSay(0, Say2.ALL, activeChar.getName() + " message"));
but the console print:
The constructor CreatureSay(int, int, String)
ah now the staff can read the message ! ty
To let the staff read the message, just add this?
if(p.getRace() == charRace || activeChar.getAccessLevel().isGm() == true)
p.sendPacket(new CreatureSay(activeChar.getObjectId(),Say2.ALL,activeChar.getName(),params));
I accept all guys, of course if it was php I would have already solved the problem! Anyway, thank you all for the help and of course put the credits on the script site.
My code after edit:
if (command.startWith("d") && activeChar.getRace() == Race.Dwarf)
{
player.sendPacket(new CreatureSay(0, player.getName(),activeChar.getName()));
}
Is correct ?
Im noob with java :(
And i have a problem i have import com.l2jserver.gameserver.model.base.Race; but the console server print this message:
1. ERROR in C:\Users\Administrator\Desktop\l2j\game\data\scripts\handlers\chatha
ndlers\RaceVoice.java (at line 34)
import com.l2jserver.gameserver.model.base;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Only a type can be imported. com.l2jserver.gameserver.model.base resolves to a package
Race cannot be resolved to a variable