nVault won save, Please help :)
Hi, I followed a guide to nVault, but I can't seem to get it to save.
I checked the vault, but its empty. I would really appreciate some help or guidance :) These are the nVault functions in my plugin. PHP Code:
PHP Code:
|
Re: nVault won save, Please help :)
når jeg har brugt nvault åbner jeg og lukker den i hver funktion.
quick example idk if it will help ya: PHP Code:
|
Re: nVault won save, Please help :)
Quote:
If you check the vault immediately after using a set command then you will not see the entry in your vault file. You must either do a map-change or restart the server for the data to get written to the vault file. nVault is very simple to use; as long as your nvault file opens without error then your data should be getting written with nvault_set\nvault_pset. If you have any questions feel free to ask. Look at the 2nd nvault_set, you need to change the szXP variable to szLevel and possibly PlayerClass[] to something else. Someone was copy and pasting :grrr: PHP Code:
|
Re: nVault won save, Please help :)
Ty for a good answer, but it doesn't work. :cry:
Quote:
I checked after restart and mapchange, but there is nothing. (I use nVault-editor) Actually, I did copy-paste from nVault tutorial bc I though, then it would work :P - and it's on purpose that its PlayerClass[id] both times, bc it should save xp and level for a certain class :) and ty for correcting my szXP :P I really need some help :| and I would really appreciate if you could take a look at my code and correct it - or guide me like you did in this post :) Regards ReTaRD |
Re: nVault won save, Please help :)
No problem, Retard (chuckle)
I don't think it's an issue with nVault as it is really hard to screw up nvault code. I would do some debugging with the other parts of your plugin that actually call the nvault_set(). Have you checked server console and\or logs to make sure the plugin isn't throwing any errors? PHP Code:
|
Re: nVault won save, Please help :)
What did you call me? :twisted: (Just kidding)
I checked the console and there are no errors (I have it on debug mode). I have already tried to debug, but with no luck, that's why I ask for help from geniouses like you :P Regards ReTaRD |
Re: nVault won save, Please help :)
I just did a test using your code and it is saving. You should consider saving all of a players data in 1 vault entry instead of multiple.
PlayerClass[id] will always be 0 when a player first connects so any value you intended on being there for loading is not. If you need to store player class then you may need another vault entry [using the current way] or if you change to use 1 vault entry just include PlayerClass[] in the saved data. Code:
As you can see, data is being saved using your code: http://img.photobucket.com/albums/v2...ona/nvault.jpg |
Re: nVault won save, Please help :)
Thank you for your help, but I am really noob to this Pawn thing :P
I need to save xp and lvl to playerclasses of steamID. (Like Warcraft mod) Ie. Steam:0:0:342423525-CLASS_BHOPPER-XP 302 Steam:0:0:342423525-CLASS_BHOPPER-Level 3 Steam:0:0:342423525-CLASS_BHOPPER-XP 120 Steam:0:0:342423525-CLASS_BHOPPER-Level 1 And That is what I don't know how to do :( And is "*.vault" located in "data/" or "data/vault/" ? I am very sorry for all those noob requests and questions :P Regards ReTaRD |
Re: nVault won save, Please help :)
data/vault/hns-xp-mod.vault
That is fine but you need to think of the logic here. You are trying to use PlayerClass[id] to load data when a player connects. This value will ALWAYS be 0 so you need some other method of storing class. Think of it this way, when the player disconnects it will save PlayerClass as you wish: STEAMID-2-XP but then you try to load it using PlayerClass [this value will be 0 on a newly connecting player] when the player re-connects, your nvault_get key will be STEAMID-0-XP. See how this method will not work? You should also set all player variables to 0 on disconnect so they aren't accidentally used for the next player that connects in that slot. Consider saving data in this format. When the player connects, you just parse out the data and assign it to the appropriate variables. Key=STEAM_0:0:12345 Data=90:1:1 [XP, level, class] PHP Code:
|
Re: nVault won save, Please help :)
Why do you write iXP[id] when I already have PlayerXP[id] ? :|
I feel very stupid atm :P And if you do this: Key=STEAM_0:0:12345 Data=90:1:1 [XP, level, class] Then it can't save xp to one class then another, right? :? I would think more like: Key=STEAM_0:0:12345-Class1 Data=90:1:1 [XP, level] Key=STEAM_0:0:12345-Class2 Data=90:1:1 [XP, level] I can see the 0 problem, but it will not loadXP() until a class is picked and then the PlayerClass[id] won't be 0 - Right? Regards ReTaRD |
| All times are GMT -4. The time now is 01:35. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.