Quantcast

Jump to content

» «
Photo

[VC] How to check if the actor/ped have been created by a mission scri

5 replies to this topic
rerse
  • rerse

    Player Hater

  • Members
  • Joined: 02 Nov 2011

#1

Posted 29 December 2013 - 08:53 PM

Here is a code: http://gtaforums.com...handle-opcodes/ (random_actor_near_point)

 

I use this to change some things about gang members (for example aim accuracy).

 

But when a mission script creates the gang members, I do not want to change anything about them.

 

How can I exclude the mission-created peds?


Jack...
  • Jack...

    Firearms and adrenaline!!!

  • Members
  • Joined: 06 Dec 2011
  • None

#2

Posted 29 December 2013 - 09:13 PM

The simple way is playing with the ammo opcodes. For exmpl make it that gang members created by the scrypt should have 9000 ammo, and those created by the game have 9999 by default (I think). So after you take handle just check the ammo.


_DK
  • _DK

    '22 'Pac

  • Members
  • Joined: 12 Apr 2009
  • Ukraine

#3

Posted 30 December 2013 - 01:36 AM

CPed +0x160 m_nCreatedBy
Possibly enum is same as in SA, I'm not sure about this.
1 - Random ped
2 - Mission ped
  • MasterHK likes this

Silent
  • Silent

    Moderating Cookie Monster

  • Members
  • Joined: 01 Feb 2010
  • Poland

#4

Posted 30 December 2013 - 02:00 AM

CPed +0x160 m_nCreatedBy
Possibly enum is same as in SA, I'm not sure about this.

It is. It's the same in III, VC and SA. Works for vehicles too, btw.

rerse
  • rerse

    Player Hater

  • Members
  • Joined: 02 Nov 2011

#5

Posted 30 December 2013 - 01:00 PM Edited by rerse, 30 December 2013 - 01:01 PM.

CPed +0x160 m_nCreatedBy
Possibly enum is same as in SA, I'm not sure about this.
1 - Random ped
2 - Mission ped

Three questions:

 

1. Where did you find it?

2. How to use it in this code?

{$CLEO .cs}

//-------------MAIN---------------
0000: NOP 

while true
   wait 0
0054: store_player $player_char position_to 10@ 11@ 12@
if
   05EF: 13@ = random_actor_near_point 10@ 11@ 12@ in_radius 550.0 find_next 0 pass_deads 0 //IF and SET
then
   repeat  
        IF or
            02F2:   actor 13@ model == #CBa   
            02F2:   actor 13@ model == #CBb   
            02F2:   actor 13@ model == #HNa   
            02F2:   actor 13@ model == #HNb   
        THEN
            04B8: get_weapon_data player 13@ weapon_group 4 weapon 14@ ammo 15@ model 16@ 
            008D: 15@ = integer_to_float 14@
            0302: text_4numbers 'COORD' 15@ 14@ 16@ 0 1000 ms 1 
//            03E5: text_box "c*ntY"  ;; New clothes delivered to the Vercetti Estate!
//            01E5: text_1number_highpriority "G_COST"  15@  1000 ms  1  ;; Cost: $~1~
            02E2: set_actor 13@ weapon_accuracy_to 80 
        END
   until 85EF: not 13@ = random_actor_near_point 10@ 11@ 12@ in_radius 550.0 find_next 1 pass_deads 0 //IF and SET
end

end

3. How to print debug info? (tried the first method, but 01E5 doesn't work and 0302 prints always 0)


_DK
  • _DK

    '22 'Pac

  • Members
  • Joined: 12 Apr 2009
  • Ukraine

#6

Posted 30 December 2013 - 05:33 PM

05E6: 14@ = actor 13@ struct
14@ += 0x160
05E0: 14@ = read_memory 14@ size 1 virtual_protect 0
if
    14@ <> 2
then




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users