Jump to content

Subtract Money From Player?


Recommended Posts

I've tried a few different opcodes, but I can't figure out how to make CLEO SUBTRACT money from the player. I can get it to add, just not subtract.

 

Reason being is because I am working on another mod that opens up car dealerships around San Andreas. Almost every car not available through importing will be available at one of them. I just need to know how to subtract money from the player.

Link to comment
https://gtaforums.com/topic/442779-subtract-money-from-player/
Share on other sites

I tried this, but when I select a car to buy (which is when it would then subtract the cash) the game crashes.

 

 

09E1: get_car_model 7@ price_to 9@ 00D6: if 010A:   player $PLAYER_CHAR money > 9@ 004D: jump_if_false @DEALERSHIP_903 0109: player $PLAYER_ACTOR money += -9@

 

 

EDIT: I got it to work. Thank you Dstrickt! smile.gif

Edited by gtafan113
spaceeinstein

You can't put a negative in front of a variable.. That doesn't make the variable negative. You have to set the variable as a negative number, like

9@ *= -1

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
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.