VCE saving of purchases

Author Topic: VCE saving of purchases  (Read 1036 times)

Can I use vce to check if a player has had their money deducted in the past so that if the next time they click something, it doesn't deduct money? If it isn't obvious, I am trying to allow players to purchase weapons with them being able to select it the next time they spawn without a point deduction.

i had a very nice permanent purchase system on an older tdm of mine, gimme a bit to dig it out

There is an add-on that does that I believe. But to use VCE, the most basic way I know how to do it is this when buying:

Check if the player has variable

If true, give them the item.

If false, check if they have enough money to buy it

If true, give them the item and the variable (player = if they die they loose it, client = if they leave the game they loose it)

Then when they rejoin or respawn have them click a button that loads the variable back. There's a VCE add-on that just loads the variable 0 or whatever.

There is an add-on that does that I believe. But to use VCE, the most basic way I know how to do it is this when buying:

Check if the player has variable

If true, give them the item.

If false, check if they have enough money to buy it

If true, give them the item and the variable (player = if they die they loose it, client = if they leave the game they loose it)

Then when they rejoin or respawn have them click a button that loads the variable back. There's a VCE add-on that just loads the variable 0 or whatever.

this makes sense, ok. thanks, but...

There's a VCE add-on that just loads the variable 0 or whatever.

...what do you mean by this?

i had a very nice permanent purchase system on an older tdm of mine, gimme a bit to dig it out

well if you find it, do you mind posting for it. the above method might not work for me right away because i am dumb.

mmk, here you go
http://brown townblaze.com/downloads/shopsys.bls

change the variable name WEAPON to whatever is being purchased, change the values at lines 4 and 10 to your price, with 10 being negative to subtract that value
and obviously replace the printer with whatever item you want
fool around with the centerprints and sounds however you want

for demonstration purposes, the red brick adds to your score 5 points, and the yellow brick resets your ownership status to 0

snip

oh wow thanks.

i'm not familiar with using variables in VCE, would i have to change all the variable names in different shop bricks so they don't all break if they are using the same variable name?

for example, if the WEAPON variable is true for one brick, will it begin to be true for any duplicate bricks using the same variable name?

for example, if the WEAPON variable is true for one brick, will it begin to be true for any duplicate bricks using the same variable name?
Yes.



Remove the setScore.



Remove the setScore.
oh, oops, that's supposed to be a centerprint, i guess i goofed while i was cleaning out extraneous aesthetic things
it's correct in the save file, at least

Then when they rejoin or respawn have them click a button that loads the variable back. There's a VCE add-on that just loads the variable 0 or whatever.
Or you can load it as the first event when they click the brick to buy/retrieve the weapon.

Or you can load it as the first event when they click the brick to buy/retrieve the weapon.

Never thought of that, good idea.

I always had a billboard in major areas for saving and loading variables.