Wesser Posted February 22, 2007 Share Posted February 22, 2007 (edited) 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 February 25, 2007 by Wesser Link to comment https://gtaforums.com/topic/267917-cj-is-damaged-when-he-is-in-the-car/ Share on other sites More sharing options...
space_einstein Posted February 23, 2007 Share Posted February 23, 2007 I don't see where CJ can be damaged in that code. Link to comment https://gtaforums.com/topic/267917-cj-is-damaged-when-he-is-in-the-car/#findComment-4065037 Share on other sites More sharing options...
sleeper777 Posted February 23, 2007 Share Posted February 23, 2007 (edited) 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 0@ 0226: get_actor $PLAYER_ACTOR health_to 9@ 0227: get_vehicle 0@ health_to 6@ :DAMAGE_50001: wait 100 ms00D6: if 10256: is_player_playing $PLAYER_CHAR 8119: not is_vehicle 0@ 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 0@ health_to 5@00D6: if 0802D: not 5@ >= 6@ // integer values 004D: jump_if_false @DAMAGE_5000C: 9@ -= 15 // integer values 0223: set_actor $PLAYER_ACTOR health_to 9@ :DAMAGE_701C3: mark_vehicle_as_no_longer_needed 0@0002: 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. Edited February 23, 2007 by sleeper777 Link to comment https://gtaforums.com/topic/267917-cj-is-damaged-when-he-is-in-the-car/#findComment-4065503 Share on other sites More sharing options...
Wesser Posted February 23, 2007 Author Share Posted February 23, 2007 Thanks a lot. I am working for the release. Link to comment https://gtaforums.com/topic/267917-cj-is-damaged-when-he-is-in-the-car/#findComment-4065799 Share on other sites More sharing options...
Wesser Posted February 24, 2007 Author Share Posted February 24, 2007 (edited) 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: 9@ -= 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 February 25, 2007 by Wesser Link to comment https://gtaforums.com/topic/267917-cj-is-damaged-when-he-is-in-the-car/#findComment-4067962 Share on other sites More sharing options...
PLPynton Posted February 24, 2007 Share Posted February 24, 2007 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 https://gtaforums.com/topic/267917-cj-is-damaged-when-he-is-in-the-car/#findComment-4068172 Share on other sites More sharing options...
sleeper777 Posted February 25, 2007 Share Posted February 25, 2007 @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 Link to comment https://gtaforums.com/topic/267917-cj-is-damaged-when-he-is-in-the-car/#findComment-4068293 Share on other sites More sharing options...
Wesser Posted February 25, 2007 Author Share Posted February 25, 2007 @PLPynton I have tried but it doesn't work. When CJ is in a car the life it goes down alone. Link to comment https://gtaforums.com/topic/267917-cj-is-damaged-when-he-is-in-the-car/#findComment-4068806 Share on other sites More sharing options...
PLPynton Posted February 25, 2007 Share Posted February 25, 2007 post the code then please. Link to comment https://gtaforums.com/topic/267917-cj-is-damaged-when-he-is-in-the-car/#findComment-4069023 Share on other sites More sharing options...
Wesser Posted February 25, 2007 Author Share Posted February 25, 2007 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 Link to comment https://gtaforums.com/topic/267917-cj-is-damaged-when-he-is-in-the-car/#findComment-4069097 Share on other sites More sharing options...
PLPynton Posted February 25, 2007 Share Posted February 25, 2007 (edited) 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 February 25, 2007 by PLPynton Link to comment https://gtaforums.com/topic/267917-cj-is-damaged-when-he-is-in-the-car/#findComment-4069279 Share on other sites More sharing options...
tomworld10 Posted February 28, 2007 Share Posted February 28, 2007 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 https://gtaforums.com/topic/267917-cj-is-damaged-when-he-is-in-the-car/#findComment-4073570 Share on other sites More sharing options...
PLPynton Posted March 1, 2007 Share Posted March 1, 2007 (edited) peoples you've got to see this. the most stupid mod i've ever did for SA Movie 1 download (3.5MB) Movie 2 download (1.5MB) DivX codec required. Edit: ok not that stupid i guess. i am gonna add airbags for more fun. Edited March 1, 2007 by PLPynton Link to comment https://gtaforums.com/topic/267917-cj-is-damaged-when-he-is-in-the-car/#findComment-4074766 Share on other sites More sharing options...
Yoskl Posted March 4, 2007 Share Posted March 4, 2007 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 I get out of the car and get in again it started shake again may be it got conflicted with my codings but I haven't try ur latest code Link to comment https://gtaforums.com/topic/267917-cj-is-damaged-when-he-is-in-the-car/#findComment-4078724 Share on other sites More sharing options...
Yoskl Posted March 4, 2007 Share Posted March 4, 2007 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 004f: create_thread ££labelcarpro ... ... ... :Labelcarpro 0006: 3@ = 0 03A4: name_thread "LockIT" 0006: 16@ = 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: 4@ = player $PLAYER_CHAR car 020A: set car 4@ door_status_to 2 0006: 3@ = 1 02E3: 5@ = car 4@ speed 00D6: if 0 0021: 5@ > 20.0 004D: jump_if_false ££LockOpen 010E: set_player $PLAYER_CHAR minimum_wanted_level_to 1 00D6: if 0 0021: 5@ > 25.0 004D: jump_if_false ££LockOpen 010E: set_player $PLAYER_CHAR minimum_wanted_level_to 2 00D6: if 0 0021: 5@ > 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: 3@ == 1 0002: jump ££Unlock :Unlock 0001: wait 50 ms 00D6: if 0 0039: 3@ == 1 004D: jump_if_false ££Check 00D6: if 0 8119: NOT car 4@ wrecked 004D: jump_if_false ££Remove 020A: set car 4@ door_status_to 1 0006: 3@ = 0 01C3: remove_references_to_car 4@ 0002: jump ££Check :Remove 0001: wait 50 ms 01C3: remove_references_to_car 4@ 0002: jump ££Check Link to comment https://gtaforums.com/topic/267917-cj-is-damaged-when-he-is-in-the-car/#findComment-4078731 Share on other sites More sharing options...
Covernant Posted March 4, 2007 Share Posted March 4, 2007 I have a similar over speeding thingy ;D But not so cruel Link to comment https://gtaforums.com/topic/267917-cj-is-damaged-when-he-is-in-the-car/#findComment-4078953 Share on other sites More sharing options...
Azgher Posted March 15, 2007 Share Posted March 15, 2007 what main.smc line put this??? Link to comment https://gtaforums.com/topic/267917-cj-is-damaged-when-he-is-in-the-car/#findComment-4097117 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