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.

[Q] ini and cleo


Troll--dad
 Share

Recommended Posts

I made this testing script:

 

 

:SOLDIER_110001: wait 0 ms 0AF0: [email protected] = get_int_from_ini_file "CLEO\SURVIVAL.INI" section "COMMANDO" key "PRIMARYWEAPON" 0AF0: [email protected] = get_int_from_ini_file "CLEO\SURVIVAL.INI" section "COMMANDO" key "MELEEWEAPON" 0781: get_weapon_with_ID [email protected] model_to [email protected] 0781: get_weapon_with_ID [email protected] model_to [email protected] 0247: load_model [email protected] 0247: load_model #VLA2 0247: load_model [email protected] 00D6: if and0248:   model [email protected] available 0248:   model #VLA2 available 0248:   model [email protected] available 004D: jump_if_false @SOLDIER_11 0208: [email protected] = random_float_in_ranges -20.0 20.0 0208: [email protected] = random_float_in_ranges -20.0 20.0 02CE: [email protected] = ground_z_at [email protected] [email protected] 0.0 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset [email protected] [email protected] [email protected] 038B: load_requested_models 009A: [email protected] = create_actor_pedtype 8 model #VLA2 at [email protected] [email protected] [email protected] 0223: set_actor [email protected] health_to 150 02AB: set_actor [email protected] immunities BP 0 FP 0 EP 0 CP 1 MP 1 07DD: set_actor [email protected] attack_rate 100 // previously known as temper_to 01B2: give_actor [email protected] weapon [email protected] ammo 8000 // Load the weapon model before using this 0946: set_actor [email protected] actions_uninterupted_by_weapon_fire 1 0001: wait 5000 ms 0850: AS_actor [email protected] follow_actor $PLAYER_ACTOR 0634: AS_actor [email protected] attack_using_weapon_actor $PLAYER_ACTOR unknown 4 unknown 2000 unknown 100 0001: wait 2000 ms 0002: jump @SOLDIER_343 :SOLDIER_3430001: wait 0 ms 01B2: give_actor [email protected] weapon [email protected] ammo 500 // Load the weapon model before using this 0634: AS_actor [email protected] attack_using_weapon_actor $PLAYER_ACTOR unknown 4 unknown 2000 unknown 100 02E2: set_actor [email protected] weapon_accuracy_to 100 00D6: if 00F3:   actor $PLAYER_ACTOR near_actor [email protected] radius 1.0 1.0 0.0 on_foot 004D: jump_if_false @SOLDIER_476 01B2: give_actor [email protected] weapon [email protected] ammo 1 // Load the weapon model before using this 0001: wait 200 ms 0605: actor [email protected] perform_animation "GUN_BUTT" IFP "PED" rate 4.0 loop 0 lockX 0 lockY 0 lockF 0 time -1 0321: AS_actor $PLAYER_ACTOR die_headshotted 0002: jump @SOLDIER_476 :SOLDIER_4760001: wait 0 ms 00D6: if 0118:   actor [email protected] dead 004D: jump_if_false @SOLDIER_343 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset 0.0 0.0 0.0 0001: wait 1000 ms 0002: jump @SOLDIER_537 :SOLDIER_5370001: wait 500 ms 009B: destroy_actor [email protected] 0001: wait 700 ms 0A93: end_custom_thread 

 

 

and .ini file: (just the commando part)

 

[COMMANDO]Primaryweapon=28Meleeweapon=4

 

 

Upper script is saved as an .S file, and I call it in another script, but it gives crashes confused.gif

 

Edit: The crash is caused, because the script doesn't recognize the file

file name is SURVIVAL, and it's saved as .ini

 

and IDK why the script is not recognizing

Edited by Troll--dad
Link to comment
Share on other sites

You have to put an if before getting a variable from a .ini file because those opcodes have a comment saying IF and SET or something like that. I can't remember exactly how to set it up right now, but I know you need an if before that and have a jump if false to a part of code that will check to make sure it wasn't loaded and then bring it back to loading the variable. Hopefully this makes sense.

 

The game is probably crashing because it's getting weird numbers for those variable which would not work for weapons. That's what happened to me when I used those opcodes without checking them.

Link to comment
Share on other sites

aStiffSausage
You have to put an if before getting a variable from a .ini file because those opcodes have a comment saying IF and SET or something like that. I can't remember exactly how to set it up right now, but I know you need an if before that and have a jump if false to a part of code that will check to make sure it wasn't loaded and then bring it back to loading the variable. Hopefully this makes sense.

 

The game is probably crashing because it's getting weird numbers for those variable which would not work for weapons. That's what happened to me when I used those opcodes without checking them.

No need for "if". It means that it can be used for both, if and set, in this case for set.

Link to comment
Share on other sites

 

