MKKJ Posted April 12, 2016 Share Posted April 12, 2016 (edited) I've been trying to make script which needs to check if certain vehicle player tries to drive is owned by player And opcode 0A17 sets something like "player owner" flag to spawner vehicles - whether you gain wanted star if entering this car with police nearby. Is there are any way to read this flag or set this flag for other vehicles? Edited April 12, 2016 by MKKJ Link to comment Share on other sites More sharing options...
OrionSR Posted April 12, 2016 Share Posted April 12, 2016 Yes, but it won't help - not directly anyway. 0A17 sets a flag on a car generator; that information is easily mapped in memory but won't help. You need info on the vehicle that is created by the car generator. I'm not finding anything obvious in my standard CVehicle reference. Players may have additional info in the SA Memory topic that never migrated to the wiki. ChangeLawEnforcerState - I wonder what function does. This seems like the sort of thing that might be easy to track down, but I doubt I'll have the time to investigate anytime soon. My thought is to restrict vehicle creation using restricted cube corners and any codes that reduced traffic or disable aircraft and police that seem appropriate. Then dump the entire car generator pool and create and display a row of 5 player owned and another row of non-owned car generators in an isolated area like a gully or runway. Then flood the rest of the cargen pool with undisplayed generators to prevent streamed car generators from creating vehicles. Hopefully that will limit all vehicles in memory to a controlled set of 10. If those records are extracted and aligned in an editor (text, hex, spreadsheet) the difference between the first set of owned vehicles might be visually distinguishable. Link to comment Share on other sites More sharing options...
MKKJ Posted April 12, 2016 Author Share Posted April 12, 2016 (edited) Yeah, i tried search CVehicle reference and found nothing - not checked the topic, though.Strange, I thought someone already figured out this, as this flag used commonly and also used at ambulance/police car for slight health/shotgun.I think i found some of this 'function' you said, I recalled HasBeenOwnedByPlayer flag or something from gitlab back then... But I'm not into coding so i don't know what to do about it.Nevertheless, thanks for the answer. I've figured out a workaround anyway (ineffective though, only worked if there's a driver and player tries to jack it) But I would love to hear if there's a proper way to read/set this 'flag'. Edited April 12, 2016 by MKKJ Link to comment Share on other sites More sharing options...
Nick007J Posted April 12, 2016 Share Posted April 12, 2016 Check out CVehicle+0x42A & 2. If I am not mistaken, if this bit is set, player doesn't get wanted level for entering this vehicle, which is, as far as I understand, what you need. MKKJ and OrionSR 2 Link to comment Share on other sites More sharing options...
MKKJ Posted April 13, 2016 Author Share Posted April 13, 2016 (edited) Check out CVehicle+0x42A & 2. If I am not mistaken, if this bit is set, player doesn't get wanted level for entering this vehicle, which is, as far as I understand, what you need. Oh yeah, i tried it and looks like it also holds other flags as well, maybe like this +1066 1 = Visibly damaged 2 = Owned by player 32 = Player can move? Is there are another flag in this? Posibbly there's more but i guess i found what i need. Thanks. Edited April 13, 2016 by MKKJ Link to comment Share on other sites More sharing options...
OrionSR Posted April 13, 2016 Share Posted April 13, 2016 Did you find a direct association between opcode 0A17 and CVehicle+0x42A & 2? If no one has checked this flag on a vehicle created by a player owned car generator then perhaps I'll run a quick test just to be sure. Link to comment Share on other sites More sharing options...
MKKJ Posted April 13, 2016 Author Share Posted April 13, 2016 (edited) Seems like 0A17 sets this bit to its spawned vehicle. I tested it with Sweet's car generator - this bit is already set when i tried to enter it. And from main.scm this generator already flagged as player owned with 0A17. Edit: I also checked Ryder's Picador, cars in Wang Cars and Bike School 'gifts'. All of them have this bit already set on them and have 0A17 applied to their generator. Driving school 'gift' cars don't have 0A17 set at their generator and this 'player owner' bit is not set on them. Edited April 13, 2016 by MKKJ OrionSR 1 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