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. Forum Support

    3. Suggestions

How to use, 073F: get_actor_in_sphere [email protected] [email protected] [email protected] radius 20.0 with_pedtype_civilian 1 gang 1 criminal/prostitute 1 handle_as [email protected]


vlads
 Share

Recommended Posts

So. i want to catch a random ped with specific type and make them bleed, and i think this code

073F: get_actor_in_sphere [email protected] [email protected] [email protected] radius 20.0 with_pedtype_civilian 1 gang 1 criminal/prostitute 1 handle_as [email protected]

 

is what i need. But i can't make it work

 

can i have a working example of this code?

Link to comment
Share on other sites

{$cleo .cs}
0000:
#MICRO_UZI.load
038B: load_requested_models

while true
    wait 0
    if player.Defined(0)
    jf continue
    if 0ab0: 54 //press 6
    jf continue
    Actor.StorePos($PLAYER_ACTOR, [email protected], [email protected], [email protected]) //get player pos
    073F: get_actor_in_sphere [email protected] [email protected] [email protected] radius 20.0 with_pedtype_civilian 1 gang 1 criminal/prostitute 1 handle_as [email protected]
    if 056D:   actor [email protected] defined //find actor
    then 0332: set_actor [email protected] bleeding 1 //true
        [email protected] = marker.CreateAboveActor([email protected]) // mark actor
        if not Actor.HasWeapon([email protected], 28) //actor not have micro uzi                                                                                                                                                     
        then Actor.GiveWeaponAndAmmo([email protected], 28, 999999) //give actor micro uzi  
        end
    else 0acd: "not find any actor" 1000
    end
end

----------------------------------------------------------------------------------------------------------------

