Raised This Month: $ Target: $400
 0% 

Load data from other file not from vault.ini


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hip_hop_x
Senior Member
Join Date: Apr 2006
Old 06-13-2006 , 06:22   Load data from other file not from vault.ini
Reply With Quote #1

Code:
public SaveXP(id)     {     new ip[32];     new vaultkey[64], vaultdata[64];       new configDir[128];     get_user_ip(id, ip, 31, 1)                 format(gXpfile, 127, "%s/xu/lvl.ini", configDir);       format(vaultkey,63,"Xu mod-%s-class",ip);       format(vaultdata,63,"%d",PlayerClass[id]);       set_vaultdata(vaultkey,vaultdata);           format(vaultkey,63,"'Xu mod-%s-xp",ip);       format(vaultdata,63,"%d",PlayerXP[id]);       set_vaultdata(vaultkey,vaultdata);           format(vaultkey,63,"Xu mod-%s-level",ip);       format(vaultdata,63,"%d",PlayerLevel[id]);       set_vaultdata(vaultkey,vaultdata); }   public LoadXP(id)     {     new ip[32];     new configDir[128];     new vaultkey[64], vaultdata[64];           get_user_ip(id, ip, 31, 1)             get_datadir(configDir, 127);     format(gXpfile, 127, "%s/xu/lvl.ini", configDir);         format(vaultkey,63,"Xu mod-%s-class",ip);       get_vaultdata(vaultkey,vaultdata,63);       PlayerClass[id] = str_to_num(vaultdata);           format(vaultkey,63,"Xu mod-%s-xp",ip);       get_vaultdata(vaultkey,vaultdata,63);       PlayerXP[id] = str_to_num(vaultdata);             format(vaultkey,63,"Xu mod-%s-level",ip);       get_vaultdata(vaultkey,vaultdata,63);     PlayerLevel[id] = str_to_num(vaultdata);     }

How to load the data from other file?

I think i should chage get_vaultdata with other, but i don't know with what.
hip_hop_x is offline
Send a message via MSN to hip_hop_x Send a message via Yahoo to hip_hop_x
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 06-13-2006 , 07:42  
Reply With Quote #2

you have to code it manually using file natives.
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
hip_hop_x
Senior Member
Join Date: Apr 2006
Old 06-13-2006 , 08:55  
Reply With Quote #3

I don't know how to code it manually.
hip_hop_x is offline
Send a message via MSN to hip_hop_x Send a message via Yahoo to hip_hop_x
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 06-13-2006 , 12:51  
Reply With Quote #4

theres not much of a point in using a file besides the vault.
You could switch to nVault, its just as easy as using the vault and its a lot faster. Check out the nVault include file.
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
hip_hop_x
Senior Member
Join Date: Apr 2006
Old 06-13-2006 , 17:55  
Reply With Quote #5

Code:
public SaveXP(id)       {       new ip[32];     new vaultkey[64], vaultdata[64];       get_user_ip(id, ip, 31, 1)                     format(vaultkey,63,"Xu mod - %s - class",ip);       format(vaultdata,63,"%d",PlayerClass[id]);       nvault_set(vaultkey, vaultdata)           format(vaultkey,63,"'Xu mod - %s - xp",ip);       format(vaultdata,63,"%d",PlayerXP[id]);       nvault_set(vaultkey,vaultdata);             format(vaultkey,63,"Xu mod - %s - level",ip);       format(vaultdata,63,"%d",PlayerLevel[id]);       nvault_set(vaultkey,vaultdata);   }   public LoadXP(id)       {       new ip[32];     new vaultkey[64], vaultdata[64];             get_user_ip(id, ip, 31, 1)                 format(vaultkey,63,"Xu mod - %s - class",ip);       nvault_get(vaultkey,vaultdata,63);       PlayerClass[id] = str_to_num(vaultdata);             format(vaultkey,63,"Xu mod - %s - xp",ip);       nvault_get(vaultkey,vaultdata,63);       PlayerXP[id] = str_to_num(vaultdata);               format(vaultkey,63,"Xu mod - %s -level",ip);       nvault_get(vaultkey,vaultdata,63);       PlayerLevel[id] = str_to_num(vaultdata);             }

I get error from nvault_set. How can i fix it, or i must use set_vaultdata?
hip_hop_x is offline
Send a message via MSN to hip_hop_x Send a message via Yahoo to hip_hop_x
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 06-13-2006 , 18:03  
Reply With Quote #6

You have to give it a vault handle

Code:
//Sets a vault value (with current timestamp) native nvault_set(vault, const key[], const value[]);

you have to open a vault file in your plugin_init (or somewhere) using this

Code:
//Opens a vault by name (such as "myvault") //Returns a vault id, INVALID_HANDLE otherwise (-1) native nvault_open(const name[]);

Examples:

Code:
new myvault; public plugin_init() {      crap      blah      myvault = nvault_open("XP_nVault") } somefunction() {      nvault_set(myvault, vaultkey, vaultdata) }
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
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 20:33.


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