Author Topic: Saving Points and Items  (Read 1079 times)

I am not very good with VCE and never really have been. I am good with the basics like OnVariableTrue and stuff like that, but not the more complex variable stuff.

Things I Want to Know How to Do:
1. Save a players points when he/she leaves the server
2. Save a players items when he/she leaves the server

If someone could explain how, through events, I can do these things, please explain them like you are talking to a 6-year-old.

Some good events to download for this are the save/load item and minigame events

the minigame events are onminigamejoin/leave/spawn/death/kill.  just use onminispawn-player-loaditems for when they spawn/respawn.

easy as that, no vce required

Can I have a link to those? And does it load the items they saved when they leave the server and come back?

I still need to know how to save a players points when he leaves and load them back up when he joins.

Can I have a link to those? And does it load the items they saved when they leave the server and come back?

I still need to know how to save a players points when he leaves and load them back up when he joins.
All of this is on RTB...even save score

Enable Script_Player_Persistence


Ok, one last thing. I know this isn't related to the topic, but I need to know how I can have your points shown when you click a brick.

Example: OnActivate - Client - CenterPrint - (You have (What do I put here?) points.)

-shnip-
Use VCE.
(You have <var:client:score> points).

Tell me if I'm wrong.

Use VCE.
(You have <var:client:score> points).

Tell me if I'm wrong.
I tried it and it just said "You have <var:client:score> points".

I also tried <var:cl:points> and it still didn't work.

NO-EDIT (Why isn't there an edit for this section or any other section without it?): I also need to know this:
I have a brick that sells a gun for a certain amount of points. When you have enough points and you click it, it loads your previous saved weapons, saves them with the new gun, then clears them so you now have that gun along with your other guns saved. What I want to know is how I can make it so if you click it and you already bought (have saved) the gun, it says "You have already bought this gun".

So basically, I need to know how I can make it so the brick knows you have already bought (saved) the weapon to your load-out. Again, I am not very good with VCE so try to explain this like I am fresh out of kindergarten.

NO-EDIT (Why isn't there an edit for this section or any other section without it?): I also need to know this:
I have a brick that sells a gun for a certain amount of points. When you have enough points and you click it, it loads your previous saved weapons, saves them with the new gun, then clears them so you now have that gun along with your other guns saved. What I want to know is how I can make it so if you click it and you already bought (have saved) the gun, it says "You have already bought this gun".

So basically, I need to know how I can make it so the brick knows you have already bought (saved) the weapon to your load-out. Again, I am not very good with VCE so try to explain this like I am fresh out of kindergarten.

again, i have never used vce with TDMs or DMs, but I'm fairly good with VCE.

What i would suggest is that the person pays an amount once, then can get it again as many times as they want, instead of spending points every time to get the item.  this would be better and easier than having it buyable once and only once-they may ctrl+W the item.

Here is the event chain i would suggest, it is very basic and you could probably learn from it.

AK-47 Buying Brick
0
  • Onactivate-client-VCEIfvariable-[AK-47] [==] [1] [1 2]

1
  • Onvariablefalse-client-VCEIfvariable-[score] [>=] [5] [2 6]

2
  • Onvariabletrue-player-additem-AK47

3
  • Onvariabletrue-client-VCEmodvariable-[score] [subtract] [5]

4
  • Onvariabletrue-client-centerprint-[<color:FFFFFF>You have bought an AK-47]

5
  • Onvariabletrue-client-VCEmodvariable-[AK47] [set] [1]

6
  • Onvariablefalse-client-centerprint-[<color:FFFFFF>You do not have enough points to buy an AK-47]


I will explain to you what this means.  When you click the brick, it check to see if you have bought an AK before.  If you have, then it adds an AK to your inventory and you're on your way.  If you haven't, then it checks to see if you have enough points to buy an AK (5 points).  If you don't have enough points, then it will tell you.  If you have enough points, then it adds an AK to your inventory, subtracts five points, makes it so you can get an AK without needing to buy it again, and tells you that you have bought the AK47.

If you have any questions, feel free to ask.


Also, I don't have VCEModVariable and VCEIfVariable under client. VCEIfVariable is under Self though. If there is a certain add-on needed for these events, please post a link.

Sorry for triple post, I found the events needed and I'll try the events now.

What does event 5 do?

it sets your 'ak47' variable to 1.

if you look back at event 0, it makes sense.

for event 5, it is so that you dont have to purchase the gun again.  event 0 checks to see if your 'ak47' variable is 1 (if you have bought it or not).  if your 'ak47' variable is set to 1(if you've bought it before) then it wont charge you points, t will simply just add the ak47.