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

    3. Suggestions

Infinite Ammo


Zach
 Share

Recommended Posts

I did a forum search for "ammo" and read all the threads, but interestingly, this subject has not seemed to come up in the past three years. confused.gif (I just searched this specific forum though.)

 

Anyway, I'm trying to duplicate (sort of) the FULLCLIP cheat via a main.scm thread. Every few seconds, I query all the relevant weapon groups (2-9), and if the user is carrying a specific weapon, I want to set its ammo to 9999 (or whatever).

 

Querying the weapons seems to be working fine, but whenever I try to change the ammo--assuming I don't crash--nothing happens.

 

So my question is has any ever gotten any of these opcodes to work, and if so, could you provide me a little code snippet of how you used it?

 

Here's a code snippet of one of variations I have tried:

 

 

:InfiniteAmmo_Main0001: wait  5000 ms00D6: if  080DF:   NOT actor $PLAYER_ACTOR driving004D: jump_if_false ££InfiniteAmmo_Main04B8: get_weapon_data player $PLAYER_ACTOR weapon_group  2 weapon @120 ammo @121 @12200D6: if  00039:   @122 ==  346;; integer values004D: jump_if_false ££AmmoCheck_3000E: @121 =  99999;; integer values017A: set_actor_weapon_ammo player $PLAYER_ACTOR weapon @120  @121:AmmoCheck_30002: jump ££InfiniteAmmo_Main004E: end_thread

 

 

What I'm doing there is first querying if the player is carrying a pistol (or anything else in that group). THen I check to see if it's a pistol. (I compare the ModelID to 346 [as defined in weapon.dat].) If the player is carrying it, I then try to set its ammo to 99999.

 

Oddly, what happens is that I can pick up the pistol (ammo doesn't change though) and fire it. But if pick up a Micro-SMG, the game will crash the moment I try to fire it. confused.gif

 

EDIT: Okay, I read in some old tutorial that local variables are limited to @0 to @17 (or something like that), so I changed my variables to global variables, and doing so made the game stop crashing. My ammo is still not being set to 99999 though. confused.gif (Incidentally, there are local variables all throughout game's main script which are larger than 17, so I don't know why this made the crash go away.)

Edited by Zach
Link to comment
Share on other sites

This is what I've been using on GTA:SA....

 

 

0470: @1 = actor $PLAYER_ACTOR armed_weapon unknown041A: @2 = actor $PLAYER_ACTOR weapon  @1 ammo017B: set_actor $PLAYER_ACTOR weapon  @1 ammo_to  3200000D6: if  00449:   actor $PLAYER_ACTOR in_a_car004D: jump_if_false ££SNAKEMOD010114: set_actor $PLAYER_ACTOR car_weapon  @1 ammo_to  32000

 

 

My Vice City code was like this:

 

 

0470: [email protected] = actor $PLAYER_ACTOR armed_weapon unknown0419: [email protected] = player $PLAYER_CHAR weapon  [email protected] ammo00D6: if  3001B:    1000 >  [email protected] ;; integer values0019:    [email protected] >  11 ;; integer values001B:    34 >  [email protected] ;; integer values8039:   NOT    [email protected] ==  16 ;; integer values004D: jump_if_false ££Label033X070247: request_model [email protected]: if  00248:   model [email protected] available004D: jump_if_false ££Label033X0701B1: give_player $PLAYER_CHAR weapon  [email protected] ammo  32000 ;; Load the weapon model before using this0249: release_model [email protected]

 

 

Link to comment
Share on other sites

0470: @1 = actor $PLAYER_ACTOR armed_weapon unknown041A: @2 = actor $PLAYER_ACTOR weapon  @1 ammo017B: set_actor $PLAYER_ACTOR weapon  @1 ammo_to  3200000D6: if  00449:   actor $PLAYER_ACTOR in_a_car004D: jump_if_false ££SNAKEMOD010114: set_actor $PLAYER_ACTOR car_weapon  @1 ammo_to  32000

 

Thank God there is a generic way of doing this! rah.gif

 

So since you are using it, I assume then, obviously, that trying to set the ammo when carrying a melee weapon (or jetpack, parachute, etc.) cause no problems. Coolness.

 

Thanks!

 

Link to comment
Share on other sites

  • 3 weeks later...

question were in the code do i put this section u have shown me

 

"0470: @1 = actor $PLAYER_ACTOR armed_weapon unknown

041A: @2 = actor $PLAYER_ACTOR weapon @1 ammo

017B: set_actor $PLAYER_ACTOR weapon @1 ammo_to 32000

00D6: if 0

0449: actor $PLAYER_ACTOR in_a_car

004D: jump_if_false ££SNAKEMOD01

0114: set_actor $PLAYER_ACTOR car_weapon @1 ammo_to 32000

"

 

does it matter?

 

also are there any basic tutorials for noobs on sa coding

 

i have the sa mission builder 0.33 and i can decompile the .scm file but i want to know how to edit this like hair and clothes and stuff?

 

one last thing when u have edited the file and replace the old .scm file will that change things in my saved files?

 

plz help suicidal.gifnotify.gif

Link to comment
Share on other sites

Quadropheniac90
What opcode makes peds do a driveby? I searched trough the intro code but I think the driveby action is an action sequence, I don't know... I want to create an intro scene, so... please help, sorry for the offtopic by the way...
user posted image
Link to comment
Share on other sites

random_download

Changing the scm will not change your save file (unless you save over it or something). You cannot load saves from a different scm, so must start a new game for each scm used.

You should put the code in a thread before ";----------mission 0" (I'm not sure how many dashes there are).

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.