Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      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. Support

    3. Suggestions

*DO NOT* SHARE MEDIA OR LINKS TO LEAKED COPYRIGHTED MATERIAL. Discussion is allowed.

Your own crew


brdgamemaster
 Share

Recommended Posts

brdgamemaster

I script a cleo mod for gta 3 and I intended to spawn 3 Yakuza peds in your safehouse in stauntan island, while they carried shotguns, uzis, and ak47s, follow you and assist you. For some reason I cant get it to work, I made the script:

 

{$CLEO .cs}

 

:GANGMEM

03A4: name_thread 'GANGMEM'

 

:GANGMEM_485

0001: wait 5000

00D6: if

0038: $ONMISSION == 0 // integer values

004D: jump_if_false @GANGMEM_485

00D6: if

0256: player $PLAYER_CHAR defined

004D: jump_if_false @GANGMEM_485

00D6: if

0039: [email protected] == 0 // integer values

004D: jump_if_false @GANGMEM_485

00D6: if

0248: model #GANG08 available

004D: jump_if_false @GANGMEM_485

00D6: if

0248: model #UZI available

004D: jump_if_false @GANGMEM_485

00D6: if

0248: model #SHOTGUN available

004D: jump_if_false @GANGMEM_485

00D6: if

0248: model #AK47 available

004D: jump_if_false @GANGMEM_485

009A: $723 = create_actor 4 #GANG08 at 97.7477 -467.1534 16.0461

0173: set_actor $723 z_angle_to 180

0568: set_actor $723 untargetable 1

01B2: give_actor $723 weapon 3 ammo 9999 // Load the weapon model before using this

0223: set_actor $723 health_to 1000

02E2: set_actor $723 weapon_accuracy_to 90

00D6: if

8118: not actor $723 dead

004D: jump_if_false @GANGMEM_485

01DF: tie_actor $723 to_player $PLAYER_CHAR

009A: $724 = create_actor 4 #GANG08 at 101.8649 -467.2302 16.0461

0173: set_actor $724 z_angle_to 180

0568: set_actor $724 untargetable 1

01B2: give_actor $724 weapon 4 ammo 9999 // Load the weapon model before using this

0223: set_actor $724 health_to 1000

02E2: set_actor $724 weapon_accuracy_to 90

00D6: if

8118: not actor $724 dead

004D: jump_if_false @GANGMEM_485

01DF: tie_actor $724 to_player $PLAYER_CHAR

009A: $725 = create_actor 4 #GANG08 at 104.9266 -467.279 16.0461

0173: set_actor $725 z_angle_to 180

0568: set_actor $725 untargetable 1

01B2: give_actor $725 weapon 5 ammo 9999 // Load the weapon model before using this

0223: set_actor $725 health_to 1000

02E2: set_actor $725 weapon_accuracy_to 90

00D6: if

8118: not actor $725 dead

004D: jump_if_false @GANGMEM_485

01DF: tie_actor $725 to_player $PLAYER_CHAR

 

If you guys have any ideas, please help me. I would totally appreciate it. tounge.gif

 

Link to comment
Share on other sites

You are doing it wrong.

 

#1, you don't need three separate checks - consolidate them into one. And what the hell is "[email protected]" supposed to be? You need to define this first before you can check it. All it does is crash the game right now. Let's replace it with an island check.

 

{$CLEO .cs}:GANGMEM03A4: name_thread 'GANGMEM'0001: wait 5000 ms:GANGMEM_4850001: wait 0 ms00D6: if and0038:   $ONMISSION == 0 // integer values 0256:   player $PLAYER_CHAR defined 03C6:   current_island == 2004D: jump_if_false @GANGMEM_485

 

#2, you need to request the models before checking if they are available. And for God's sake, break this up into more manageable chunks. And you need waits in your scripts, otherwise the game will crash.

 

0247: request_model #GANG08 0247: request_model #SHOTGUN 0247: request_model #UZI 0247: request_model #AK47 :GANGMEM_4860001: wait 0 ms00D6: if and0248:   model #GANG08 available 0248:   model #UZI available 0248:   model #SHOTGUN available 0248:   model #AK47 available 004D: jump_if_false @GANGMEM_486

 

#3, use local variables instead of globals ([email protected], [email protected], etc instead of $1, $2). Opcode 0568 doesn't work with GTA 3, I don't know where you got that idea from.

 

First spawn and group the actors, then check if they're dead. Once they are all spawned release the models to free up memory.

 

