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

CJ is damaged when he is in the car.


Wesser
 Share

Recommended Posts

Hi,

This is an idea for "CJ is damaged when he beats with the car".

The code doesn't work when CJ is in a car.

Help me, please!!!

 

004F: create_thread ££DAMAGE_1:DAMAGE_103A4: name_thread "DAMAGE":DAMAGE_20001: wait  0 ms00D6: if  10256:   player $PLAYER_CHAR defined00DF:   actor $PLAYER_ACTOR driving004D: jump_if_false ££DAMAGE_203C0: @0 = actor $PLAYER_ACTOR car0226: @39 = actor $PLAYER_ACTOR health0227: @36 = car @0 health:DAMAGE_50085: @37 = @36;; integer values and handles0001: wait  0 ms00D6: if  10256:   player $PLAYER_CHAR defined8119:   NOT   car @0 wrecked004D: jump_if_false ££DAMAGE_700D6: if  000DB:   actor $PLAYER_ACTOR in_car @0004D: jump_if_false ££DAMAGE_700D6: if  08118:   NOT   actor $PLAYER_ACTOR dead004D: jump_if_false ££DAMAGE_500D6: if  003C9:   car @0 damaged004D: jump_if_false ££DAMAGE_5  000E: @36 -=  50;; integer values 0085: @38 = @37;; integer values and handles0062: @38 -= @36;; integer values 0066: @39 -= @38;; integer values:DAMAGE_701C3: remove_references_to_car @00002: jump ££DAMAGE_2

 

Edited by Wesser

012          345
678   9A   BCD
EFG HIJK LMN
OPQR  STUV
WX    YZ

Link to comment
Share on other sites

Your code shoulde be more like the following :

(I used your code as a basis although in Sanny Builder syntax this is untested and just a suggestion on an approach)

 

 

:DAMAGE_103A4: name_thread 'DAMAGE' :DAMAGE_20001: wait  200 ms00D6: if  10256:   is_player_playing $PLAYER_CHAR 00DF:   is_actor $PLAYER_ACTOR driving 004D: jump_if_false @DAMAGE_203C0: get_actor $PLAYER_ACTOR vehicle_handle_to [email protected] 0226: get_actor $PLAYER_ACTOR health_to [email protected] 0227: get_vehicle [email protected] health_to [email protected] :DAMAGE_50001: wait  100 ms00D6: if  10256:   is_player_playing $PLAYER_CHAR 8119:   not is_vehicle [email protected] dead 004D: jump_if_false @DAMAGE_700D6: if  000DF:   is_actor $PLAYER_ACTOR driving 004D: jump_if_false @DAMAGE_700D6: if  08118:   not is_actor $PLAYER_ACTOR dead 004D: jump_if_false @DAMAGE_50227: get_vehicle [email protected] health_to [email protected]: if  0802D:   not  [email protected] >= [email protected] // integer values 004D: jump_if_false @DAMAGE_5000C: [email protected] -= 15 // integer values 0223: set_actor $PLAYER_ACTOR health_to [email protected] :DAMAGE_701C3: mark_vehicle_as_no_longer_needed [email protected]: jump @DAMAGE_2

 

 

Not 100% sure on all the opcodes but i believe i have it pretty close

 

each time it loops if the health is lower in the second part than it was in the first part then the character recieves a little damage not very realistic but it could be better thought out and timed to seem more like it should be.

ph34r.gif

Edited by sleeper777
Link to comment
Share on other sites

Thanks a lot. I am working for the release.

012          345
678   9A   BCD
EFG HIJK LMN
OPQR  STUV
WX    YZ

Link to comment
Share on other sites

I have modified the line (000C) to make the most real script.

 

004F: create_thread ££DAMAGE_1:DAMAGE_103A4: name_thread 'DAMAGE':DAMAGE_20001: wait  200 ms00D6: if  10256:   player $PLAYER_CHAR defined00DF:   actor $PLAYER_ACTOR driving004D: jump_if_false ££DAMAGE_203C0: @0 = actor $PLAYER_ACTOR car0226: @9 = actor $PLAYER_ACTOR health0227: @6 = car @0 health:DAMAGE_50001: wait  100 ms00D6: if  10256:   player $PLAYER_CHAR defined8119:   NOT   car @0 wrecked004D: jump_if_false ££DAMAGE_700D6: if  000DF:   actor $PLAYER_ACTOR driving004D: jump_if_false ££DAMAGE_700D6: if  08118:   NOT   actor $PLAYER_ACTOR dead004D: jump_if_false ££DAMAGE_50227: @5 = car @0 health00D6: if  0802D:   NOT   @5 >= @6;; integer values004D: jump_if_false ££DAMAGE_5000C: [email protected] -= 5 // integer values <--- 15 to 50223: set_actor $PLAYER_ACTOR health_to @9:DAMAGE_701C3: remove_references_to_car @0;; Like turning a car into any random car0002: jump ££DAMAGE_2

 

I have tried to modify the script but I don't succeed in making a release. Help me, please!

Edited by Wesser

012          345
678   9A   BCD
EFG HIJK LMN
OPQR  STUV
WX    YZ

Link to comment
Share on other sites

you got caught in damage_5 loop. now it is just a hint. reverse you thinking for a moment and reconsider something like:

 

wait 250

all the checks needed in order to not allow the code to crash game (you do not need to 01C3 the car if you have not created it within this script)

get_car_health_to A

IF B>A hurt player

get_car_health_to B

jump at the begining

 

so it gets the reference B virtually 250ms in the past for present car health A. as more wait command you use in such a sniffer the more twisted the code becomes so actually reorganizing it a bit like that would be helpful.

 

 

