JangHaeJoo Posted November 9, 2014 Share Posted November 9, 2014 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. Link to comment Share on other sites More sharing options...
Jack Posted November 9, 2014 Share Posted November 9, 2014 (edited) 02F20665 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 November 9, 2014 by Jack JangHaeJoo and Silent 2 Tank Fire [SA] New Police Helicopter [VC & III] My YouTube Channel Link to comment Share on other sites More sharing options...
Silent Posted November 9, 2014 Share Posted November 9, 2014 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 IDNote 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). JangHaeJoo and Jack 2 Link to comment Share on other sites More sharing options...
Jack Posted November 9, 2014 Share Posted November 9, 2014 Aren't the undefined variables already have the value 0? Tank Fire [SA] New Police Helicopter [VC & III] My YouTube Channel Link to comment Share on other sites More sharing options...
Silent Posted November 9, 2014 Share Posted November 9, 2014 Yeah, but no one said he won't be reusing this var later/earlier on Link to comment Share on other sites More sharing options...
Jack Posted November 9, 2014 Share Posted November 9, 2014 (edited) It's good to know. Btw (s)he's female . Edited November 9, 2014 by Jack Tank Fire [SA] New Police Helicopter [VC & III] My YouTube Channel Link to comment Share on other sites More sharing options...
Wesser Posted November 9, 2014 Share Posted November 9, 2014 (edited) 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 November 9, 2014 by Wesser Silent, Jack and JangHaeJoo 3 012 345 678 9A BCD EFG HIJK LMN OPQR STUV WX YZ Link to comment Share on other sites More sharing options...
JangHaeJoo Posted November 9, 2014 Author Share Posted November 9, 2014 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! Many thanks, guys. Share these cookies around! I only have three now 'cause I ate one. Sorry. Link to comment Share on other sites More sharing options...
Jack Posted November 9, 2014 Share Posted November 9, 2014 (edited) 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 November 9, 2014 by Jack Tank Fire [SA] New Police Helicopter [VC & III] My YouTube Channel Link to comment Share on other sites More sharing options...
JangHaeJoo Posted December 7, 2014 Author Share Posted December 7, 2014 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. 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