public bool AnyPlayersInMap(ushort MapID)//Since mapids are ushort
{
int i = 0;
foreach (Game.Character C in World.H_Chars.Values) {
if (C.Loc.Map == MapID)
i++; }
if (i > 0)
return true;
return false;
}
Code:
public int PlayersInMap(ushort MapID)//Since mapids are ushort
{
int i = 0;
foreach (Game.Character C in World.H_Chars.Values) {
if (C.Loc.Map == MapID)
i++; }
return i;
}
public bool AnyPlayersInMap(ushort MapID)//Since mapids are ushort
{
int i = 0;
foreach (Game.Character C in World.H_Chars.Values) {
if (C.Loc.Map == MapID)
i++; }
if (i > 0)
return true;
return false;
}
I'm not saying your method is good or not, but if you're doing it that way simply do:
Code:
public bool MapHasPlayers(ushort Map)
{
foreach(GameClient client in Kernel.GameClients)
if(client.Entity.MapID == Map)
return true;
return false
}
Might just stick in that I recommend a public dictonary for all spawned objects on the server, with that you could simply call something like this:
Quote:
public bool MapHasPlayers(Maps map)
{
return (Kernel.Objects[map].Lenght > 0);
}
S> Royality_EU - CHARS ! , Check it out 05/13/2010 - Conquer Online 2 Trading - 41 Replies Hi all ! :) i have to sell some chars in server ROYALITY_EU , i quit so maybe someone need good chars..
1. 1st Char is : war-war-tro 130 - 130 - 131 ! with eq:
- Super +5 2 soc TRO ARMOR ( SDG SDG ) lvl 120
- Super +5 2 soc RING ( SDG SDG ) lvl 126 !!
- Super +5 2 soc CLUB ( SDG SDG ) lvl 130
- Super +5 2 soc BLADE ( SDG SDG ) lvl 130
- Super +4 1soc CORO ( SDG ) lvl 112
- Elite +4 1 soc Neck ( SDG ) lvl 120
- Elite +4 1 soc Boots ( SDG ) lvl 100
[Price check] Chars even. 05/11/2010 - Archlord Trading - 36 Replies Guys,
I have some acounts,
and i was wondering what there worth.
1:
lvl 3x mage with collection lvl 14,4(and about 2k mats and roughly 700 meta pots)
2:
lvl 2x knight with collection lvl 12 and alchemy lvl 9,3(also around 2k mats, lots of rare and finest, so way way more then enough to get it to lvl 10)
just check it ^^ chars + gold for sale 06/15/2009 - 9Dragons - 19 Replies Hello all :) i have 2 nukers and 1 warrior for sale + lots of gold :)
--well the warrior is almost hm :P and it is a bit expensive cuz i used 40k + coins on this account ^^ it has 7 months premium left 2-3 decos 2 tiagrams few xp cards 40 kgs , 100 ems and more ^^ as for items all relics u need , adv clan clothes , a veri nice sword bd 2 sloted +9 3/3 :P 500 def clothes and many others items :P the price for it is around 400e ...idk how this looks for u but after so many time and coins...
WTS/WTT Check thread 2moons/WoW chars 03/13/2009 - Dekaron Trading - 7 Replies OPEN TO SENSIBLE OFFERS IN CASH OR EVE ISK
OK well this is a bit of a stretch but I have two chars on different games which I'd like to sell or trade.
12x Segnale - 2moons Abaddon
Naked, no gears at all, has wings, multiple costumes, sylphid token, pet token and 10m dil. Would make a nice addition to someones char base. Also has 60 summoner on the account plus a couple of tiny chars.
80 Blood Elf Death Knight (Unholy DPS) - WoW EU Turalyon