009A: [email protected] = create_actor 4 #GANG08 at 97.7477 -467.1534 16.0461 0173: set_actor [email protected] z_angle_to 180 01B2: give_actor [email protected] weapon 3 ammo 9999 // Load the weapon model before using this 0223: set_actor [email protected] health_to 1000 02E2: set_actor $723 weapon_accuracy_to 9001DF: tie_actor [email protected] to_player $PLAYER_CHAR009A: [email protected] = create_actor 4 #GANG08 at 101.8649 -467.2302 16.0461 0173: set_actor [email protected] z_angle_to 180 01B2: give_actor [email protected] weapon 4 ammo 9999 // Load the weapon model before using this 0223: set_actor [email protected] health_to 1000 02E2: set_actor [email protected] weapon_accuracy_to 9001DF: tie_actor [email protected] to_player $PLAYER_CHAR009A: [email protected] = create_actor 4 #GANG08 at 104.9266 -467.279 16.0461 0173: set_actor [email protected] z_angle_to 180 01B2: give_actor [email protected] weapon 5 ammo 9999 // Load the weapon model before using this 0223: set_actor [email protected] health_to 1000 02E2: set_actor [email protected] weapon_accuracy_to 9001DF: tie_actor [email protected] to_player $PLAYER_CHAR0249: release_model #GANG08 0249: release_model #SHOTGUN 0249: release_model #AK470249: release_model #UZI :GANGMEM_4870001: wait 0 ms00D6: if and0118:   actor [email protected] dead 0118:   actor [email protected] dead 0118:   actor [email protected] dead 004D: jump_if_false @GANGMEM_48701C2: remove_references_to_actor [email protected] 01C2: remove_references_to_actor [email protected] 01C2: remove_references_to_actor [email protected]: end_thread 

 

 

So we'll end up with something like this -

 

 

{$CLEO .cs}:GANGMEM03A4: name_thread 'GANGMEM'0001: wait 5000 ms:GANGMEM_4850001: wait 0 ms00D6: if and0038:   $ONMISSION == 0 // integer values 0256:   player $PLAYER_CHAR defined 03C6:   current_island == 2004D: jump_if_false @GANGMEM_4850247: request_model #GANG08 0247: request_model #SHOTGUN 0247: request_model #UZI 0247: request_model #AK47 :GANGMEM_4860001: wait 0 ms00D6: if and0248:   model #GANG08 available 0248:   model #UZI available 0248:   model #SHOTGUN available 0248:   model #AK47 available 004D: jump_if_false @GANGMEM_486009A: [email protected] = create_actor 4 #GANG08 at 97.7477 -467.1534 16.0461 0173: set_actor [email protected] z_angle_to 180 01B2: give_actor [email protected] weapon 3 ammo 9999 // Load the weapon model before using this 0223: set_actor [email protected] health_to 1000 02E2: set_actor $723 weapon_accuracy_to 9001DF: tie_actor [email protected] to_player $PLAYER_CHAR009A: [email protected] = create_actor 4 #GANG08 at 101.8649 -467.2302 16.0461 0173: set_actor [email protected] z_angle_to 180 01B2: give_actor [email protected] weapon 4 ammo 9999 // Load the weapon model before using this 0223: set_actor [email protected] health_to 1000 02E2: set_actor [email protected] weapon_accuracy_to 9001DF: tie_actor [email protected] to_player $PLAYER_CHAR009A: [email protected] = create_actor 4 #GANG08 at 104.9266 -467.279 16.0461 0173: set_actor [email protected] z_angle_to 180 01B2: give_actor [email protected] weapon 5 ammo 9999 // Load the weapon model before using this 0223: set_actor [email protected] health_to 1000 02E2: set_actor [email protected] weapon_accuracy_to 9001DF: tie_actor [email protected] to_player $PLAYER_CHAR0249: release_model #GANG08 0249: release_model #SHOTGUN 0249: release_model #AK470249: release_model #UZI:GANGMEM_4870001: wait 0 ms00D6: if and0118:   actor [email protected] dead 0118:   actor [email protected] dead 0118:   actor [email protected] dead 004D: jump_if_false @GANGMEM_48701C2: remove_references_to_actor [email protected] 01C2: remove_references_to_actor [email protected] 01C2: remove_references_to_actor [email protected]: end_thread

 

Edited by fireguy109

pkmTc.gif

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.