#1 Re: GTA Modding » Mission hooks » 20-04-2008 18:33

Hi,

Thanks for the fast reply. I've tried it but it doesn't seem to have effect.

By the way, the different approach I mentioned earlier was something along these lines:

{$CLEO}

0A95: enable_thread_saving

:VGLNTE
0001: wait 300 ms
0AAA: 0@ = thread 'COPCAR' pointer 
00D6: if 
0019:   0@ > 0 
004D: jump_if_false @VGLNTE_4 

:VGLNTE_1
0247: load_model #BRASSKNUCKLE 

:VGLNTE_2 
0001: wait 300 ms
00D6: if and
0256:  player $PLAYER_CHAR defined
0248:   model #BRASSKNUCKLE available
004D: jump_if_false @VGLNTE_2
00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@  
08E5: get_actor_in_sphere 1@ 2@ 3@ radius 50.0 handle_as 4@ //tried with versionB as well
00D6: if
056D:   actor 4@ defined 
004D: jump_if_false @VGLNTE_4
089F: get_actor 4@ pedtype_to 5@ 
0470: 6@ = actor 4@ current_weapon
00D6: if and
0039:   5@ == 24 
8491:   not actor 4@ has_weapon 1  
8118:   not actor 4@ dead
004D: jump_if_false @VGLNTE_3
02A9: set_actor 4@ immune_to_nonplayer 0 
081A: set_actor 4@ weapon_skill_to 2
01B2: give_actor 4@ weapon 1 ammo 9999
0249: release_model #BRASSKNUCKLE
00D6: if
82D8: not actor 4@ current_weapon == 6@ 
004D: jump_if_false @VGLNTE_3
01B9: set_actor 4@ armed_weapon_to 6@ 

:VGLNTE_3
0001: wait 0 ms
01C2: remove_references_to_actor 4@ 

:VGLNTE_4
0002: jump @VGLNTE

In theory, I thought it should work. But not only it didn't work, as it caused some weird glitches in surrounding traffic. hmm

#2 GTA Modding » Mission hooks » 20-04-2008 00:33

Krailer
Replies: 2

Hi,

I've been working on a few custom scripts for GTA SA, and I was wondering how mission hooks work. I've seen the OTB hook example, but my coding skills are very limited so I'm kind of clueless.

Basically, I wanted to hook the Vigilante sub-mission and change the 2nd parameter of 02A9 (all lines) to make the criminals vulnerable to npc actors and peds, assuming it is possible at all.

I've tried a different approach by making a custom script using intercepting opcodes, but to no avail.

Any help would be appreciated.

-Krailer

Board footer

Powered by FluxBB