Sep 20 2011, 03:18 AM Post #1 | |
I will kill you Posts: 126 Joined: 13-May 11 | With this mod u can control the nitro boosts from your car. Download Source: SANNY {$CLEO} 0000: NITRO!!!! while true wait 100 if and 00DF: actor $PLAYER_ACTOR driving 00E1: player 0 pressed_key 17 // Fire/Nitro jf continue 03C0: 1@ = actor $PLAYER_ACTOR car 096D: get_car 1@ component_on_slot 8 model_to 2@ if and 2@ <> #NTO_B_S 2@ <> #NTO_B_L 2@ <> #NTO_B_TW then wait 0 01C3: remove_references_to_car 1@ jump -2 end 0A97: 0@ = car 1@ struct 0A8E: 2@ = 0@ + 0x8A4 0A8E: 3@ = 0@ + 0x48A 0A8D: 4@ = read_memory 2@ size 4 virtual_protect 0 0A8D: 5@ = read_memory 3@ size 1 virtual_protect 0 if 5@ == 0 then 4@ <> 1.0 jf continue end while true wait 100 while 00E1: player 0 pressed_key 17 // Fire/Nitro wait 0 if 856E: not car 1@ defined then 01C3: remove_references_to_car 1@ jump -2 else 80DB: not actor $PLAYER_ACTOR in_car 1@ jf continue 01C3: remove_references_to_car 1@ jump -2 end end 0A8D: 5@ = read_memory 3@ size 1 virtual_protect 0 5@ += 1 0A8C: write_memory 2@ size 4 value 1.0 virtual_protect 0 0A8C: write_memory 3@ size 1 value 5@ virtual_protect 0 while 80E1: not player 0 pressed_key 17 // Fire/Nitro wait 0 if 856E: not car 1@ defined then 01C3: remove_references_to_car 1@ jump -2 else 80DB: not actor $PLAYER_ACTOR in_car 1@ jf continue 01C3: remove_references_to_car 1@ jump -2 end end end end hex "LINK/2012" end |
Sep 20 2011, 09:54 AM Post #2 | |
Actually living entity Posts: 143 From: Earth Joined: 15-January 11 | Yay, no more nitro.dll which prevents other ASIs and DLLs to load/work correctly! I've just decided yesterday that I wont use nitro.dll anymore as it makes UltraThing being unable to show car reflections and other stuff.. Your script comes just in time Great, thanks.. But, is it necessary to leave Standard Nitro usable? I would like to still be able to use the Primary Fire Button for something else. Could I be able to edit it for myself so that only Controllable Nitro Boost is used (i may not ask if i would know these memory addresses), or is the 'Two Nitros' a workaround? -------------------- |
Sep 20 2011, 07:58 PM Post #3 | |
Coding like a Rockstar! Posts: 1,468 From: ??? Joined: 28-May 09 | Allow me to suggest a more R*-ish, optimised and possibly safer code. Although your code is pretty good anyway. It's mainly the two while loops which could have a small flaw. SANNY {$CLEO} 0000: NITRO!!!! while true wait 100 if and 00DF: actor $PLAYER_ACTOR driving 00E1: player 0 pressed_key 17 // Fire/Nitro jf continue 03C0: 1@ = actor $PLAYER_ACTOR car 096D: get_car 1@ component_on_slot 8 model_to 2@ if and 2@ <> #NTO_B_S 2@ <> #NTO_B_L 2@ <> #NTO_B_TW then wait 0 jump @Cleanup end 0A97: 0@ = car 1@ struct 0A8E: 2@ = 0@ + 0x8A4 0A8E: 3@ = 0@ + 0x48A 0A8D: 4@ = read_memory 2@ size 4 virtual_protect 0 0A8D: 5@ = read_memory 3@ size 1 virtual_protect 0 if 5@ == 0 then 4@ <> 1.0 jf continue end while true wait 100 while 00E1: player 0 pressed_key 17 // Fire/Nitro wait 0 8119: not car 1@ wrecked // doubles as an 'if exists' check jf @Cleanup 00DB: actor $PLAYER_ACTOR in_car 1@ jf @Cleanup end 0A8D: 5@ = read_memory 3@ size 1 virtual_protect 0 5@ += 1 0A8C: write_memory 2@ size 4 value 1.0 virtual_protect 0 0A8C: write_memory 3@ size 1 value 5@ virtual_protect 0 while 80E1: not player 0 pressed_key 17 // Fire/Nitro wait 0 8119: not car 1@ wrecked // doubles as an 'if exists' check jf @Cleanup 00DB: actor $PLAYER_ACTOR in_car 1@ jf @Cleanup end end end :Cleanup // save a few bytes here and there 01C3: remove_references_to_car 1@ // can always run safely jump -2 hex "LINK/2012" end Tired of labels? -------------------- | CLEO 4.3.22 | A?i?a?o?3D | UI SDK | Black Market Mod 1.0.1 | GInput 0.3 | Cheat Keyboard | Tactile Cheat Activation | Stream Ini Extender 0.7 | SuperVars | ScrDebug | Vigilante Justice: San Andreas | |
Sep 20 2011, 10:22 PM Post #4 | |
I will kill you Posts: 126 Joined: 13-May 11 | But, is it necessary to leave Standard Nitro usable? I would like to still be able to use the Primary Fire Button for something else. Could I be able to edit it for myself so that only Controllable Nitro Boost is used (i may not ask if i would know these memory addresses), or is the 'Two Nitros' a workaround? Yes, If you mean that the player should enable the nitro to the mod works, Yes, it's necessary. Keys you can modifie, The key should be Primary or Secondary Fire. Allow me to suggest a more R*-ish, optimised and possibly safer code. Although your code is pretty good anyway. It's mainly the two while loops which could have a small flaw. Thanks, Corrections are very good, without it I can't move ...So QUOTE 0119: car 0@ wrecked Checks if the car is defined too? |
Sep 21 2011, 02:06 PM Post #5 | |
Coding like a Rockstar! Posts: 1,468 From: ??? Joined: 28-May 09 | Yeah, but it's better to think of "defined" as "exists". Small anomalies like that are what makes SCM coding hard to understand at times. -------------------- | CLEO 4.3.22 | A?i?a?o?3D | UI SDK | Black Market Mod 1.0.1 | GInput 0.3 | Cheat Keyboard | Tactile Cheat Activation | Stream Ini Extender 0.7 | SuperVars | ScrDebug | Vigilante Justice: San Andreas | |
Sep 21 2011, 02:40 PM Post #6 | |
The Assistant Posts: 84 From: Matera, IT Joined: 16-June 11 | I already thought to make a script to control nitro manually. I started with basic SCM scripting, but it wasn't necessary to modify the nitro system completely. So, I came up with this code. Maybe I have to release it, but I'm not so convinced about the filosophy I followed to write the script. If someone want help me, I'll be glad to get your idea. This post has been edited by Wesser: Sep 21 2011, 02:41 PM |
Sep 21 2011, 06:03 PM Post #7 | |
Actually living entity Posts: 143 From: Earth Joined: 15-January 11 | @Wesser Tryed to compile it with sanny. If I understand the last comment in your code correctly SANNY // Compilation won't work for file missing error then you didnt expect anybody to be able to use it without missing .INC files, right?I cannot help with coding but maybe by testing it(?). As well @LINK2012 And by requesting functionality.. -------------------- |
Sep 24 2011, 08:54 PM Post #8 | |
The Assistant Posts: 84 From: Matera, IT Joined: 16-June 11 | Sorry for the late answer. I had to prevent the source from stealing. I just posted my work so that someone would be interested on helping me with some advice. Nitros time rises regarding to the multiplier (x2 = about 4800, x5 = about 5800, x10 = about 8800) but since there's too much difference between x2-x5 and x5-x10, I was asking if I should leave it as it is. |
Feb 24 2013, 09:06 AM Post #9 | |
The New Guy! Posts: 2 Joined: 22-February 13 | I always love a good supply of nitro. No one can leave you last on the road with it. -------------------- |