Raised This Month: $ Target: $400
 0% 

Changing info from integer's defined in mod?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rixorster
Senior Member
Join Date: Jul 2005
Old 08-22-2006 , 23:24   Changing info from integer's defined in mod?
Reply With Quote #1

Like, i'm making my own mod, and right now i have 'int g_iPower;' in my hud.h, so how could i edit the amount of it with AMXx? Any help will be appreciated ^^
__________________
You never know, what will happen the day after tomorrow...

+karma if i helped you!
Rixorster is offline
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 08-23-2006 , 01:29   Re: Changing info from integer's defined in mod?
Reply With Quote #2

declare the value also in CBasePlayer and update you g_iPower when the copy in CBasePlayer gets changed.
and then search for the offset of it
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
Rixorster
Senior Member
Join Date: Jul 2005
Old 08-23-2006 , 08:17   Re: Changing info from integer's defined in mod?
Reply With Quote #3

Thanks, but how can i find the offset thing? I was also thinking about making it an message instead of this thing, but i'll try making it a message if i can't get this to work.
__________________
You never know, what will happen the day after tomorrow...

+karma if i helped you!
Rixorster is offline
schnitzelmaker
Senior Member
Join Date: Apr 2006
Location: HERE
Old 08-23-2006 , 10:29   Re: Changing info from integer's defined in mod?
Reply With Quote #4

AMXX have for changing an offset of an entity:
Code:
set_pdata_int ( index, offset, value, [ linuxdiff = -5 ] ) get_pdata_int ( index, offset, [ linuxdiff = 5 ] )

To find an offset you need the value,then you can use:
Code:
new value = ... for (new i;i<=1000;i++){//search through 1000 offsets,set it higher to search more offsets.   new newvalue = get_pdata_int (index, i)//index = number of ent/player   if (newvalue == value)     client_print(0,print_chat,"value founded on offset%d",i) }
BIG WARNING: somtime it can crash thought searching.If it crash set "i" lower.

Then if you have the offset,test it with "set_pdata_int" and check ingame if you have the value you have set.

If it an non player/ent offset you need tool like memhack,but they are very complicate.

IF it all to complex i can write a plugin to search the offset,or you give me the dll and i find it.
__________________

Last edited by schnitzelmaker; 08-23-2006 at 16:46.
schnitzelmaker is offline
Rixorster
Senior Member
Join Date: Jul 2005
Old 08-23-2006 , 11:42   Re: Changing info from integer's defined in mod?
Reply With Quote #5

Hurr, fix0red.
I changed it like:
Code:
client_print(0,print_chat, "Value found on: %d", i)
Edit:Fixed that, now, i have 'm_iPower' in serverside, just how the hell am i supposed to change the 'g_iPower' that is in clientside, or how can i do so that the clientside reads the 'm_iPower' instead of 'g_iPower' and (I have an hud bar to show the amount of Power) displays the 'm_iPower' that is stored in CBasePlayer?
__________________
You never know, what will happen the day after tomorrow...

+karma if i helped you!

Last edited by Rixorster; 08-23-2006 at 12:14.
Rixorster 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 14:38.


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