Link to comment
Share on other sites

@PLPynton

 

Thanks for the restructure i hadn't thought it out 100% and just knew how i might approach but it seems your logic is a bit more efficient.

 

Peace:Shalom

ph34r.gif

Link to comment
Share on other sites

@PLPynton

 

I have tried but it doesn't work.

When CJ is in a car the life it goes down alone.

012          345
678   9A   BCD
EFG HIJK LMN
OPQR  STUV
WX    YZ

Link to comment
Share on other sites

Here is the code.

 

004F: create_thread ££DAMAGE_1:DAMAGE_103A4: name_thread 'DAMAGE':DAMAGE_20001: wait  200 ms00D6: if  10256:   player $PLAYER_CHAR defined00DF:   actor $PLAYER_ACTOR driving004D: jump_if_false ££DAMAGE_203C0: @0 = actor $PLAYER_ACTOR car0226: @9 = actor $PLAYER_ACTOR health0227: @6 = car @0 health:DAMAGE_50001: wait  100 ms00D6: if  100DF:   actor $PLAYER_ACTOR driving8118:   NOT   actor $PLAYER_ACTOR dead004D: jump_if_false ££DAMAGE_50227: @5 = car @0 health00D6: if  0801D:   NOT   @5 > @6 ;; integer values004D: jump_if_false ££DAMAGE_5000C: @9 -=  5 ;; integer values0223: set_actor $PLAYER_ACTOR health_to @90002: jump ££DAMAGE_2

 

012          345
678   9A   BCD
EFG HIJK LMN
OPQR  STUV
WX    YZ

Link to comment
Share on other sites

ectually that is the way i was talking about. PM me if there is something unclear and i will answer. btw. you can still use old method of decreasing health instead of 0851.

 

 

:DAMAGE_20001: wait  250 ms00D6: if  10256:   player $PLAYER_CHAR defined00DF:   actor $PLAYER_ACTOR driving004D: jump_if_false ££DAMAGE_203C0: @0 = actor $PLAYER_ACTOR car0227: @6 = car @0 health00D6: if  0001D:   @5 > @6;; integer values004D: jump_if_false ££DAMAGE_30851: set_actor $PLAYER_ACTOR decrease_health_by  5  flag  1 :DAMAGE_30227: @5 = car @0 health0002: jump ££DAMAGE_2

 

 

now you realize that it is not ready code right? you have to consider all the things that can happen ie.: you get out of the car and it received damage- you will get hurt when you board it again, you get teleported from car and another part of script puts you in another vehicle... well that is up to you now.

Edited by PLPynton
Link to comment
Share on other sites

 

 

 

Hi,

 

 

I like the idea, it is really realistic, and everyone around here knows that I like that.....

But don't you think that decreasing the same amoutn of health from the car to the player isn't very fair ? Well it is very easy to make it softer (50 health point off the car's health, 5 health point off the player's health), much easier than getting it to work, but I've no time to fix the thing, like making like PLPynton said last...

 

I got to say : People keep it up !!!!!!

 

 

Have fun

 

 

Link to comment
Share on other sites

I have tried but i didn't work ...

I entered into a car ... and immediately the screen is shaking like there is an explosion nearby ...

after a while the screen stable biggrin.gif

I get out of the car and get in again

it started shake again biggrin.gif

may be it got conflicted with my codings

but I haven't try ur latest code

Link to comment
Share on other sites

This is my coding for car lock and overspeeding check

the car will lock after you enter and unlock automatically when u get off

+ if u r overspeeding, u get one star

more overspeeding > two star

more and more overspeeding > three star

To unlock manutally while you are in a car, press HandBrake biggrin.gif

 


 

004f: create_thread ££labelcarpro

 

...

...

...

 

:Labelcarpro

0006: [email protected] = 0

03A4: name_thread "LockIT"

0006: [email protected] = 0

 

:Check

0001: wait 50 ms

00D6: if 0

0256: player $PLAYER_CHAR defined

004D: jump_if_false ££Check

00D6: if 0

0443: player $PLAYER_CHAR in_a_car

004D: jump_if_false ££Unlock

03C1: [email protected] = player $PLAYER_CHAR car

020A: set car [email protected] door_status_to 2

0006: [email protected] = 1

02E3: [email protected] = car [email protected] speed

00D6: if 0

0021: [email protected] > 20.0

004D: jump_if_false ££LockOpen

010E: set_player $PLAYER_CHAR minimum_wanted_level_to 1

00D6: if 0

0021: [email protected] > 25.0

004D: jump_if_false ££LockOpen

010E: set_player $PLAYER_CHAR minimum_wanted_level_to 2

00D6: if 0

0021: [email protected] > 35.0

004D: jump_if_false ££LockOpen

010E: set_player $PLAYER_CHAR minimum_wanted_level_to 3

 

:LockOpen

00D6: if 0

00E1: key_pressed 0 6

004D: jump_if_false ££Check

0039: [email protected] == 1

0002: jump ££Unlock

 

:Unlock

0001: wait 50 ms

00D6: if 0

0039: [email protected] == 1

004D: jump_if_false ££Check

00D6: if 0

8119: NOT car [email protected] wrecked

004D: jump_if_false ££Remove

020A: set car [email protected] door_status_to 1

0006: [email protected] = 0

01C3: remove_references_to_car [email protected]

0002: jump ££Check

 

:Remove

0001: wait 50 ms

01C3: remove_references_to_car [email protected]

0002: jump ££Check

Link to comment
Share on other sites

  • 2 weeks later...

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.