If players buys an item,it takes money for the item

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
silent
Posts: 44
Joined: 28 Oct 2011 14:40

If players buys an item,it takes money for the item

#1 Post by silent » 10 Jan 2012 11:29

Thanks for all help with saving game settings and other things.Now i need something (and i think it will be the last thing) that will subtract cost of item from his money.For an example,if players money is 500$ and he buys something for 360$,it takes 360 from 500 and will save 140

Code: Select all

echo Money=%money% >>GSETS.db

In the save reading code theres

Code: Select all

if "%%A" == "Money" set Money=%%B

and i think this should use same thing but bit edited (cos this is reading "Money" from GSETS.db and i want to save the money to GSETS.db after subtracting cost of bought item.And i understand i need to enter that code (the one that reads money value from GSETS.db) again because it will still be 500$ and player will be able to buy again.(Code that reads money value from gsets.db is located at start of the program,just after @echo off and title,so it wont read the file again and player will have 500$ still.Yhm,now i get that if i will use the code that sets money,it will work without writing reading code again,XD everything is mixed,i dont know even what i write)

silent
Posts: 44
Joined: 28 Oct 2011 14:40

Re: If players buys an item,it takes money for the item

#2 Post by silent » 11 Jan 2012 13:45

bump

Post Reply