Help,

12/02/2009 21:43 -Shunsui-#1
Can anyone tell me how i can make Something like GC.MyChar.LastAlive
i wanna make it so that. LastAlive checks if theres No one else in that Map Alive iam trying to do Pk Events.. Version 5165
12/02/2009 21:58 Zeya#2
Quote:
Originally Posted by flako27 View Post
Can anyone tell me how i can make Something like GC.MyChar.LastAlive
i wanna make it so that. LastAlive checks if theres No one else in that Map Alive iam trying to do Pk Events.. Version 5165
Noone is gonna help you. These forums have died.
12/03/2009 14:42 Korvacs#3
What you need to do is create a hashtable or a dictionary of characters when they first join the map, then when people die in that map they need to be removed from the hashtable, everytime someone dies perform a check to see if the length of the hashtable is 1, if that checkreturns true then theres only 1 person left and they are the winner.

Im not gunna give ya any code for it, you should be able to work something out from that.
12/03/2009 18:31 ~*NewDuuDe*~#4
Was just about to do a new PK tournament myself, so thanks.
12/03/2009 21:19 -Shunsui-#5
Thanks Korvac
12/04/2009 12:20 PeTe Ninja#6
well korvacs is right but that source probably already has it..

if it does for ALl chars like world.all since its lotf

Code:
byte Count = 0;

foreach (DictionaryEntry DE in AllAccounts)
{
Entity E = DE.Value;

if (E.InMap(1025))
{
if (Alive)
{
Count++;

}
}

if (Count = 1)
{
WE HAVE A WINNER..
}
:)
12/04/2009 13:18 -Shunsui-#7
Quote:
Originally Posted by PeTe Ninja View Post
well korvacs is right but that source probably already has it..

if it does for ALl chars like world.all since its lotf

Code:
byte Count = 0;

foreach (DictionaryEntry DE in AllAccounts)
{
Entity E = DE.Value;

if (E.InMap(1025))
{
if (Alive)
{
Count++;

}
}

if (Count = 1)
{
WE HAVE A WINNER..
}
:)
THanx And Lol at your Siggy off to School now :)
12/04/2009 16:52 Basser#8
Quote:
Originally Posted by Zeya View Post
Noone is gonna help you. These forums have died.
Deja vu.
12/11/2009 18:04 PeTe Ninja#9
#request close hes been helped.
12/11/2009 19:20 tanelipe#10
#Closed