:SOLDIER_11wait 00AF0: [email protected] = get_int_from_ini_file "CLEO\SURVIVAL.INI" section "COMMANDO" key "PRIMARYWEAPON"0AF0: [email protected] = get_int_from_ini_file "CLEO\SURVIVAL.INI" section "COMMANDO" key "MELEEWEAPON"0781: get_weapon_with_ID [email protected] model_to [email protected]: get_weapon_with_ID [email protected] model_to [email protected]: load_model [email protected]: load_model #VLA20247: load_model [email protected]: load_requested_models0208: [email protected] = random_float_in_ranges -20.0 20.00208: [email protected] = random_float_in_ranges -20.0 20.002CE: [email protected] = ground_z_at [email protected] [email protected] 0.004C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset [email protected] [email protected] [email protected]: [email protected] = create_actor_pedtype 8 model #VLA2 at [email protected] [email protected] [email protected]: set_actor [email protected] health_to 15002AB: set_actor [email protected] immunities BP 0 FP 0 EP 0 CP 1 MP 107DD: set_actor [email protected] attack_rate 10001B2: give_actor [email protected] weapon [email protected] ammo 99999   // max ammo, but only about 15 rounds are dropped when the char dies0946: set_actor [email protected] actions_uninterupted_by_weapon_fire 1wait 5000// I've added the attack command here, so it isn't getting run in an infinite loop.07A5: AS_actor [email protected] attack_actor $PLAYER_ACTOR time -2:SOLDIER_343wait 0// This is probably not the right line to be using, with '4' in the flags parameter, it enables bit 3: Allow Crouching//0634: AS_actor [email protected] attack_using_weapon_actor $PLAYER_ACTOR flags 4 perform_actions_after_time 2000 chance_of_action 100if   00F3:   actor $PLAYER_ACTOR near_actor [email protected] radius 1.0 1.0 0.0 on_footthen   01B2: give_actor [email protected] weapon [email protected] ammo 1 // Load the weapon model before using this   wait 200 ms   0605: actor [email protected] perform_animation "GUN_BUTT" IFP "PED" rate 4.0 loop 0 lockX 0 lockY 0 lockF 0 time -1   0321: AS_actor $PLAYER_ACTOR die_headshottedendif or   0118:   actor [email protected] dead   8256:   not player 0 definedelse_jump @SOLDIER_34304C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset 0.0 0.0 0.0wait 1000:SOLDIER_537wait 500009B: destroy_actor [email protected] 7000A93: end_custom_thread

 

 

I made adjustments to your script (before, nothing was happening for me but now it runs as expected). Didn't have any crashes but I'm sure any problems were probably caused by how you loaded the models. Now you can replace 038B: load_requested_models with this if you want an (extremely) slight increase in performance:

 

while true   if or       8248:   not model [email protected] available       8248:   not model [email protected] available       8248:   not model #VLA2 available   jf break   wait 0end

 

Link to comment
Share on other sites

Keeps crashing...

 

but when I change this:

 

0AF0: [email protected] = get_int_from_ini_file "CLEO\SURVIVAL.INI" section "COMMANDO" key "PRIMARYWEAPON"0AF0: [email protected] = get_int_from_ini_file "CLEO\SURVIVAL.INI" section "COMMANDO" key "MELEEWEAPON"

 

 

for this

 

0AF0: [email protected] = get_int_from_ini_file "CLEO\SURVIVAL" section "COMMANDO" key "PRIMARYWEAPON"0AF0: [email protected] = get_int_from_ini_file "CLEO\SURVIVAL" section "COMMANDO" key "MELEEWEAPON"

 

 

the script works, just the chars appear and follow me, but without weapons, and when i kill them the game crashes, maybe this happens cause it is stored in a .S file

Edited by Troll--dad
Link to comment
Share on other sites

The two codes you posted are identical...

 

It seems like you're having problems with the actual models. Are you using custom models?

Link to comment
Share on other sites

Yes, I have the gang replaced by custom skins, but before, when i haven't added the ini codes it ran perfectly

Link to comment
Share on other sites

That's because your not actually tryna create the custom models...?

Link to comment
Share on other sites

Sorry, I noticed now an error blush.gif

(I edited the fail)

when I said this some posts up

One of this:

 

 

0AF0: [email protected] = get_int_from_ini_file "CLEO\SURVIVAL.INI" section "COMMANDO" key "PRIMARYWEAPON"0AF0: [email protected] = get_int_from_ini_file "CLEO\SURVIVAL.INI" section "COMMANDO" key "MELEEWEAPON"

 

 

Meant to be:

 

 

0AF0: [email protected] = get_int_from_ini_file "CLEO\SURVIVAL" section "COMMANDO" key "PRIMARYWEAPON"0AF0: [email protected] = get_int_from_ini_file "CLEO\SURVIVAL" section "COMMANDO" key "MELEEWEAPON"

 

 

without naming the ini extension. I know i noticed a bit late...

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.