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!

Is CJ in the car


hmvartak
 Share

Recommended Posts

Can someone tell me, how to check if CJ is in the car or not. I want to disable blue marker above car when CJ enters in that car.

In opcode list I found this one,

00DB:actor $PLAYER_ACTOR in_car [email protected]

It is asking for car handle which is stored in local variable, where my car handle is stored in global variable. Can I create car handle in local variable? If yes, How? what is the opcode? and if no, then my question is why do we need to create car handle in global variable even if we are not going to use it outside that mission? or is there any way to check that condition?

I tried to put global variable in 00DB code. Sanny Builder is not showing me any compilation error but that code isn't working.

My code is

 

:CML0001: wait 0 0247: request_model #PATRIOT 038B: load_requested_models 00D6: if and  0248: model #PATRIOT available 004D: jump_if_false @CML 00a5:$mycar = create_car #PATRIOT at 2436.018 -1660.946 13.37673 :MARKwait 0 ms0186:$mymark = create_marker_above_car $mycar07E0:set_marker $mymark type_to 1if00DB:actor $PLAYER_ACTOR in_car $mycarjf @MARK0164:disable_marker $mymark:spherewait 0 msif 00FE: actor $PLAYER_ACTOR 1 near_point_3d 2359.875 -1658.351 13.38281 radius 5.0 5.0 6.0 jf @sphere

 

 

 

Please, someone improve this code.

 

Link to comment
Share on other sites

Can someone tell me, how to check if CJ is in the car or not. I want to disable blue marker above car when CJ enters in that car.

In opcode list I found this one,

00DB:actor $PLAYER_ACTOR in_car [email protected]

It is asking for car handle which is stored in local variable, where my car handle is stored in global variable. Can I create car handle in local variable? If yes, How? what is the opcode? and if no, then my question is why do we need to create car handle in global variable even if we are not going to use it outside that mission? or is there any way to check that condition?

I tried to put global variable in 00DB code. Sanny Builder is not showing me any compilation error but that code isn't working.

My code is

 

:CML0001: wait 0 0247: request_model #PATRIOT 038B: load_requested_models 00D6: if and  0248: model #PATRIOT available 004D: jump_if_false @CML 00a5:$mycar = create_car #PATRIOT at 2436.018 -1660.946 13.37673 :MARKwait 0 ms0186:$mymark = create_marker_above_car $mycar07E0:set_marker $mymark type_to 1if00DB:actor $PLAYER_ACTOR in_car $mycarjf @MARK0164:disable_marker $mymark:spherewait 0 msif 00FE: actor $PLAYER_ACTOR 1 near_point_3d 2359.875 -1658.351 13.38281 radius 5.0 5.0 6.0 jf @sphere

 

 

 

Please, someone improve this code.

Just at first glimpse..

 

:CML00a5:$mycar = create_car #PATRIOT at 2436.018 -1660.946 13.37673 0186:$mymark = create_marker_above_car $mycar07E0:set_marker $mymark type_to 1:MARK         //No need to create a marker everyframe.. Crash garantee..wait 0 msif00DB:actor $PLAYER_ACTOR in_car $mycarjf @MARK0164:disable_marker $mymark

 

 

Haven't tested it tho..

Link to comment
Share on other sites

Only math and set opcodes require distinction between local and global vars. No other opcodes have different versions for that and most can be used with both locals or globals.

Link to comment
Share on other sites

 

Just at first glimpse..

 

:CML00a5:$mycar = create_car #PATRIOT at 2436.018 -1660.946 13.37673 0186:$mymark = create_marker_above_car $mycar07E0:set_marker $mymark type_to 1:MARK         //No need to create a marker everyframe.. Crash garantee..wait 0 msif00DB:actor $PLAYER_ACTOR in_car $mycarjf @MARK0164:disable_marker $mymark

 

 

Haven't tested it tho..

I have tested similar code before posting to this forum. That code works only once. Then it permanently disables the marker. Marker must appear whenever you are out of the car and must be disabled whenever you are in the car. That's why I tried to make marker in a loop.

 

Link to comment
Share on other sites

Code it like this.. not tested, but you'll get the idea.

 

0247: request_model #PATRIOT038B: load_requested_models:CML0001: wait 000D6: if 0248: model #PATRIOT available004D: jump_if_false @CML00a5:$mycar = create_car #PATRIOT at 2436.018 -1660.946 13.37673$my_mark_flag = 0   // 1 means the marker is visible:loopwait 0 msif00DB:actor $PLAYER_ACTOR in_car $mycarjf @MARKif $my_mark_flag == 1jf @sphere0164:disable_marker $mymark$my_mark_flag = 0jump @sphere:MARKif $my_mark_flag == 0jf @sphere0186:$mymark = create_marker_above_car $mycar07E0:set_marker $mymark type_to 1$my_mark_flag = 1:sphereif00FE: actor $PLAYER_ACTOR 1 near_point_3d 2359.875 -1658.351 13.38281 radius 5.0 5.0 6.0jf @loop

 

bS8xA.png
Link to comment
Share on other sites

 

Code it like this.. not tested, but you'll get the idea.

 

0247: request_model #PATRIOT038B: load_requested_models:CML0001: wait 000D6: if 0248: model #PATRIOT available004D: jump_if_false @CML00a5:$mycar = create_car #PATRIOT at 2436.018 -1660.946 13.37673$my_mark_flag = 0   // 1 means the marker is visible:loopwait 0 msif00DB:actor $PLAYER_ACTOR in_car $mycarjf @MARKif $my_mark_flag == 1jf @sphere0164:disable_marker $mymark$my_mark_flag = 0jump @sphere:MARKif $my_mark_flag == 0jf @sphere0186:$mymark = create_marker_above_car $mycar07E0:set_marker $mymark type_to 1$my_mark_flag = 1:sphereif00FE: actor $PLAYER_ACTOR 1 near_point_3d 2359.875 -1658.351 13.38281 radius 5.0 5.0 6.0jf @loop

 

Your code is working nicely. Actually I wanted to disable sphere while marker is appearing and vice versa. This lets you to enter the sphere through your vehicle only.

 

Your code works very well when I enter the sphere through the car. But when I do it on foot, my mission gets passed but marker on car remain intact. Some improvement is needed in the code that I thonk I can do.

 

Thanks for your help!

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