Private Data
I don't know if this is just a "duh" thing to people, but I thought I'd share this anyways. I have found a fairly simple way to access an enitity's private data. This will of course be mod-specific, but for things like money in CS:S it doesn't really matter how that will be read or modified. Anyways this is basically how to do it:
Code:
edict_t *pPlayer; So here is some code that demonstrates some of the offsets I have found already. The offsets will of course change when CS:S is updated, so be aware of that. Code:
/* Helper functions */ |
I haven't seen any user message Money to update the money on the client side. How do you update the money client side?
|
Oh I forgot to mention that. Well there is no Money message like on the old CS. I thought I was going to have do some ugly hack to get it to update the HUD. But apparently just changing the data in itself will update the HUD anyways. I would guess that the game must check the value continuously and update it when the money value has changed.
Oh yes, and one other thing. These offsets are for a Windows machine. I'm not sure yet if it's simply going to be a +5 under Linux or not as I wasn't able to test this on a Linux machine yet. |
nice work :) Did you just guess offsets to see what they do ?
|
Well I did more than guessing, heh. I did a dump of offsets like I do trying to find offsets under HL1. It's not very polished code, but it's what I used:
Code:
int value = 0; |
Avoid like the plague.
Just kidding - gj :D |
OK I found these when playing around:
Quote:
|
Quote:
|
ok here is a question... lets say I get an offset and it contains like
(1<<1) | (1<<2) | (1<<3) And I just want to set the (1<<1) to 0 ((0<<1))... How would I do this? |
Quote:
So assuming (int) offsetValue has been set prior to this: offsetValue &= ~(1<<1) |
All times are GMT -4. The time now is 14:36. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.