Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      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

*DO NOT* SHARE MEDIA OR LINKS TO LEAKED COPYRIGHTED MATERIAL. Discussion is allowed.

Get a gang member on a boat


AlexTMjugador
 Share

Recommended Posts

AlexTMjugador

Hi! biggrin.gif

 

I'm modifing a mod made by me, adding the ability to use boats (see the mod page at GTAGarage for see what does my mod), but I can't get the handle of the gang member on the boat.

 

In first place, I used regular "passenger" opcodes, but they obviously didn't work.

 

Then tried using spheres, but they didn't work because, in most boats, the driver seat it's not at the same Z level when the gang member is. I also tried with 092B, but it didn't work (I don't know if when you get the number of the members in a group the leader counts or not, and, if I use that method, I have to check if is near the player actor, but with that I can't ensure if the gang member is on the boat).

 

I did a search in the forum, but I found nothing that could help me.

 

So, please, can anyone help me? I will be grateful for your help colgate.gif

Edited by AlexTMjugador
Link to comment
Share on other sites

 

Hi!  biggrin.gif

 

I'm modifing a mod made by me, adding the ability to use boats (see the mod page at GTAGarage for see what does my mod), but I can't get the handle of the gang member on the boat.

 

In first place, I used regular "passenger" opcodes, but they obviously didn't work.

 

Then tried using spheres, but they didn't work because, in most boats, the driver seat it's not at the same Z level when the gang member is. I also tried with 092B, but it didn't work (I don't know if when you get the number of the members in a group the leader counts or not, and, if I use that method, I have to check if is near the player actor, but with that I can't ensure if the gang member is on the boat).

 

I did a search in the forum, but I found nothing that could help me.

 

So, please, can anyone help me? I will be grateful for your help  colgate.gif

Why can't you use the 'Homies' handle?

 

Neat mod btw. icon14.gifcookie.gif

Link to comment
Share on other sites

AlexTMjugador

Thanks for your response smile.gif

 

Because with that handle I can't ensure that he's on the boat, and you can use the mod if he is a mile away then dontgetit.gif

 

And I'm not sure how to get that "member ID handle", because, like I said, I don't know if when you get a group X member handle the member number counts for the leader too (for example, if the leader is the member 1, other member will be 2, but if the leader doesn't count the other member ID will be 1). I searched the opcode in the GTA Gaming opcode database but it doesn't explain it very well.

 

If it helps, here is my code (it's in Sanny Builder syntax) smile.gif :

 

// Before this there is a player check and all that:SWITCH_3973wait 0 07AF: $PLAYER_GROUP = player $PLAYER_CHAR group if 07FD:   group $PLAYER_GROUP alive else_jump @SWITCH_3899 07F6: get_group $PLAYER_GROUP number_of_leaders_to [email protected] number_of_members_to [email protected] // Here I'm not sure how does the opcode workif  [email protected] == 2 else_jump @SWITCH_3899 092B: [email protected] = group $PLAYER_GROUP member 2 // Here I'm not sure how does the opcode workif   Actor.Defined([email protected])else_jump @SWITCH_3899 if 00F3:   actor [email protected] near_actor $PLAYER_ACTOR radius 10.0 10.0 sphere 0 on_foot else_jump @SWITCH_3899 if or  Actor.Model([email protected]) == #FAM1  Actor.Model([email protected]) == #FAM2  Actor.Model([email protected]) == #FAM3  Actor.Model([email protected]) == 265 // This is because there are mods that add gang members  Actor.Model([email protected]) == 266 // This is because there are mods that add gang memberselse_jump @SWITCH_3899 if 0AB0:   key_pressed 9 else_jump @SWITCH_3899 03C0: [email protected] = actor $PLAYER_ACTOR car 0AB6: store_target_marker_coords_to [email protected] [email protected] [email protected] // IF and SET if and  not [email protected] == 0.0   not [email protected] == 0.0   not [email protected] == 0.0 else_jump @SWITCH_2424 Player.CanMove($PLAYER_CHAR) = Falsefade 0 500 :SWITCH_4224wait 0 if   not fading else_jump @SWITCH_4224 Car.SetSpeedInstantly([email protected], 0.0)068B: set_car [email protected] all_disembark 0430: put_actor $PLAYER_ACTOR into_car [email protected] passenger_seat 0 07AF: $PLAYER_GROUP = player $PLAYER_CHAR group if 07FD:   group $PLAYER_GROUP alive else_jump @SWITCH_4297 07B3: set_group $PLAYER_GROUP give_command 2 :SWITCH_4297072A: put_actor [email protected] into_car [email protected] driverseat 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset 0.5 -0.75 0.0 Actor.PutAt($PLAYER_ACTOR, [email protected], [email protected], [email protected]) // Here I try to emulate that he's on the passenger seat, like when a homie is on the boat to follow youwait 1000 fade 1 500 ...

 

 

Edited by AlexTMjugador
Link to comment
Share on other sites

Did you try using passenger pointers from the SA mem address documentation. I'm using them right now and I managed to get a handle of any passanger in any car, something like this:

 

0A97: [email protected] = car [email protected] struct000A: [email protected] += 0x464 // passenger0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 00AEA: [email protected] = actor_struct [email protected] handle

 

I don't have SA installed at the moment. Is that gang member a passenger or a driver? There's a driver pointer too.

 

 

Link to comment
Share on other sites

 

And I'm not sure how to get that "member ID handle", because, like I said, I don't know if when you get a group X member handle the member number counts for the leader too (for example, if the leader is the member 1, other member will be 2, but if the leader doesn't count the other member ID will be 1). I searched the opcode in the GTA Gaming opcode database but it doesn't explain it very well.

get "gangmember ID handle":

max. 7 possible gangmember can be available

so you have to check if member 0,1,2,3,4,5,6 exist

check if they are defined as actor and not dead

it makes sense to use arrays otherwise you'll have a lot of work with lot of code

 

:Beginningwait [email protected] = 007AF: [email protected] = player $PLAYER_CHAR group 092B: [email protected] = group [email protected] member 0 092B: [email protected] = group [email protected] member 1 092B: [email protected] = group [email protected] member 2 092B: [email protected] = group [email protected] member 3 092B: [email protected] = group [email protected] member 4 092B: [email protected] = group [email protected] member 5 092B: [email protected] = group [email protected] member 6:Array_Loopwait [email protected] > 7jf @Refresh if 056D:   actor [email protected]([email protected],7i) defined jf @Skip_1 if 8118:   not actor [email protected]([email protected],7i) dead jf @Skip_1if04A7:   actor [email protected]([email protected],7i) driving_boatjf @Skip_1// gangmember which drives boat was found0633: AS_actor [email protected]([email protected],7i) exit_car //here can you do now somthing with the gangmemberjump @Refresh:Skip_1 [email protected] += 1jump @Array_Loop:Refresh [email protected] = 0:cleanupwait [email protected] > 7jf @Beginning if 056D:   actor [email protected]([email protected],7i) defined jf @Skip_201C2: remove_references_to_actor [email protected]([email protected],7i):Skip_2 [email protected] += 1jump @cleanup

 

 

if you're not able to use arrays, then read here about arrays

or do it in the detailed way to do the checks with each possible actor handle

 

:Loopwait 0if 056D:   actor [email protected] defined jf @Step_1 if 8118:   not actor [email protected] dead jf @Step_1if04A7:   actor [email protected] driving_boatjf @Step_1// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh:Step_1if 056D:   actor [email protected] defined jf @Step_2 if 8118:   not actor [email protected] dead jf @Step_2if04A7:   actor [email protected] driving_boatjf @Step_2// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh:Step_2if 056D:   actor [email protected] defined jf @Step_3 if 8118:   not actor [email protected] dead jf @Step_3if04A7:   actor [email protected] driving_boatjf @Step_3// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh:Step_3if 056D:   actor [email protected] defined jf @Step_4 if 8118:   not actor [email protected] dead jf @Step_4if04A7:   actor [email protected] driving_boatjf @Step_4// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh:Step_4if 056D:   actor [email protected] defined jf @Step_5 if 8118:   not actor [email protected] dead jf @Step_5if04A7:   actor [email protected] driving_boatjf @Step_5// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh:Step_5if 056D:   actor [email protected] defined jf @Step_6 if 8118:   not actor [email protected] dead jf @Step_6if04A7:   actor [email protected] driving_boatjf @Step_6// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh:Step_6if 056D:   actor [email protected] defined jf @Step_7 if 8118:   not actor [email protected] dead jf @Step_7if04A7:   actor [email protected] driving_boatjf @Step_7// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh

 

 

A smoother kind of an array loop and maybe more clear, is the "for-to-Loop" (a high level method)

 

for [email protected] = 0 to 6   if    056D:   actor [email protected]([email protected],7i) defined    then        if        8118:   not actor [email protected]([email protected],7i) dead        then           if           04A7:   actor [email protected]([email protected],7i) driving_boat           then               jump @actor_found           end       end   endendjump @no_actor_found:actor_found// gangmember which drives boat was found0633: AS_actor [email protected]([email protected],7i) exit_car //here can you do now somthing with the gangmember:no_actor_found

 

 

Link to comment
Share on other sites

AlexTMjugador

 

Did you try using passenger pointers from the SA mem address documentation. I'm using them right now and I managed to get a handle of any passanger in any car, something like this:

 

0A97: [email protected] = car [email protected] struct000A: [email protected] += 0x464 // passenger0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 00AEA: [email protected] = actor_struct [email protected] handle

 

I don't have SA installed at the moment. Is that gang member a passenger or a driver? There's a driver pointer too.

I'm not sure. It seems to be on turret mode, because if I try to put him somewhere he stays on the boat unless I remove him from turret mode.

Also, if I put him in a passenger seat he's invisible but his shadow is still visible under the boat.

Edited by AlexTMjugador
Link to comment
Share on other sites

AlexTMjugador

 

And I'm not sure how to get that "member ID handle", because, like I said, I don't know if when you get a group X member handle the member number counts for the leader too (for example, if the leader is the member 1, other member will be 2, but if the leader doesn't count the other member ID will be 1). I searched the opcode in the GTA Gaming opcode database but it doesn't explain it very well.

get "gangmember ID handle":

max. 7 possible gangmember can be available

so you have to check if member 0,1,2,3,4,5,6 exist

check if they are defined as actor and not dead

it makes sense to use arrays otherwise you'll have a lot of work with lot of code

 

:Beginningwait [email protected] = 007AF: [email protected] = player $PLAYER_CHAR group 092B: [email protected] = group [email protected] member 0 092B: [email protected] = group [email protected] member 1 092B: [email protected] = group [email protected] member 2 092B: [email protected] = group [email protected] member 3 092B: [email protected] = group [email protected] member 4 092B: [email protected] = group [email protected] member 5 092B: [email protected] = group [email protected] member 6:Array_Loopwait [email protected] > 7jf @Refresh if 056D:   actor [email protected]([email protected],7i) defined jf @Skip_1 if 8118:   not actor [email protected]([email protected],7i) dead jf @Skip_1if04A7:   actor [email protected]([email protected],7i) driving_boatjf @Skip_1// gangmember which drives boat was found0633: AS_actor [email protected]([email protected],7i) exit_car //here can you do now somthing with the gangmemberjump @Refresh:Skip_1 [email protected] += 1jump @Array_Loop:Refresh [email protected] = 0:cleanupwait [email protected] > 7jf @Beginning if 056D:   actor [email protected]([email protected],7i) defined jf @Skip_201C2: remove_references_to_actor [email protected]([email protected],7i):Skip_2 [email protected] += 1jump @cleanup

 

 

if you're not able to use arrays, then read here about arrays

or do it in the detailed way to do the checks with each possible actor handle

 

:Loopwait 0if 056D:   actor [email protected] defined jf @Step_1 if 8118:   not actor [email protected] dead jf @Step_1if04A7:   actor [email protected] driving_boatjf @Step_1// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh:Step_1if 056D:   actor [email protected] defined jf @Step_2 if 8118:   not actor [email protected] dead jf @Step_2if04A7:   actor [email protected] driving_boatjf @Step_2// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh:Step_2if 056D:   actor [email protected] defined jf @Step_3 if 8118:   not actor [email protected] dead jf @Step_3if04A7:   actor [email protected] driving_boatjf @Step_3// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh:Step_3if 056D:   actor [email protected] defined jf @Step_4 if 8118:   not actor [email protected] dead jf @Step_4if04A7:   actor [email protected] driving_boatjf @Step_4// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh:Step_4if 056D:   actor [email protected] defined jf @Step_5 if 8118:   not actor [email protected] dead jf @Step_5if04A7:   actor [email protected] driving_boatjf @Step_5// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh:Step_5if 056D:   actor [email protected] defined jf @Step_6 if 8118:   not actor [email protected] dead jf @Step_6if04A7:   actor [email protected] driving_boatjf @Step_6// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh:Step_6if 056D:   actor [email protected] defined jf @Step_7 if 8118:   not actor [email protected] dead jf @Step_7if04A7:   actor [email protected] driving_boatjf @Step_7// gangmember which drives boat was found0633: AS_actor [email protected] exit_car //here can you do now somthing with the gangmemberjump @Refresh

 

 

A smoother kind of an array loop and maybe more clear, is the "for-to-Loop" (a high level method)

 

for [email protected] = 0 to 6   if    056D:   actor [email protected]([email protected],7i) defined    then        if        8118:   not actor [email protected]([email protected],7i) dead        then           if           04A7:   actor [email protected]([email protected],7i) driving_boat           then               jump @actor_found           end       end   endendjump @no_actor_found:actor_found// gangmember which drives boat was found0633: AS_actor [email protected]([email protected],7i) exit_car //here can you do now somthing with the gangmember:no_actor_found

 

Thank you very much, ZAZ smile.gif

You solved all my questions, like always, but he doesn't drive the boat, he seems to be on turret mode on it wink.gif

Sorry for my bad english dontgetit.gif

Edited by AlexTMjugador
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.