Raised This Month: $ Target: $400
 0% 

nVault won save, Please help :)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-14-2009 , 11:22   Re: nVault won save, Please help :)
Reply With Quote #9

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:
formatexszData 10 "%d:%d:%d" iXP[id] , iLevel[id], iClass[id] );
nvault_setg_Vault g_szAuthID[id] , szData ); 
__________________

Last edited by Bugsy; 05-14-2009 at 11:30.
Bugsy is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:36.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode