check that you use SystemMessageId when pointing to a message id. check your variable names. when using eclipse, use code completion if you are not sure about enum names, etc.
if (_vipRewardAmount > 1) { sm = new SystemMessage(SystemMessageId.EARNED_S2_S1_S); sm.addItemName(_vipReward); sm.addNumber(_vipRewardAmount); player.sendPacket(sm); } else { sm = new SystemMessage(SystemMessageId.EARNED_ITEM); sm.addItemName(_vipReward); player.sendPacket(sm); }
DO NOT EVEN TRY TO MESS WITH ME! forum flOOderdancing dEVILoper♀ I don't give private support - PM will be ignored!
public static void rewardNotVIP(){ for (L2PcInstance player : _playersNotVIP){ if (player != null) { PcInventory inv = player.getInventory(); if (ItemTable.getInstance().createDummyItem(_notVipReward).isStackable()) inv.addItem("VIP Event: ", _notVipReward, _notVipRewardAmount, player, null); else { for (int i=0;i<=_notVipRewardAmount-1;i++) inv.addItem("VIP Event: ", _notVipReward, 1, player, null); } SystemMessage sm; if (_vipRewardAmount > 1) { sm = new SystemMessage([color=#FF0000]SystemMessageId[/color].EARNED_S2_S1_S); sm.addItemName(_vipReward); sm.addNumber(_vipRewardAmount); player.sendPacket(sm); } else { sm = new SystemMessage([color=#FF0000]SystemMessageId[/color].EARNED_ITEM); sm.addItemName(_vipReward); player.sendPacket(sm); } StatusUpdate su = new StatusUpdate(player.getObjectId()); su.addAttribute(StatusUpdate.CUR_LOAD, player.getCurrentLoad()); player.sendPacket(su); NpcHtmlMessage nhm = new NpcHtmlMessage(5); TextBuilder replyMSG = new TextBuilder(""); replyMSG.append("<html><head><body>Your team has won the event. Your inventory now contains your reward.</body></html>"); nhm.setHtml(replyMSG.toString()); player.sendPacket(nhm); } } } public static void rewardVIP(){ for (L2PcInstance player : _playersVIP){ if (player != null && !player._isTheVIP) { PcInventory inv = player.getInventory(); if (ItemTable.getInstance().createDummyItem(_vipReward).isStackable()) inv.addItem("VIP Event: ", _vipReward, _vipRewardAmount, player, null); else { for (int i=0;i<=_vipRewardAmount-1;i++) inv.addItem("VIP Event: ", _vipReward, 1, player, null); } SystemMessage sm; if (_vipRewardAmount > 1) { sm = new SystemMessage(SystemMessage.EARNED_S2_S1_s); sm.addItemName(_vipReward); sm.addNumber(_vipRewardAmount); player.sendPacket(sm); } else { sm = new SystemMessage(SystemMessage.EARNED_ITEM); sm.addItemName(_vipReward); player.sendPacket(sm); } StatusUpdate su = new StatusUpdate(player.getObjectId()); su.addAttribute(StatusUpdate.CUR_LOAD, player.getCurrentLoad()); player.sendPacket(su); NpcHtmlMessage nhm = new NpcHtmlMessage(5); TextBuilder replyMSG = new TextBuilder(""); replyMSG.append("<html><head><body>Your team has won the event. Your inventory now contains your reward.</body></html>"); nhm.setHtml(replyMSG.toString()); player.sendPacket(nhm); } else if (player._isTheVIP){ PcInventory inv = player.getInventory(); if (ItemTable.getInstance().createDummyItem(_theVipReward).isStackable()) inv.addItem("VIP Event: ", _theVipReward, _theVipRewardAmount, player, null); else { for (int i=0;i<=_theVipRewardAmount-1;i++) inv.addItem("VIP Event: ", _theVipReward, 1, player, null); } SystemMessage sm; if (_theVipRewardAmount > 1) { sm = new SystemMessage(SystemMessage.EARNED_S2_S1_s); sm.addItemName(_theVipReward); sm.addNumber(_theVipRewardAmount); player.sendPacket(sm); } else { sm = new SystemMessage(SystemMessage.EARNED_ITEM); sm.addItemName(_theVipReward); player.sendPacket(sm); }} StatusUpdate su = new StatusUpdate(player.getObjectId()); su.addAttribute(StatusUpdate.CUR_LOAD, player.getCurrentLoad()); player.sendPacket(su); NpcHtmlMessage nhm = new NpcHtmlMessage(5); TextBuilder replyMSG = new TextBuilder(""); replyMSG.append("<html><head><body>You team have won the event. Your inventory now contains your reward.</body></html>"); nhm.setHtml(replyMSG.toString()); player.sendPacket(nhm); } } }
s6 x systemmessage error so donno have prob with forum every letter will get up the screen -.-
ok, then use SystemMessage instead of SystemMessageId . you should always check other code - like you see a couple of lines below the error, there are same lines working with SystemMessage . check that the error code is same as the working code. or just check how system messages are created and if the "EARNED_ ..." id exists in your system message (id) class. just follow the code..
DO NOT EVEN TRY TO MESS WITH ME! forum flOOderdancing dEVILoper♀ I don't give private support - PM will be ignored!
little eclipse study for you:
for organizing imports in eclipse, use ctrl+shift+o -> this will add/remove classes from the imports. like probably you dont have SystemMessageId imported (properly), so eclipse can handle this for you with ctrl+shift+o .
then for code completion, use ctrl+space on an object or part of a code while writing and eclipse will suggest you the code to add (e.g. write SystemMessageI and hit ctrl+space right after it, eclipse will suggest you SystemMessageId and will also import it for you. then write .EARNED and again hit ctrl+space - you will get available system messages suggested if there exists some that start with EARNED).
you should learn using eclipse, it is a nice tool that can help you with coding and you will not need to ask here for such support like this, as it has nothing to do with l2j but with your eclipse skills..
//anyway, topic moved to legacy support as it has nothing to do with user contribution! please follow forum rules and check the forum sections!
DO NOT EVEN TRY TO MESS WITH ME! forum flOOderdancing dEVILoper♀ I don't give private support - PM will be ignored!