Zach Posted June 25, 2005 Share Posted June 25, 2005 (edited) 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. (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. 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. (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 June 25, 2005 by Zach Link to comment Share on other sites More sharing options...
Viper187 Posted June 25, 2005 Share Posted June 25, 2005 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 More sharing options...
Zach Posted June 25, 2005 Author Share Posted June 25, 2005 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! 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 More sharing options...
Don_Wuh Posted July 13, 2005 Share Posted July 13, 2005 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 Link to comment Share on other sites More sharing options...
Quadropheniac90 Posted July 13, 2005 Share Posted July 13, 2005 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... Link to comment Share on other sites More sharing options...
random_download Posted July 13, 2005 Share Posted July 13, 2005 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now