Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

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

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

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

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

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

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

    2. Support

    3. Suggestions

Happy Holidays from the GTANet team!

CLEO OPCODE Help VC [Get Actor Model]


JangHaeJoo
 Share

Recommended Posts

Hi, I was wondering if there is a CLEO OPCODE for getting the actor's model. I was thinking of something like this.

[email protected] = [email protected] model // integer values

and also if there is an opcode opposite to this code

02F2:   actor $4643 model == 1 

maybe something like

not actor $4643 model == 1

Thanks in advance. :sui::panic:

Link to comment
Share on other sites

02F2
0665

 

The first one can be used directly as a conditional check, and the second one stores the actors model into the variable.

If you want the opposite opcodes then put the number 8 instead of 0:

82F2 is the opposite then 02F2.

 

EDIT: Sorry - 0665 is for SA only. In VC you can store actors model into the variable like this (example with [email protected] actors handle):

05E6: [email protected] = actor [email protected] struct // CPed000A: [email protected] += 0x5C // 5C is the offset to a model ID05E0: [email protected] = read_memory [email protected] size 4 virtual_protect 0  // model ID

So actors [email protected] model is now stored into the [email protected] variable.

Edited by Jack
  • Like 2
Link to comment
Share on other sites

The snippet is not exactly right in the terms of read size. Corrected:

 

 

05E6: [email protected] = actor [email protected] struct // [email protected] += 0x5C // 5C is the offset to a model [email protected] = 005E0: [email protected] = read_memory [email protected] size 2 virtual_protect 0  // model ID
Note that you'll be better zeroing the variable you're reading to before reading (as you're only reading 2 bytes and I'm not sure what tactic VC CLEO used on that one, could not be zeroing the remaining bits).
  • Like 2
Link to comment
Share on other sites

Yeah, but no one said he won't be reusing this var later/earlier on ;)

Link to comment
Share on other sites

According to the disassembled code (no in-game test), VC's CLEO does a movzx (move with zero extend) therefore unchanged bits are freed, thus no initialization is needed. Unless the developer didn't reference ScriptParams (0x00A43C78) as an array of integers or did a trivial assignment, this issue wouldn't have ever been able to occur.

Edited by Wesser
  • Like 3

012          345
678   9A   BCD
EFG HIJK LMN
OPQR  STUV
WX    YZ

Link to comment
Share on other sites

Thanks for the quick reply, you guys. Cuz I was kinda experimenting on killing a anyone who enters ma car. Except for Lance, Hillary and probably Rico who drives the vehicle I drove. They'd die later in the game anyways but I wouldn't want them dead yet just because my car treats them as carjackers!

 

Aw darn. I just revealed my mod's purpose. I'll try this out soon. I've tried 0665 thinking that the game will let it pass through although I knew that it is only supported in SA. But as expected... sigh...

 

Errmmm... I was kinda startled for a moment about the 'he' thing there. I forgive you haha! :pp

Many thanks, guys. Share these cookies around! :cookie::cookie::cookie: I only have three now 'cause I ate one. Sorry. :lol:

Link to comment
Share on other sites

Lance, Hillary and Rico are special actor characters and they show up in missions so it's better to check if the ped inside a car is a random or mission created:

CPed +0x160 m_nCreatedBy    1 - Random ped     2 - Mission ped

So if it's random - do the model check then kill the ped, otherwise make no changes.

Edited by Jack
Link to comment
Share on other sites

  • 4 weeks later...

Cool..! I'll put this on my script when I get the chance to. My PC got CRC a week after my last post and everything went crazy. Right now, I'm using my friend's laptop (She's really a blessing.). I agreed to make her a few simple custom scripts. But I'm afraid my hands are still off the script since she only has SA and IV. Anyways, thank you and thanks for all who helped. As soon as I could get my hands on a spankin' new HDD or get my friend to install VC, the script will still be on-hold. Till then. :santa::santa::santa::santa::santa:

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
 Share

  • 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.