Register for your free account! | Forgot your password?

You last visited: Today at 22:52

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

Advertisement



simple request

Discussion on simple request within the CO2 Private Server forum part of the Conquer Online 2 category.

Closed Thread
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,765
Received Thanks: 382
simple request

I tried to figure this out, but seems to be kinda stucked.
How can i convert VP(ulong) to CPs(ushort).

Dosnt seems to work for me x.X

btw. is for the 5165.
Fish* is offline  
Old 07/30/2010, 23:20   #2
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
uh?
Code:
ulong VP = GC.MyChar.VPS;
GC.MyChar.CPs += VP;
GC.MyChar.VP -= VP;
VP = 0;
Easy?
_DreadNought_ is offline  
Old 07/30/2010, 23:30   #3
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
Code:
CPs = Math.Min((ushort)VPs + CPs, ushort.MaxValue);
?
kinshi88 is offline  
Old 07/30/2010, 23:46   #4
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,765
Received Thanks: 382
I meant, so they keep the current VP.
Like:
GC.MyChar.CPs = GC.MyChar.VP;
but everything i do, always get the can't convert thing lol
the one that was closest to work was urs kinshi.
But it just mde value higher, it should be same for both

this was how i tested urs kinshin:
Code:
                ulong VP = 0;
                uint CP = 0;
                CP = 9999;
                    Program.WriteLine("CP: " + CP);
                VP = 15000;
                Program.WriteLine("VP: " + VP);
                CP = Math.Min((ushort)VP + CP, ushort.MaxValue);
                Program.WriteLine("CP: " + CP);
                Console.ReadLine();
Fish* is offline  
Old 07/31/2010, 01:06   #5
 
elite*gold: 0
Join Date: Feb 2009
Posts: 262
Received Thanks: 161
cps += (ushort)vp;
teroareboss1 is offline  
Thanks
1 User
Old 07/31/2010, 01:30   #6
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
Quote:
Originally Posted by teroareboss1 View Post
cps += (ushort)vp;
VPs are a ulong, and a ulong can hold a lot more than a ushort.
So my way would be about right.
kinshi88 is offline  
Old 07/31/2010, 01:33   #7
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,765
Received Thanks: 382
tero's worked.
And yeah kinshin, but i never think they will get that much vp anyway D:
Fish* is offline  
Old 07/31/2010, 03:05   #8
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
Well it is a big possibility they'll get more than 65355
Arcо is offline  
Thanks
1 User
Old 07/31/2010, 03:06   #9
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
Not a very smart choice. At all.
But whatever, your loss =P
kinshi88 is offline  
Old 07/31/2010, 03:18   #10
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
Quote:
Originally Posted by kinshi88 View Post
Not a very smart choice. At all.
But whatever, your loss =P
Lol we'll just sit here, expecting another help thread saying his vps got bugged.
Arcо is offline  
Thanks
1 User
Old 07/31/2010, 03:29   #11
 
elite*gold: 0
Join Date: Jun 2009
Posts: 787
Received Thanks: 314
Quote:
Originally Posted by kinshi88 View Post
Code:
CPs = Math.Min((ushort)VPs + CPs, ushort.MaxValue);
?
What you're doing doesn't satisfy what you think it should do.

If VPs is already over 0xFFFF then it'll rollback over (as you cast it to a ushort first), but if (VPs % 0xFFFF) + CPs > 0xFFFF it'll rollback over again. You should let it without the cast and you'll have to cast ushort.MaxValue to a uint64 as well as the return type to a ushort as well. (if Math.Min has params for uint64s, I don't know).
_tao4229_ is offline  
Old 07/31/2010, 04:29   #12
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,765
Received Thanks: 382
Well, is solved.
#Request closed
Fish* is offline  
Old 07/31/2010, 06:07   #13
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
Quote:
Originally Posted by _tao4229_ View Post
What you're doing doesn't satisfy what you think it should do.

If VPs is already over 0xFFFF then it'll rollback over (as you cast it to a ushort first), but if (VPs % 0xFFFF) + CPs > 0xFFFF it'll rollback over again. You should let it without the cast and you'll have to cast ushort.MaxValue to a uint64 as well as the return type to a ushort as well. (if Math.Min has params for uint64s, I don't know).
Yeah, I did say my way would be about right =P
I had the right idea
kinshi88 is offline  
Old 07/31/2010, 10:36   #14
 
Huseby's Avatar
 
elite*gold: 106
Join Date: Oct 2006
Posts: 6,047
Received Thanks: 1,165
#Closed
Huseby is offline  
Closed Thread


Similar Threads Similar Threads
A Simple Request.
10/01/2009 - Grand Chase - 1 Replies
Ok, I know theres Script hacks and playertemplate.kom hacks i downloaded a PH playertemplate and it worked for mp hp speed and jump hacks but the script hacks dont work an eror comes up so to my request... can someone make me a playertemplate or make a tutorial on how to make one?
[REQUEST]2 small simple request please look in here
09/20/2008 - CO2 Private Server - 6 Replies
Hello all no one here knows me i am Rukia Owner Od DarkAngelzCO 2.0 i was wondering if anyone can kindly show me 1 solutions first off can anyone tell me how i can add day/night to work for everyone i have been searching deeply for it can anyone please show me with a guide how to get it on my server?
simple request (bot in zero)
03/25/2008 - Zero - 9 Replies
right now im using CBOT 3.0 its a bot in conquer online its working but its not picking meteors or gold, can u guys fix it coz i dont have any i dea how to change it.... in Configuration Setting i put: seme gold=1
a simple request
05/18/2007 - Silkroad Online - 0 Replies
can some one pls give me a link with the ksro client cause when i try to dl it from the main page it sais that i need a pass and loging for network or something like that....any help would be apreciated



All times are GMT +1. The time now is 22:52.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.