Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Arena War
      2. After Hours
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA Next

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

vlads

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]

Recommended Posts

vlads

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?

Share this post


Link to post
Share on other sites
Sanmodder

{$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

Share this post


Link to post
Share on other sites
vlads

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.

Share this post


Link to post
Share on other sites
Sanmodder
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

Share this post


Link to post
Share on other sites
vlads

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?

Share this post


Link to post
Share on other sites
Sanmodder
{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

 

Share this post


Link to post
Share on other sites
vlads

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.😁

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 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.