Raised This Month: $ Target: $400
 0% 

nvault.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 01-19-2020 , 13:47   Re: nvault.
Reply With Quote #4

Quote:
Originally Posted by Napoleon_be View Post
Okay so my second thought wasn't good either, thanks for explaining. Could u tell me what's wrong in my first code which doesn't save or load my values properly?
Code:
public client_disconnect(id) {     new szAuth[35], szTemp[60];     get_user_authid(id, szAuth, charsmax(szAuth));         formatex(szTemp, charsmax(szTemp), "%i#%i#%i", iPoints[id], iTsKilled[id], iCtKilled[id]);         nvault_set(szVaultName, szAuth, szTemp); } get_user_authid() should not be called until client_authorized() public client_connect(id) {     new szAuth[35], szTemp[60], szTsKills[33], szCtKills[33], szPoints[33];     get_user_authid(id, szAuth, charsmax(szAuth));         It makes no sense to format this string since it gets immediately overwritten with what nvault_get() retrieves from the vault     formatex(szTemp, charsmax(szTemp), "%i#%i#%i", iPoints[id], iTsKilled[id], iCtKilled[id]);     nvault_get(szVaultName, szAuth, szTemp);         replace_all(szTemp, charsmax(szTemp), "#", " ");     You are missing the szCtKills variable before charsmax(szCtKills)     parse(szTemp, szTsKills, charsmax(szTsKills), charsmax(szCtKills), szPoints, charsmax(szPoints));         iTsKilled[id] = str_to_num(szTsKills);     iCtKilled[id] = str_to_num(szCtKills);     iPoints[id] = str_to_num(szPoints); }
__________________
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 02:40.


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