Raised This Month: $32 Target: $400
 8% 

set_offset_float


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CheesyPeteza
Senior Member
Join Date: Feb 2004
Location: UK
Old 03-22-2004 , 19:59   set_offset_float
Reply With Quote #1

Can some scripter test this please?

I've got to the stage where I think it might be broke. But you never know with these things, it could just be me doing something stupid.
__________________
YO|Cheesy Peteza

[email protected]

CheesyPeteza is offline
BAILOPAN
Join Date: Jan 2004
Old 03-22-2004 , 20:00  
Reply With Quote #2

what's an example of an offset that can be set as a float?

I'll test it

keep in mind I only have cs
__________________
egg
BAILOPAN is offline
CheesyPeteza
Senior Member
Join Date: Feb 2004
Location: UK
Old 03-22-2004 , 20:02  
Reply With Quote #3

um yeah that was my problem too, I couldn't think of anymore examples outside of ns.

Perhaps the cs money offset, dunno is that a float?
__________________
YO|Cheesy Peteza

[email protected]

CheesyPeteza is offline
BAILOPAN
Join Date: Jan 2004
Old 03-22-2004 , 20:06  
Reply With Quote #4

nope, is int
__________________
egg
BAILOPAN is offline
CheesyPeteza
Senior Member
Join Date: Feb 2004
Location: UK
Old 03-22-2004 , 20:50  
Reply With Quote #5

nm it was broke and BAILOPAN has fixed it.
__________________
YO|Cheesy Peteza

[email protected]

CheesyPeteza is offline
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 03-23-2004 , 07:39  
Reply With Quote #6

Ehr? I fixed it! :-)
it didn't cast the specified value to a float before setting it at the offset...
Johnny got his gun is offline
BAILOPAN
Join Date: Jan 2004
Old 03-23-2004 , 08:04  
Reply With Quote #7

no, actually, I recompiled my version and sent to him and then you changed it all back

jghg if I have to see one more of your pointer casts I will stab myself
__________________
egg
BAILOPAN is offline
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 03-23-2004 , 08:43  
Reply With Quote #8

My way:
Code:
*((float *)pEnt->pvPrivateData + off) = *(float *)((void *)&params[3]);
Your way:
Code:
float fNewValue = *(float *)((void *)&params[3]);
*((float *)Player->pvPrivateData + off) = fNewValue;
Casting is done the exact same way.
Only change is that you make a new variable for this.

Bailopan killed self with a headshot from cast

;-)
Johnny got his gun is offline
BAILOPAN
Join Date: Jan 2004
Old 03-23-2004 , 08:44  
Reply With Quote #9

it was get_offset_float that was not working
__________________
egg
BAILOPAN is offline
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 03-23-2004 , 09:06  
Reply With Quote #10

Ok obviously I changed get_offset_float also then, don't really remember that.
so change here is:
my: retVal = *((float *)pEnt->pvPrivateData + off);
your: retVal = ((float)*((float *)pEnt->pvPrivateData + off));

the last (float) is not necessary since its already cast to float* and then made to return what is where the pointer is pointing at by the *.

Not too different though to me
Johnny got his gun is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:24.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode