Register for your free account! | Forgot your password?

You last visited: Today at 23:53

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

Advertisement



Doing Multiple Cases

Discussion on Doing Multiple Cases within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2006
Posts: 41
Received Thanks: 2
Doing Multiple Cases

Is there a way to select a case range from the NPC.cs rather than writing each number individualy? and if so how?

Example if my Npc UID's from 1 to 100 all did the same thing rather than doing:

Case1:
Case2:
Case3:
Case4: ect ect ect

Is there Something like:

Case1 < Case100:

That could be used instead.
hacksaw is offline  
Old 09/09/2013, 02:13   #2
 
elite*gold: 0
Join Date: Feb 2006
Posts: 726
Received Thanks: 271
Quote:
Originally Posted by hacksaw View Post
Is there a way to select a case range from the NPC.cs rather than writing each number individualy? and if so how?

Example if my Npc UID's from 1 to 100 all did the same thing rather than doing:

Case1:
Case2:
Case3:
Case4: ect ect ect

Is there Something like:

Case1 < Case100:

That could be used instead.
Code:
If (NPC.UID >= 1 && NPC.UID <=100)
{
//Enter code here
}
Aceking is offline  
Thanks
1 User
Old 09/09/2013, 02:32   #3
 
{ Angelius }'s Avatar
 
elite*gold: 0
Join Date: Aug 2010
Posts: 992
Received Thanks: 1,110
Use the default keyword.

switch(npcid)
{
case 0:
case 1:
case etc:
default:
if(npcid = to whatever you want it to be) { do something; }
break;
}
{ Angelius } is offline  
Thanks
1 User
Old 09/09/2013, 03:50   #4
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
I know VB can do something case-ranging ex. from 1 - 100. C# can do something similar, but a case scope has to be done for every single case inbetween.

You could write your own middleman "compiler" that would translate your sort of code into proper C# code, thus parsing something like:
Code:
case 1 < case 100:
break;
to something like:
Code:
case 1
case 2
...
case 99:
break;
Super Aids is offline  
Thanks
1 User
Old 09/09/2013, 17:26   #5
 
elite*gold: 0
Join Date: Feb 2006
Posts: 41
Received Thanks: 2
Thanks for the ideas guys, Few for me to ponder over there.
hacksaw is offline  
Reply


Similar Threads Similar Threads
[Buying] [S] CS:GO Cases!
09/08/2013 - Counter-Strike Trading - 0 Replies
^ Topic. Sagt mir einfach was ihr haben wollt. Vllt habe ich ja was, was ihr braucht :) mfg voyboy :bandit:
[S] CS:GO Cases
09/04/2013 - Counter-Strike Trading - 0 Replies
^ Topic. I need CS:GO Cases or eSports 2013 Cases. PM me pls.
2 Questions, Selecting multiple coord & multiple inventory items
02/05/2013 - CO2 Private Server - 7 Replies
Need a hand with 2 things ive been tryin to work out but not had much luck so far. 1:Took this example from mining which sets the specific map, But how can you set multiple coords on the map so the action can only been done when standing in those coords rather then the entire map? switch (client.Entity.MapID) { case 1002: {
cases?
08/05/2011 - Combat Arms - 8 Replies
gibs ne website mit den inhalt der verschiedenen cases? die ak74-case l9a1 case mp5 case mp7 case l8a1 case famas case p90 case ? danke :D
GP cases?
04/15/2010 - Combat Arms - 34 Replies
hi, ich geb eigl gar nichts an nx aus (wird auch so bleiben auser die ausnahme ^^) und ich wollte mir die GP cases kaufen so jetzt die frage... bringt es die überhaupt? können da hohe betrage raus kommen? achja sufu find ich nichts !



All times are GMT +1. The time now is 23:54.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

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