[DeathMatch]Find winner

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
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
kariolis
Posts: 19
Joined: Sat Feb 16, 2013 2:58 am

[DeathMatch]Find winner

Post by kariolis »

Hello there, i have this code.

Code: Select all

for (L2PcInstance onlinePlayer : ples)        {            if (onlinePlayer.isInDm)            {                onlinePlayer.teleToLocation(81220, 148588, -3472);                onlinePlayer.isInDm = false;            }            if (onlinePlayer.getDmKills() > maxkills)            {                winner = onlinePlayer;                maxkills = onlinePlayer.getDmKills();            }            onlinePlayer.isInDm = false;            onlinePlayer.setDmKills(0);        }        if (maxkills != 0)        {            for (int[] reward : Config.DM_EVENT_REWARDS)            {                winner.addItem("Death Match", reward[1], reward[2], winner, true);                winner.broadcastUserInfo();                winner.sendPacket(new InventoryUpdate());                winner.sendPacket(new ItemList(winner, false));                winner.sendPacket(new StatusUpdate(winner));            }            winner.sendMessage("Congratulations! You have won Death Match Event.");        }
I want to find from all registered players in event (isInDm) who has most DmKills and reward him, i used that but it says me that maxkills stayed 0...
Post Reply