Raised This Month: $ Target: $400
 0% 

usage of nvault


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Speed!
BANNED
Join Date: Jan 2009
Old 02-04-2009 , 12:43   Re: usage of nvault
Reply With Quote #1

Quote:
Originally Posted by TheRadiance View Post
PHP Code:
...
#include <amxmodx>
#include <nvault>
...
new 
name[32], fData[16];
get_user_name(idnamesizeof (name) - 1);
format(fDatasizeof (fData) - 1"^"0^" ^"1^" ^"2^" ^"0^"");

new 
nvault nvault_open("nvault_name");
nvault_set(nvaultnamefData);
nvault_close(nvault);
... 
PHP Code:
...
new 
name[32], fData[16];
get_user_name(idnamesizeof (name) - 1);

new 
nvault nvault_open("nvault_name");
nvault_get(nvaultnamefDatasizeof (fData) - 1); - /* After this you will have all player's data in variable "fData" */
nvault_close(nvault);

new 
fVal[2], fVal2[2], fVal3[2], fVal4[2];
parse(fDatafValsizeof (fVal) - 1fVal2sizeof (fVal2) - 1fVal3sizeof (fVal3) - 1fVal4sizeof (fVal4) - 1); - /* After this you will have every value from "fData" in the allocated variable. */
... 
thank you very much
its really easy and usefull
Speed! is offline
Speed!
BANNED
Join Date: Jan 2009
Old 02-04-2009 , 16:52   Re: usage of nvault
Reply With Quote #2

how should i use this
PHP Code:
    new name[32], fData[16]
    
get_user_name(idnamesizeof (name) - 1)
    
    new 
nvault nvault_open("nvault_zp")
    
nvault_get(nvaultnamefDatasizeof (fData) - 1)
    
nvault_close(nvault)
    
    new 
fVal[2], fVal2[2], fVal3[2], fVal4[2]
    
parse(fDatafValsizeof (fVal) - 1fVal2sizeof (fVal2) - 1fVal3sizeof (fVal3) - 1fVal4sizeof (fVal4) - 1)
    
g_lvlhp[id] = fVal
    g_lvlspeed
[id] = fVal2
    g_lvlgravity
[id] = fVal3
    g_lvlremaining
[id] = fVal4 
i mean because of the "must be assigned to an array"
i want g_lvlhp and them, to be the number saved. ie 2 but fVal2 is a string.

edit: done i think (str_to_num)

Last edited by Speed!; 02-04-2009 at 16:56.
Speed! is offline
Reply



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:39.


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