|
You last visited: Today at 22:52
Advertisement
simple request
Discussion on simple request within the CO2 Private Server forum part of the Conquer Online 2 category.
07/30/2010, 23:04
|
#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.
|
|
|
07/30/2010, 23:20
|
#2
|
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?
|
|
|
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);
?
|
|
|
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();
|
|
|
07/31/2010, 01:06
|
#5
|
elite*gold: 0
Join Date: Feb 2009
Posts: 262
Received Thanks: 161
|
cps += (ushort)vp;
|
|
|
07/31/2010, 01:30
|
#6
|
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
|
Quote:
Originally Posted by teroareboss1
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.
|
|
|
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:
|
|
|
07/31/2010, 03:05
|
#8
|
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
|
|
|
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
|
|
|
07/31/2010, 03:18
|
#10
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
|
Quote:
Originally Posted by kinshi88
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.
|
|
|
07/31/2010, 03:29
|
#11
|
elite*gold: 0
Join Date: Jun 2009
Posts: 787
Received Thanks: 314
|
Quote:
Originally Posted by kinshi88
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).
|
|
|
07/31/2010, 04:29
|
#12
|
elite*gold: 0
Join Date: Feb 2009
Posts: 1,765
Received Thanks: 382
|
Well, is solved.
#Request closed
|
|
|
07/31/2010, 06:07
|
#13
|
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
|
Quote:
Originally Posted by _tao4229_
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
|
|
|
07/31/2010, 10:36
|
#14
|
elite*gold: 106
Join Date: Oct 2006
Posts: 6,047
Received Thanks: 1,165
|
#Closed
|
|
|
 |
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.
|
|