Swoorup Posted January 28, 2012 Share Posted January 28, 2012 What does each of these opcodes do? 05E6: [email protected] = actor [email protected] struct 05E7: [email protected] = car [email protected] struct 05E8: [email protected] = object [email protected] struct 05E9: [email protected] = ped_struct [email protected] handle 05EB: [email protected] = vehicle_struct %1d% handle 05EA: [email protected] = vehicle_struct [email protected] handle I think all contains the address that points to the structure an entity. But what is the difference between 0x5E7 and 0x5EB and 0x5EA Link to comment Share on other sites More sharing options...
Deji Posted January 28, 2012 Share Posted January 28, 2012 05E6, 05E7 and 05E8 get the class pointer to the entity from the handle. 05E9, 05EA and 05EB get the handle of the entity from the class pointer. Link to comment Share on other sites More sharing options...
Swoorup Posted January 28, 2012 Author Share Posted January 28, 2012 It seems a bit of confusing for me actually. Deji can you tell me which one would point to a vehicle block directly from a variable (the one which I would use to create a vehicle)? EDIT: And what is an entity? Is it an instance of anything used in SCM? Link to comment Share on other sites More sharing options...
Link2012 Posted January 28, 2012 Share Posted January 28, 2012 009A: [email protected] = create_actor_pedtype 4 model #MALE01 at 0.0 0.0 0.0 // We created a actor05E6: [email protected] = actor [email protected] struct // Get the pointer to actor struct based in its handle ([email protected])... ops we overwrite its handle! OMG!05E9: [email protected] = ped_struct [email protected] handle // We get the actor handle based in its struct... We have the handle back Link to comment Share on other sites More sharing options...
Swoorup Posted January 28, 2012 Author Share Posted January 28, 2012 What you just did is played handle contained [email protected] as if it was a football? Correct me if I am wrong though TQ! Link to comment Share on other sites More sharing options...
fastman92 Posted January 28, 2012 Share Posted January 28, 2012 (edited) First of all by struct it`s meant to be memory address It`s address (or pointer) of structure .g CPed. Example of function using CVehicle struct: :GetVehicleDoorState{Description: Gets current door state of vehicle handle. 1 - open 2 - closedParameters: Passed: [email protected] - vehicle handle Result: [email protected] Returns true or false.Example: 0AB1: call_scm_func @GetVehicleDoorState 1 car_handle [email protected] store_state_to [email protected] }0A97: [email protected] = car [email protected] struct [email protected] += 1272 // This is memory adress. Car struct (specified car) + 1272 is adress of door state. 0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect false0AB2: ret 1 [email protected] Value on address [car struct + 1272] is a door state. When you have memory address you can read value of some part of structure. Edited January 28, 2012 by fastman92 Link to comment Share on other sites More sharing options...
Link2012 Posted January 28, 2012 Share Posted January 28, 2012 What you just did is played handle contained [email protected] as if it was a football? Correct me if I am wrong though TQ! My example was so bad? Link to comment Share on other sites More sharing options...
Swoorup Posted January 29, 2012 Author Share Posted January 29, 2012 Exactly fastman That was what in my mind earlier. So it means I can alter or read any of these value from vehicle struct 0x7E49C0 - [pointer] - Player's car pointer (player pointer when not in car)+0x04 - [float] - X roll +0x08 - [float] - Y roll +0x0C - [float] - Z roll +0x14 - [float] - X direction +0x18 - [float] - Y direction +0x1C - [float] - Z direction +0x24 - [float] - Last X position +0x28 - [float] - Last Y position +0x2C - [float] - Last Z position +0x34 - [float] - x coordinate +0x38 - [float] - y coordinate +0x3C - [float] - z coordinate +0x5C - [4 bytes] - IDE model Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now