Jump to content

2 little questions


Recommended Posts

OK, here are my 2 questions:


1. How to put for exemple a briefcase like the one from Guardian Angels in the game at a position, but that it gives you money everytime you pick it up?


2. How do you change cops weapons, I want it so they have uzi instead of the normal gun?



Link to comment
Share on other sites

2 - Can't be done with conventional code mods. Been asked many times.


1 - How to use a pickup with no hardcoded side effects (like the briefcase) to trigger something is a very basic coding concept. You establish your pickup, then you loop to see if it's been picked up, then you place your code for whatever effect you want to take place, then you either end the thread or repeat the above steps to establish when the thread should start over. Example in MB 0.22 (if you do NOT understand this or why every single line is just so, ASK. don't bother with asking for additional stuff if this much doesn't make sense as this is quite basic):


:LabelMYMOD03A4: name_thread "MONEYBC"0213:  0@ = create_pickup -120? (BRIEFCASE) type  3? at  0!  0!  0!:LabelMYMOD10001: wait  250& ms00D6: if  0?0256:   player $PLAYER_CHAR defined004D: jump_if_false ££LabelMYMOD100D6: if  0?0214:   pickup  0@ picked_up004D: jump_if_false ££LabelMYMOD10215: destroy_pickup  0@0109: player $PLAYER_CHAR money +=  1000&:LabelMYMOD20001: wait  250& ms00D6: if  0?0256:   player $PLAYER_CHAR defined004D: jump_if_false ££LabelMYMOD200D6: if  0?80F6:   NOT   player $PLAYER_CHAR  0? ()near_point_on_foot  0!  0!  0! radius  50!  50!  50!004D: jump_if_false ££LabelMYMOD20213:  0@ = create_pickup -120? (BRIEFCASE) type  3? at  0!  0!  0!0002: jump ££LabelMYMOD1



The radius check is just to make sure it doesn't just infinitely spawn while you're standing there. Its radius, all coords, and the cash amount will all need to be customized to fit whatever you're using it for. Additionally, if you're using this in a stripped SCM, you will need to add the line

DEFINE OBJECT BRIEFCASE                   \\ Object number -120

...under your define objects sections. It and the codes reference to it will need to have the correct number referring to it. This part of it is NOT basic, so do not feel bad if you don't understand it. Again, any questions, ask them.

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.