Jump to content

Pointers


Ashwin.Star

Recommended Posts

Ashwin.Star

hi friends,

 

 

0x7E49C0 - [pointer] - Player's car pointer* +0x2A9 - [1 byte]* +0x2AA - [1 byte]

 

result of writing values,

0 = freeze at there current position

1 = Damaged

2 = unfreeze them

3 = treat them like they are not there

once if any of them removed, you will not be able to see them again

weather you write the value 2, you will listen only the collision sound,

-------------------------

i found these,

but, Can anyone tell me how to use these pointers in Scripting ?

 

------------------------------------------

swoorup have changed

 

0xA0FD04 - [bYTE] - resolution Widthto0xA0FD04 - [DWORD] - resolution Width

 

so can you tell me the difference between

byte & Dword ?

Edited by Ashwin the new boy
Link to comment
Share on other sites

spaceeinstein

 

0x7E49C0 (car pointer)+0x2A9 (size 1 byte)

 

basically means

 

// 0@ = input existing car handle05E7: 0@ = car 0@ struct0@ += 0x2A905E0: 0@ = read_memory 0@ size 1 virtual_protect 0// 0@ = output value

 

Dword is just four bytes (size 4).

Link to comment
Share on other sites

Ashwin.Star

great!

05E7: 0@ = car 0@ struct

so we can use this for any Vehicle we want (car 0@)

thanks,

i'll try to find more if i get time during exam,

---------------------------------------------------------

tell me one thing

255 is max value for 1 byte

but 2 byte is much more than it (about 69500)

which means no one have screen resolution more then that,

so why we are using 4 byte if 2 byte is enough ??

Link to comment
Share on other sites

You can experiment with hex in programmer mode in windows calculator...

 

BYTE: 0xFF - 255

WORD (2 BYTES): 0xFFFF - 65535

DWORD (4 BYTES): 0xFFFFFFFF - 4294967295

 

