hey Epvp Members , i am looking for Check how many players alive on the current map , can anybody help me to find it ?
thanks everybody .
thanks everybody .
int alive = 0;
foreach(Entity player in Program.GamePool.Values)
if(player.Map = Desiredmaphere)
if(player.Alive)//or if (!player.ContainsFlag(Enums.Flags.Dead))
alive++;
foreach(GameClient client in Kernel.GamePool.Values)
{
if (client.Char.MapID.Id == MapID(desired ID) && (!client.Char.Dead))
{
/*
*Execute the code you want to do if there MapID is the correct one
*and if the client is Dead.
*/
}
}
lol , sorry for wrong name :)Quote:
nice my name is 123tails now oO
hmm lol... do something like :
don't copy e paste.. its an example >DCode:int alive = 0; foreach(Entity player in Program.GamePool.Values) if(player.Map = Desiredmaphere) if(player.Alive)//or if (!player.ContainsFlag(Enums.Flags.Dead)) alive++;
if (map.playerscount = 1)
Quote:
This "guy" emailed me asking how o.O why he made a thread just goes to show that unless you give him exactly the right code he can copy+paste into his source he'll keep asking.
The code I gave him to adapt was something like
Code:foreach(GameClient client in Kernel.GamePool.Values) { if (client.Char.MapID.Id == MapID(desired ID) && (!client.Char.Dead)) { /* *Execute the code you want to do if there MapID is the correct one *and if the client is Dead. */ } }
if (client.Entity.currentmap == 1002)
if (client.Entity.Alive && InMapAlive == 1)
{
_GC.MyChar.Teleport(1002, 438, 382);