Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Cayo Perico Heist
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Red Dead Online

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

    1. Red Dead Redemption 2

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

    1. Grand Theft Auto Series

    2. GTA VI

      1. St. Andrews Cathedral
    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. Guides & Strategies
      2. Help & Support
    6. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    7. GTA III

      1. Guides & Strategies
      2. 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. 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
    3. Gangs

    1. Announcements

    2. Support

    3. Suggestions

A little question


marty_1985

Recommended Posts

Something like this:

EDIT: i'll put it in Codes

 

 

:Label0811: $Playercar = actor $PLAYER_ACTOR car02E3: $Carspeed = car $Playercar speed:Labelcheckif 0$Carspeed == 88jf ££Labelcheck;========;activation;========

 

Link to post
Share on other sites
LOT of stuff missing. Also you would want a greater than equal check. Not to mention that 02E3 captures a float.
Link to post
Share on other sites

Untested, but should work...

 

004F: create_thread ££DrivingCheck:DrivingCheck0001: wait 50 ms00D6: if 000E0:   player $PLAYER_CHAR driving004D: jump_if_false ££DrivingCheck03C1: $PlayerCar = player $PLAYER_CHAR car;; gets the player car:SpeedCheck02E3: $Speed = car $PlayerCar speed;; gets the car's speed as a float0001: wait 250 ms00D6: if 00030:   $Speed >= 40.0;; floating-point values004D: jump_if_false ££SpeedCheck----do stuff here--------jump to wherever when finished----

 

 

Max speed is 50.0, so you'll have to figure out a way to get your "88" speed converted to something the game can recognize. I used 40.0 beacuse that's pretty fast, but not the max speed. 30.0 to 35.0 might be even closer.

 

You MAY want to put a check in to see if a player is defined, but if the player is in a car, it's a pretty safe bet that that player is defined.

 

Check out the Love Fist mission "Publicity Tour" for a good example of this...

 

Have fun! colgate.gif

Edited by ceedj
Link to post
Share on other sites
Quadropheniac90
@ceedj: You should place waits in front of the '00D6: if 0', it jumps back to itself when it's false, and then it needs a wait, or it'll crash. wink.gif
Link to post
Share on other sites
@ceedj: You should place waits in front of the '00D6: if 0', it jumps back to itself when it's false, and then it needs a wait, or it'll crash. wink.gif

Ack, you're right. Been coding in C++ for a while now; most of the if's I use in that do not need the waits.

 

Thanks for the heads up; post edited.

Link to post
Share on other sites
You MAY want to put a check in to see if a player is defined, but if the player is in a car, it's a pretty safe bet that that player is defined.

If player is not defined, using a check like "if player driving" risks crashing the engine by referencing that doesn't exist. Never seen it happen, but is good coding. Just pointing out the REASON why it's used instead of encouraging others to cross their fingers.

Link to post
Share on other sites
You MAY want to put a check in to see if a player is defined, but if the player is in a car, it's a pretty safe bet that that player is defined.

If player is not defined, using a check like "if player driving" risks crashing the engine by referencing that doesn't exist. Never seen it happen, but is good coding. Just pointing out the REASON why it's used instead of encouraging others to cross their fingers.

You are correct. It IS good coding. I've just never had a need for checking to see if my player is defined, so I've never used it.

Link to post
Share on other sites
random_download

 

00D6: if 00030:   $Speed >= 40.0;; floating-point values004D: jump_if_false ££SpeedCheck

 

Here you should probably jump to label :DrivingCheck as if the player gets out of the car before reaching the speed, the code will continue to loop, and possibly crash if the car gets destroyed.

Link to post
Share on other sites

Yes and no. The code as it sits would not benefit from jumping back. Also, I think the timings are backwards. Should look more like (in MB 0.22)

:LabelMYMOD03A4: name_thread "88MPH":LabelMYMOD10001: wait 250& ms00D6: if  0?0256:   player $PLAYER_CHAR defined004D: jump_if_false ££LabelMYMOD100D6: if 000E0:   player $PLAYER_CHAR driving004D: jump_if_false ££LabelMYMOD103C1:  [email protected] = player $PLAYER_CHAR car;; gets the player car:LabelMYMOD20001: wait 50? ms00D6: if  1?0256:   player $PLAYER_CHAR defined0119:   NOT   car  [email protected] wrecked004D: jump_if_false ££LabelMYMOD300D6: if  0?0442:   player $PLAYER_CHAR in_car  [email protected]: jump_if_false £LabelMYMOD302E3:  [email protected] = car  [email protected] speed00D6: if 00031:    [email protected] >= 40.0;; floating-point values004D: jump_if_false ££LabelMYMOD2;----- stuff you want done when target speed is reached:LabelMYMOD301C3: remove_references_to_car  [email protected]: jump ££LabelMYMOD1

 

 

Note that as before, the author is reponsible for clearing the car out of memory and either terminating the thread or having it jump back after the appropriate conditions are met. As always, watched for infinite loops!

 

[EDIT]

The timings were missing datatypes and the is not wrecked check wasn't in the best if.

Edited by Demarest
Link to post
Share on other sites
damian001

marty_1985, while reading your username and your question, you also sound like a back to the future fan smile.gif as well as I am

 

there is a mod somewhere here called Vice City XXL. It has a delorean that when you hit 88 mph, it shows a COOL time travel effect (looks just like from the movie) and you respawn somewhere else and in a different time smile.gif

 

try to find it!

Link to post
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
  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.