However, some things can read them as signed values, meaning the last bit will process the value as a negative number, (mostly occurs only for 4 byte types but can occur for the others, also), in which case having all bits set (0xFF in a byte, etc) will always equal -1. 0x7F (0x7 in 4 bits is all bits set but the last one, so if the first hex digit is 7 or lower, the value can't be negative) as a byte value will produce the new highest result.

 

BYTE: 0x7F - 127

Link to comment
Share on other sites

BYTE 1 - bytes, range 0 to 2^8 * 1 - 1 = 255

WORD 2 - bytes, range 0 to 2^8 * 4 - 1 = 65535

DWORD 4 - bytes, range 0 to 2^8 * 4 - 1 = 4 294 967 295

QWORD 8 - bytes, range 0 to 2^8 * 8 - 1 = 18446744073709551615

 

BYTE, WORD, DWORD, QWORD are meant to be unsigned values.

Link to comment
Share on other sites

Ashwin.Star

 

// 0@ = input existing car handle

05E7: 0@ = car 0@ struct

0@ += 0x2A9

05E0: 0@ = read_memory 0@ size 1 virtual_protect 0

// 0@ = output value

 

will you please tell me what is wrong with my script,

 

 

{$CLEO}thread 'ambu'model.Load(#AMBULAN)038B: load_requested_models:0wait 0if andmodel.Available(#AMBULAN)05EE:  key_pressed 8jf @004C4: create_coordinate 1@ 2@ 3@ from_actor $3 offset 0.0 5.0 0.0Car.Create(0@,146,1@,2@,3@)05E7: 1@ = car 0@ struct1@ += 0x24505DF: write_memory 1@ size 1 value 1 virtual_protect 0wait 250  jump @0

 

this script should spawn an ambulance with siren on,

but it crash the game when game read "05E7",

i also tried "05EA" but then game crash while writing value,

 

also

it should turn on the siren of my current car (police)

 

{$CLEO}thread 'Ashwin':0wait 0if00E0:   player $2 drivingjf @00@ = 0x7E49C0  -----------------------------------------------------------//Pointer to current car0@ += 0x245    ------------------------------------------------------------//Siren offset05DF: write_memory 0@ size 1 value 1 virtual_protect 0  -------------//Turning it onwait 250  jump @0

 

but nothing happens,

what's wrong in it ?

Link to comment
Share on other sites

 

// 0@ = input existing car handle

05E7: 0@ = car 0@ struct

0@ += 0x2A9

05E0: 0@ = read_memory 0@ size 1 virtual_protect 0

// 0@ = output value

 

will you please tell me what is wrong with my script,

 

 

{$CLEO}thread 'ambu'model.Load(#AMBULAN)038B: load_requested_models:0wait 0if andmodel.Available(#AMBULAN)05EE:  key_pressed 8jf @004C4: create_coordinate 1@ 2@ 3@ from_actor $3 offset 0.0 5.0 0.0Car.Create(0@,146,1@,2@,3@)05E7: 1@ = car 0@ struct1@ += 0x24505DF: write_memory 1@ size 1 value 1 virtual_protect 0wait 250  jump @0

 

this script should spawn an ambulance with siren on,

but it crash the game when game read "05E7",

i also tried "05EA" but then game crash while writing value,

 

also

it should turn on the siren of my current car (police)

 

{$CLEO}thread 'Ashwin':0wait 0if00E0:   player $2 drivingjf @00@ = 0x7E49C0  -----------------------------------------------------------//Pointer to current car0@ += 0x245    ------------------------------------------------------------//Siren offset05DF: write_memory 0@ size 1 value 1 virtual_protect 0  -------------//Turning it onwait 250  jump @0

 

but nothing happens,

what's wrong in it ?

There are certain specifications for a vehicle to have the siren on (for SA, anyway, I'll assume the same for VC). The engine must be on, for starters and I think for any siren audio there needs to be a driver. Also I think in SA, the car alarm has to be set for the siren sound to play, or something. They're linked somehow, but I can't remember how, exactly.

 

And BTW, why permanently load a model, then check if it's loaded on every iteration of your loop?

 

 

0@ = 0x7E49C0  -----------------------------------------------------------//Pointer to current car0@ += 0x245    ------------------------------------------------------------//Siren offset05DF: write_memory 0@ size 1 value 1 virtual_protect 0  -------------//Turning it on

 

0x7E49C0 is a POINTER to a struct. You need to read what that pointer is, instead of using the pointers address as a struct...

 

 

05E0: 0@ = read_memory 0x7E49C0 size 4 virtual_protect 00@ += 0x245

 

Edited by Deji
Link to comment
Share on other sites

Ashwin.Star

thanks deji,

i'll try it soon,

i have found some new

+0x5B0 - Rhino & Fire truck Cannon angle

+0x5BB - BF-Inject rotation angle

we can use it in fixing the amount of Rotation to make new type of vehicles for vc like

dumper(sa),cement(sa), etc.

Anyway,

any change to this address change the value of next 3 add also,

so is it float or 4 byte (Dword) ?

Edited by Ashwin the new boy
Link to comment
Share on other sites

Actually I changed the resolution address properties. tounge2.gif

 

The resolution does not occupy only one byte, Neither 2 bytes but 4 bytes. Hence DWORD

 

A pointer is a variable pointing to something (maybe a structure, array, integers, float, etc)

Link to comment
Share on other sites

Ashwin.Star

i got the address for save game directory,

can anyone check if they are correct or not,

 

0x783F12

Save game directory [string].

 

0x9750B6

Directory where to look for Save Game [string].

 

@deji

it works,

but only with the current car of player pointer,

how to get a pointer for any other car ?

 

@swoorup

its ok,

i saw the history,

actually i am trying to find the offset for Headlights switch,

good luck to me,

 

my next exam is of Mathematics on 6 March,

so i am feeling tension free, ;-)

Edited by Ashwin the new boy
Link to comment
Share on other sites

  • 2 weeks later...
Ashwin.Star

sorry for bump guys but

so, 0x7E49C0 is pointer to our car,

then how to get the pointer of any other Vehicle ?

 

& how to use this opcode

05E7: $9001 = car $9000 struct //<----- $9000 is vehicle handle

but game crash instantly if i use this opcode,

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.