Jump to content

Your own crew


brdgamemaster

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: 2@ == 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 "2@" 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 (1@, 2@, 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: 0@ = create_actor 4 #GANG08 at 97.7477 -467.1534 16.0461 0173: set_actor 0@ z_angle_to 180 01B2: give_actor 0@ weapon 3 ammo 9999 // Load the weapon model before using this 0223: set_actor 0@ health_to 1000 02E2: set_actor $723 weapon_accuracy_to 9001DF: tie_actor 0@ to_player $PLAYER_CHAR009A: 1@ = create_actor 4 #GANG08 at 101.8649 -467.2302 16.0461 0173: set_actor 1@ z_angle_to 180 01B2: give_actor 1@ weapon 4 ammo 9999 // Load the weapon model before using this 0223: set_actor 1@ health_to 1000 02E2: set_actor 1@ weapon_accuracy_to 9001DF: tie_actor 1@ to_player $PLAYER_CHAR009A: 2@ = create_actor 4 #GANG08 at 104.9266 -467.279 16.0461 0173: set_actor 2@ z_angle_to 180 01B2: give_actor 2@ weapon 5 ammo 9999 // Load the weapon model before using this 0223: set_actor 2@ health_to 1000 02E2: set_actor 2@ weapon_accuracy_to 9001DF: tie_actor 2@ 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 0@ dead 0118:   actor 1@ dead 0118:   actor 2@ dead 004D: jump_if_false @GANGMEM_48701C2: remove_references_to_actor 0@ 01C2: remove_references_to_actor 1@ 01C2: remove_references_to_actor 2@004E: 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: 0@ = create_actor 4 #GANG08 at 97.7477 -467.1534 16.0461 0173: set_actor 0@ z_angle_to 180 01B2: give_actor 0@ weapon 3 ammo 9999 // Load the weapon model before using this 0223: set_actor 0@ health_to 1000 02E2: set_actor $723 weapon_accuracy_to 9001DF: tie_actor 0@ to_player $PLAYER_CHAR009A: 1@ = create_actor 4 #GANG08 at 101.8649 -467.2302 16.0461 0173: set_actor 1@ z_angle_to 180 01B2: give_actor 1@ weapon 4 ammo 9999 // Load the weapon model before using this 0223: set_actor 1@ health_to 1000 02E2: set_actor 1@ weapon_accuracy_to 9001DF: tie_actor 1@ to_player $PLAYER_CHAR009A: 2@ = create_actor 4 #GANG08 at 104.9266 -467.279 16.0461 0173: set_actor 2@ z_angle_to 180 01B2: give_actor 2@ weapon 5 ammo 9999 // Load the weapon model before using this 0223: set_actor 2@ health_to 1000 02E2: set_actor 2@ weapon_accuracy_to 9001DF: tie_actor 2@ 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 0@ dead 0118:   actor 1@ dead 0118:   actor 2@ dead 004D: jump_if_false @GANGMEM_48701C2: remove_references_to_actor 0@ 01C2: remove_references_to_actor 1@ 01C2: remove_references_to_actor 2@004E: 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
  • 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.