{$cleo .cs}
0000:
//better option
while true
    wait 0
    if player.Defined(0)
    jf continue //jf @1   
    Actor.StorePos($PLAYER_ACTOR, [email protected], [email protected], [email protected])                                                                                                                     
    if 0AE1: [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius 500.0 find_next 1 pass_deads 0 //IF and SET                                                                                        
    jf continue //jf @1                                                                                                                                                                                       
    IF NOT [email protected] == -1                                                                                                                                                                         
    jf continue //jf @1                                                                                                                                                                                     
    IF 056D:   actor [email protected] defined                                                                                                                                                         
    jf continue //jf @1
    0332: set_actor [email protected] bleeding 1
    //:1                                                                                 
end

Link to comment
Share on other sites

Whoa men thanks for the help, i actually making a zombie mod with this opcode so the zombies will attack the other peds too.

And you example code works great and exactly to what i need it and now  i just need to a little tweaks to make it work!. Thank you so much men.

Link to comment
Share on other sites

7 hours ago, vlads said:

Whoa men thanks for the help, i actually making a zombie mod with this opcode so the zombies will attack the other peds too.

And you example code works great and exactly to what i need it and now  i just need to a little tweaks to make it work!. Thank you so much men. 

I made you the last script:happy:
that peds are fighting with other peds flies their blood
they walk terribly and have handheld weapons
for example,
motor saw
shovel
katana
knife

 

{$cleo .cs}
0000:

Model.Load(#knifecur)
Model.Load(#chnsaw)
Model.Load(#katana)
Model.Load(#shovel)
038B: load_requested_models
[email protected] = 9

while true
    repeat
    wait 0
    until if  Player.Defined(0)
    Actor.StorePos($PLAYER_ACTOR, [email protected], [email protected], [email protected])
    if 0AE1: [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius 2650.0 find_next 1 pass_deads 0 //IF and SET
    then
        if 056D:   actor [email protected] defined        
        jf continue
        if not actor.Dead([email protected])
        jf continue
        0470: [email protected] = actor [email protected] current_weapon                                                                        
        if [email protected] == 0 //0 Unarmed not set cops or gang                                                                                               
        then
            0332: set_actor [email protected] bleeding 1
            0209: [email protected] = random_int_in_ranges 1 4 //random weapon for the actor                                        
            if [email protected] == 1                                                                                            
            then [email protected] = 4 //knifecur
                Actor.SetWalkStyle([email protected], "OLDMAN")                                                                           
            end                                                                                                   
            if [email protected] == 2                                                                                            
            then [email protected] = 6 //shovel
                Actor.SetWalkStyle([email protected], "OLDFATMAN")                                                                             
            end                                                                                                   
            if [email protected] == 3                                                                                            
            then [email protected] = 9 //chnsaw
                Actor.SetWalkStyle([email protected], "FATMAN")                                                                             
            end                                                                                                   
            if [email protected] == 4                                                                                            
            then [email protected] = 8 //katana
                Actor.SetWalkStyle([email protected], "OLDFATWOMAN")                                                                             
            end                                                                                                   
            Actor.GiveWeaponAndAmmo([email protected], [email protected], 0)                                                                   
            060B: set_actor [email protected] decision_maker_to 3                                                                
            for [email protected] = 0 to 21 step 1 //set ped type from 0 player to 22 prostitute                                 
                if and                                                                                            
                    not [email protected] == 1 //(1 PLAYER2)                                                                     
                    not [email protected] == 2 //(2 PLAYER_NETWORK)                                                              
                    not [email protected] == 3 //(3 PLAYER_UNUSED)                                                               
                jf continue                                                                                       
                if 056D:   actor [email protected] defined //securiti if actor not find  beacuse this is loop                    
                jf continue                                                                                       
                077A: set_actor [email protected] acquaintance 4{hate} to_actors_pedtype [email protected] // see ped.dat                       
            end                                                                                                   
        end                                                                                                       
    end
end

Link to comment
Share on other sites

Actually i've already made that, but thanks. However i have one problem, i'cant remove the dead bodies...

heres my example code.

 

{$CLEO .cs}

0000: "Test"
 
01F0: set_max_wanted_level_to 0

while true
    wait 0
    if player.Defined(0)
    jf continue
    Actor.StorePos($PLAYER_ACTOR, [email protected], [email protected], [email protected]) //get player pos
    073F: get_actor_in_sphere [email protected] [email protected] [email protected] radius 100.0 with_pedtype_civilian 1 gang 1 criminal/prostitute 1 handle_as [email protected]
    if 056D:   actor [email protected] defined //find actor
    then 07DD: set_actor [email protected] attack_rate 100 // previously known as temper_to
        077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 0 // see ped.dat
        077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 6 // see ped.dat
        077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 8 // see ped.dat  
        if 056D:   actor [email protected] defined //find actor
        jf continue
        if actor.Dead([email protected])
        then actor.DestroyInstantly([email protected])
        
        end                                                                                                          
    end
end

 

anything wrong?

Link to comment
Share on other sites

{how to explain it to you
it will not work like this
the actor is skipped and taken next
the actor would be
constant
or on idexes
  
  if you want it to take away
actors' references
how he died
use a different opcode}
//see now

{$CLEO .cs}

0000: "Test" //<-- thread "test"
 
01F0: set_max_wanted_level_to 0

while true
    wait 0
    if player.Defined(0)
    jf continue
    Actor.StorePos($PLAYER_ACTOR, 1@, 2@, 3@) //get player pos
    //073F: get_actor_in_sphere [email protected] [email protected] [email protected] radius 100.0 with_pedtype_civilian 1 gang 1 criminal/prostitute 1 handle_as [email protected]
    0AE1: 0@ = random_actor_near_point 1@ 2@ 3@ in_radius 100.0 find_next 1 pass_deads 0 //IF and SET 
    if not 0@ == -1
    jf continue
    if 056D:   actor 0@ defined //find actor
    then 
        07DD: set_actor 0@ attack_rate 100 // previously known as temper_to
        077A: set_actor 0@ acquaintance 4 to_actors_pedtype 0 // see ped.dat
        077A: set_actor 0@ acquaintance 4 to_actors_pedtype 6 // see ped.dat
        077A: set_actor 0@ acquaintance 4 to_actors_pedtype 8 // see ped.dat  
    end
end

 

Link to comment
Share on other sites

  • 2 weeks later...

Yow men! I know this is a quite long reply hehehe. Anyway, i've understood ur explain and also realize that i cant delete dead bodies using this opcode 073F: get_actor_in_sphere [email protected] [email protected] [email protected] radius 100.0 with_pedtype_civilian 1 gang 1 criminal/prostitute 1 handle_as [email protected] because the actor is being skipped in the loop. But i've found a way to solve this problem hehehe.😅

 

I've created 2 scripts base on your example scripts

 

the first one is to get an actor as a zombie

 

 {$cleo .cs}
0000: "Zombies"

06C8: enable_riot 1
0746: set_acquaintance 4 of_actors_pedtype 8 to_actors_pedtype 4

while true
    wait 0
    if player.Defined(0)
    jf continue
    Actor.StorePos($PLAYER_ACTOR, [email protected], [email protected], [email protected]) //get player pos
    073F: get_actor_in_sphere [email protected] [email protected] [email protected] radius 2500.0 with_pedtype_civilian 1 gang 0 criminal/prostitute 1 handle_as [email protected] // my goal is to turn the civilians and prostitute into zombies and the gang and cops are survivors
    if 056D:   actor [email protected] defined //find actor
    then 0332: set_actor [email protected] bleeding 1 //true
         07DD: set_actor [email protected] attack_rate 100 // previously known as temper_to
         077A: set_actor [email protected] acquaintance 4 to_actors_pedtype 0 // see ped.dat

    end
end

 

 

And the second script is to delete dead bodies

 

{$CLEO .cs}

0000: "Delete"
 

while true
    wait 0
    if player.Defined(0)
    jf continue
    Actor.StorePos($PLAYER_ACTOR, [email protected], [email protected], [email protected]) //get player pos
    
    0AE1: [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius 500.0 find_next 1 pass_deads 0 //IF and SET
    if not [email protected] == -1
    jf continue
    if 056D:   actor [email protected] defined //find actor
    then
        0946: set_actor [email protected] actions_uninterupted_by_weapon_fire 1  
    if
    0118:   actor [email protected] dead

    80F2:   not actor $PLAYER_ACTOR near_actor [email protected] radius 120.0 120.0 sphere 0 // for memory control to avoid game crush
    then 01C2: remove_references_to_actor [email protected] // i used remove reference opcode so there will be a abulance respond
    end
end
end

 

This scripts are not final though, i'm still doing some enhansments and trying some better opcodes combination.😁

Link to comment
Share on other sites

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.