| View previous topic :: View next topic |
| Author |
Message |
RAIN MAN Cheater
Reputation: 0
Joined: 27 Oct 2009 Posts: 25
|
Posted: Tue Mar 09, 2010 7:41 pm Post subject: How to set values less than 1 in C# |
|
|
idk why its not working im trying to set 0.100000001490116 as a value and i know how to set like values that are above 1 but it works different . also i thought that i put a f at the end so 0.100000001490116f but still no luck what am i doing wrong ? thanks guys. lol
by the way im making off buttons for a trainer and it requires it to be lower than one . thanks
|
|
| Back to top |
|
 |
iPromise Grandmaster Cheater
Reputation: -1
Joined: 27 Jun 2009 Posts: 529 Location: Canada
|
Posted: Tue Mar 09, 2010 9:35 pm Post subject: |
|
|
I think you should use a double for this:
| Code: |
*(double*) Address = 0.100000001490116;
|
see if this works.
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Wed Mar 10, 2010 12:39 am Post subject: |
|
|
| iPromise wrote: | | Code: |
*(double*) Address = 0.100000001490116;
|
|
wtf is this
@op: just use a float for the data type.
|
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Wed Mar 10, 2010 2:27 am Post subject: |
|
|
| iPromise wrote: | | Herp durp. |
Why are you still here!?
|
|
| Back to top |
|
 |
RAIN MAN Cheater
Reputation: 0
Joined: 27 Oct 2009 Posts: 25
|
Posted: Wed Mar 10, 2010 1:46 pm Post subject: |
|
|
i didnt find out how to write a float in C# lower than 1 but i just changed type to 4 bytes so i it works just have to go back through my addys.
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Wed Mar 10, 2010 4:55 pm Post subject: |
|
|
float f = 0.000123f;
if by write you mean use for like a trainer, then it's no difference, just write it all the same. a float is 4 bytes as well.
|
|
| Back to top |
|
 |
ArabProphet How do I cheat?
Reputation: 0
Joined: 15 Jan 2010 Posts: 7
|
Posted: Wed Mar 10, 2010 9:12 pm Post subject: |
|
|
I believe you could also use double... like
double var = 0.10101010101001337;
|
|
| Back to top |
|
 |
Pingo Grandmaster Cheater
Reputation: 8
Joined: 12 Jul 2007 Posts: 571
|
Posted: Thu Mar 11, 2010 7:19 am Post subject: |
|
|
0.1f is fine Rainman. With your memory reader it would look like this
Mem.WriteFloat(Mem.Pointer(true, 0x479E70, 0xOFFSET), 0.1f);
Replace the bold text. I know you'l be doin a mod so leave the rest the same.
Slovach is right though. Write it as 4byte if you're unable to as float. It doesnt make any difference unless you plan on editing it within the app. Then float would be best.
Both these are 0.1f but 4byte instead. One in hex other dec
Mem.WriteInt(Mem.Pointer(true, 0x479E70, 0xOffset), 0x3DCCCCCD);
Mem.WriteInt(Mem.Pointer(true, 0x479E70, 0xOffset), 1036831949);
_________________
|
|
| Back to top |
|
 |
NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Mon Mar 29, 2010 9:19 am Post subject: |
|
|
| slovach wrote: | | iPromise wrote: | | Code: |
*(double*) Address = 0.100000001490116;
|
|
wtf is this
@op: just use a float for the data type. |
double d = 0.0000000000000000001;
float f = 0.00000000000000000001f;
whats the difference?
_________________
Intel over amd yes. |
|
| Back to top |
|
 |
gogodr I post too much
Reputation: 125
Joined: 19 Dec 2006 Posts: 2041
|
Posted: Mon Mar 29, 2010 10:28 pm Post subject: |
|
|
| float stores 4 bytes numbers and double stores 8 bytes numbers
|
|
| Back to top |
|
 |
RAIN MAN Cheater
Reputation: 0
Joined: 27 Oct 2009 Posts: 25
|
Posted: Wed Mar 31, 2010 12:09 pm Post subject: |
|
|
thanks
|
|
| Back to top |
|
 |
|