Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!   (85,519 visits to this link)

    2. News

    1. GTA Online

      1. Find Lobbies & Players
      2. Guides & Strategies
      3. Vehicles
      4. Content Creator
      5. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    4. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption 2

    2. Red Dead Redemption

    3. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Forum Support

    2. Site Suggestions

Sign in to follow this  
Jack

CPed and CWanted

Recommended Posts

Jack

Here's what I know:

gtaIII    CPed+0x53C=CWantedgta VC    CPed+0x5F4=CWanted

And I need this offset for SA:

gta SA    CPed+0x???=CWanted

Is it possible to calculate the offset if we have CPed and CWanted?

Why do I need this? - There is no opcode for CWanted but for CPed we can use 0A96:

Thanks.

Edited by Jack...

Share this post


Link to post
Share on other sites
Silent

afaik there's no CWanted pointer in SA CPed, but when the subclass is CPlayerPed, it stores a CPlayerPedData pointer which has CWanted. In other words, check if CPed+0x480 is nonzero, and if it's not, get a pointer to CWanted from the memory which is pointed to by CPed+0x480 (CWanted is stored at CPlayerPedData+0).

 

SCMy, it'd be

 

 

0A96: [email protected] = actor $PLAYER_ACTOR [email protected] += 0x4800A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0if not [email protected] == 0then    0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0end
Edited by Silent

Share this post


Link to post
Share on other sites
Jack

It works :lol:. There're 2 offsets. Thank you SPL.

 

One question. Where did you find that 480 offset?

Edited by Jack...

Share this post


Link to post
Share on other sites
Silent

It's been in the public IDBs since ages.

Share this post


Link to post
Share on other sites
Jack

It's been in the public IDBs since ages.

You mean in III other section for mem add?

Share this post


Link to post
Share on other sites
DK22Pac

0000 physical        CPhysical ?

0138 m_pedAudio CAEPedAudioEntity ?

0294 m_pedSpeech CAEPedSpeechAudioEntity ?

0394 m_weaponAudio CAEPedWeaponAudioEntity ?

043C field_43C db 36 dup(?)

0460 field_460 db 8 dup(?)

0468 field_468 dd ?

046C m_dwPedFlags dd 4 dup(?)

047C m_pIntelligence dd ? ; CPedIntelligence *

0480 m_pPlayerData dd ? ; CPlayerData *

0484 m_nCreatedBy db ? ; 1 - game, 2 - script, 3 - ?

0485 _pad0 db 3 dup(?)

0488 m_apPedBones dd 19 dup(?) ; AnimBlendFrameData *

04D4 m_dwAnimGroup dd ?

04D8 m_vAnimMovingShiftLocal CVector2D ?

04E0 m_acquaintance CPedAcquaintance ?

04F4 m_pWeaponObject dd ? ; RpAtomic *

04F8 m_pGunflashObject dd ? ; RpAtomic *

04FC m_pGogglesObject dd ? ; RpAtomic *

0500 m_pGogglesState dd ? ; unsigned char *

0504 weaponGunflashAlphaMP1 dw ?

0506 field_506 dw ?

0508 weaponGunflashAlphaMP2 dw ?

050A field_50A dw ?

050C m_pedIK CPedIK ?

052C field_52C dd ?

0530 m_dwPedState dd ? ; enum ePedState

0534 m_dwMoveState dd ?

0538 field_538 dd ?

053C field_53C dd ?

0540 m_fHealth dd ?

0544 m_fMaxHealth dd ?

0548 m_fArmour dd ?

054C m_dwTimeTillWeNeedThisPed dd ?

0550 m_vAnimMovingShift CVector2D ?

0558 m_fCurrentRotation dd ?

055C m_fAimingRotation dd ?

0560 m_fHeadingChangeRate dd ?

0564 m_dwMoveAnim dd ? ; 1 - on foot, 4 - starting to move, 6 - walking/running, 7 - sprinting

0568 field_568 dd ?

056C field_56C RwV3D ?

0578 field_578 RwV3D ?

0584 m_pContactEntity dd ? ; CEntity *

0588 m_pLastVehicle dd ? ; CVehicle *

058C m_pVehicle dd ? ; CVehicle *

0590 field_590 dd ?

0594 field_594 dd ?

0598 m_nPedType dd ? ; ePedType

059C m_pStats dd ? ; CPedStat *

05A0 m_aWeapons CWeapon 13 dup(?)

070C m_nSavedWeapon dd ? ; when we need to hide ped weapon, we save it temporary here

0710 m_nDelayedWeapon dd ? ; 'delayed' weapon is like an additional weapon, f.e., simple cop has a nitestick as current and pistol as delayed weapons

0714 m_dwDelayedWeaponAmmo dd ?

0718 m_nActiveWeaponSlot db ?

0719 m_nWeaponShootingRate db ?

071A m_nWeaponAccuracy db ?

071B _pad db ?

071C m_pTargetedObject dd ? ; CObject *

0720 field_720 dd ?

0724 field_724 dd ?

0728 field_728 dd ?

072C m_nWeaponSkill db ?

072D m_nFightingStyle db ?

072E m_nAllowedAttackMoves db ?

072F field_72F db ?

0730 m_pFire dd ? ; CFire *

0734 field_734 dd ?

0738 m_pLookAtEntity dd ? ; offset

073C m_fLookHeading dd ?

0740 m_dwWeaponModelId dd ?

0744 field_744 dd ?

0748 m_dwLookTime dd ?

074C field_74C dd ?

0750 m_dwTimeWhenDead dd ? ; this is used for making blood foot prints

0754 m_nBodypartToRemove db ?

0755 field_755 db ?

0756 m_wMoneyCount dw ?

0758 field_758 dd ?

075C field_75C dd ?

0760 m_nLastWeaponDamage db ? ; eWeaponType

0761 field_761 db 3 dup(?)

0764 m_pLastEntityDamaged dd ? ; CPed *

0768 field_768 dd ?

076C m_vTurretOffset CVector ?

0778 m_fTurretAngleA dd ?

077C m_fTurretAngleB dd ?

0780 m_dwTurretPosnMode dd ?

0784 m_dwTurretAmmo dd ?

0788 m_pCoverPoint dd ? ; CCoverPoint *, related to CTaskComplexKillPedOnFootArmed

078C m_pEnex dd ? ; CEnEx *

0790 m_fRemovalDistMultiplier dd ? ; float

0794 m_wSpecialModelIndex dw ?

0796 field_796 db 2 dup(?)

0798 field_798 dd ?

Share this post


Link to post
Share on other sites
Jack

Is there a CPedWeaponAccuracy offset? Direct value change cause the crash on US (not the case with EU):

0x5E83F1    // 60 default

Share this post


Link to post
Share on other sites
DK22Pac

Did you set virtual_protect to 1?

Share this post


Link to post
Share on other sites
Jack

Yes. Also tried with CE editing - same thing happened.

 

EDIT: CCopPedWeaponAccuracy works fine on both - no crash.

Edited by Jack...

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

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