gtafan113 Posted March 10, 2010 Share Posted March 10, 2010 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 More sharing options...
Dstrickt Posted March 10, 2010 Share Posted March 10, 2010 Player.Money($PLAYER_ACTOR) += -100 Something like that. You need to add a negative sign to lose money. Link to comment https://gtaforums.com/topic/442779-subtract-money-from-player/#findComment-1059817693 Share on other sites More sharing options...
gtafan113 Posted March 10, 2010 Author Share Posted March 10, 2010 (edited) 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! Edited March 10, 2010 by gtafan113 Link to comment https://gtaforums.com/topic/442779-subtract-money-from-player/#findComment-1059817704 Share on other sites More sharing options...
spaceeinstein Posted March 10, 2010 Share Posted March 10, 2010 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 Link to comment https://gtaforums.com/topic/442779-subtract-money-from-player/#findComment-1059817901 Share on other sites More sharing options...
gtafan113 Posted March 11, 2010 Author Share Posted March 11, 2010 Yeah, I figured that out . I had to make different sections for the price reduction for each different car. I was just going to make it a variable to make it easier. But it's all good because it works now. Link to comment https://gtaforums.com/topic/442779-subtract-money-from-player/#findComment-1059817940 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