Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 08:36

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Direct a foreach at Char in Map?

Discussion on Direct a foreach at Char in Map? within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
ktamer's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 99
Received Thanks: 35
Direct a foreach at Char in Map?

I've been working at a hunt quest that teleports chars to a map where they must kill a monster get a key find the treasure box, open it then teleport back to TC.
This is what I have but it directs the tele to all characters in game

foreach (Game.Character C in Game.World.H_Chars.Values)
{
Game.World.SendMsgToAll("SYSTEM", "The Treasure has been found. Better luck next time.", 2011, 0);
C.Teleport(1002, 429, 379);
}


how would I direct this to only the characters in the map? I've tried millions of different things...even tried using bools that change the subject of the NPC but for some reason it wont' switch false to true...even with a command...grrrzzz...any and all help is greatly appreciated. (Sometimes I wish I stuck with my 5095 server lol)
ktamer is offline  
Old 03/30/2010, 23:46   #2


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Moved.
Korvacs is offline  
Thanks
1 User
Old 03/30/2010, 23:50   #3
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,765
Received Thanks: 382
Quote:
Originally Posted by ktamer View Post
I've been working at a hunt quest that teleports chars to a map where they must kill a monster get a key find the treasure box, open it then teleport back to TC.
This is what I have but it directs the tele to all characters in game

foreach (Game.Character C in Game.World.H_Chars.Values)
{
Game.World.SendMsgToAll("SYSTEM", "The Treasure has been found. Better luck next time.", 2011, 0);
C.Teleport(1002, 429, 379);
}


how would I direct this to only the characters in the map? I've tried millions of different things...even tried using bools that change the subject of the NPC but for some reason it wont' switch false to true...even with a command...grrrzzz...any and all help is greatly appreciated. (Sometimes I wish I stuck with my 5095 server lol)
make it look for (if char is in map = ????)
Fish* is offline  
Thanks
1 User
Old 03/31/2010, 01:07   #4
 
-Shunsui-'s Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 1,152
Received Thanks: 321
Code:
foreach (DictionaryEntry DE in World.H_Chars)
                                        {
                                            Character Entity = (Character)DE.Value;

                                            if (Entity.Loc.Map == 1505)
                                            {
                                                Entity.Teleport(1002, 420, 420);
}
}
-Shunsui- is offline  
Thanks
1 User
Old 03/31/2010, 04:15   #5
 
elite*gold: 0
Join Date: Feb 2010
Posts: 378
Received Thanks: 86
=P lol, yah- you could use an if statement with "if character is on this map" but...
Why not have it so that it checks how far you are into it ... then it can knock off a few players and revel a 2nd prize.. then knock off a few players so that only 2 remain and have a third treasure (or prize or whatever you want)?
That'd be more exciting. Have it so that a progress is saved to the character's structure and then have it reset on log in to 0. That could track it. =]
Good luck ^^

PS: I'm with you bro! C# for fun! Woot!!
=P
-NewDawn- is offline  
Thanks
1 User
Old 03/31/2010, 04:32   #6
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,765
Received Thanks: 382
Quote:
Originally Posted by -NewDawn- View Post
=P lol, yah- you could use an if statement with "if character is on this map" but...
Why not have it so that it checks how far you are into it ... then it can knock off a few players and revel a 2nd prize.. then knock off a few players so that only 2 remain and have a third treasure (or prize or whatever you want)?
That'd be more exciting. Have it so that a progress is saved to the character's structure and then have it reset on log in to 0. That could track it. =]
Good luck ^^

PS: I'm with you bro! C# for fun! Woot!!
=P
maybe cuz he didnt want a 2nd prize ^^
Fish* is offline  
Old 03/31/2010, 05:54   #7
 
elite*gold: 0
Join Date: Feb 2010
Posts: 378
Received Thanks: 86
Quote:
Originally Posted by grillmad View Post
maybe cuz he didnt want a 2nd prize ^^
Lol, just a suggestion to make it more interesting =P
Have a message pop up that says "Player Name has been eliminated" that only appears on the game map xP
that's what I'd do. rofl =P
-NewDawn- is offline  
Old 03/31/2010, 06:09   #8
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,765
Received Thanks: 382
Quote:
Originally Posted by -NewDawn- View Post
Lol, just a suggestion to make it more interesting =P
Have a message pop up that says "Player Name has been eliminated" that only appears on the game map xP
that's what I'd do. rofl =P
Yea could be cool ^^ Thought is not that hard to make :P
Fish* is offline  
Old 04/01/2010, 05:45   #9
 
ktamer's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 99
Received Thanks: 35
I appreciate the help. Sorry for the late thx, been crankin away at things.
At -NewDawn-
I like your idea. I think alternate prizes would be a good idea. And definitely easy enough to do. As for the rest of the chars, I could tele them to an alternate/copy version of horserace map. Losers take the walk sort of thing ^_^. Once it's all done I'll release it for sure.
Thx again.
ktamer is offline  
Reply


Similar Threads Similar Threads
WOuld someone help direct me....
07/27/2010 - GW Bots - 7 Replies
Hi, due to my lack in ability to speak dutch/german and the fact that i cant find a translator thats worth anything.....I have been scouring this site for a GW bot that farms snow wurms in Boreal Station. If anyone can direct me to that i would be in your debt. Thank you and have a wonderful day.
C++ und Direct X
07/01/2010 - C/C++ - 4 Replies
Guten tag Leute, ich hab vor mir ein Buch zu der Spieleprogrammierung mit Direct X und C++ zu kaufen. Hatte erst vor mir Premium zugang für folgende Seite zu holen: DirectX Tutorial.com - DirectX 9 Tutorials Jedoch liest man da nicht unbedingt gutes drüber deswegen wollte ich mir mal ein paar Tipps von Leuten holen die sich eventuell das ein oder andere Buch gekauft haben. Wäre von Vorteil wenn das Buch in Deutsch wäre ist aber nicht unbedingt notwendig. Ein weiteres problem ist, das...
can any direct me
06/19/2009 - Zero - 0 Replies
can any please tell me how i would go about makeing a spped hack or if there is a topic explainging already i cant see please send me the address
looking for direct x 9
03/09/2008 - GunZ - 1 Replies
im looking for direct x 9 for gunz if you know the website please tell me thanks:cool:



All times are GMT +1. The time now is 08:37.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.