Raised This Month: $ Target: $400
 0% 

How to get the data from file? (Is correct what i did ?)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hip_hop_x
Senior Member
Join Date: Apr 2006
Old 06-11-2006 , 12:33   How to get the data from file? (Is correct what i did ?)
Reply With Quote #1

Before plugin_init() i have added: new gXpfile[128] for gXpfile

Code:
public saveXp(id) {     new vaultkey[64], vaultdata[64];               new configDir[128]         format(gXpfile,127,"%s/xu/lvl.ini",configDir)         format(vaultkey,63,"Xu mod-class");       format(vaultdata,63,"%d",PlayerClass[id]);       set_vaultdata(vaultkey,vaultdata);

I want to load xp from %s/xu/lvl.ini from config directory.



Code:
public LoadXp(id) {     new vaultkey[64], vaultdata[64];       get_datadir(gXpfile,127,"%s/xu/lvl.ini",configDir)         format(vaultkey,63,"Xu mod-class");       get_vaultdata(vaultkey,vaultdata,63);       PlayerClass[id] = str_to_num(vaultdata);


Is it correct ?
hip_hop_x is offline
Send a message via MSN to hip_hop_x Send a message via Yahoo to hip_hop_x
rain
Senior Member
Join Date: Oct 2004
Location: Poland
Old 06-11-2006 , 14:01  
Reply With Quote #2

Nah, decide if you want it from vault or from file.

And don't use this:
Code:
new configDir[128] format(gXpfile,127,"%s/xu/lvl.ini",configDir) get_datadir(gXpfile,127,"%s/xu/lvl.ini",configDir)

rather sth like:
Code:
new configDir[128]; // config, thought it was data? :) get_datadir(configDir, 127); format(gXpfile, 127, "%s/xu/lvl.ini", configDir);

And then operate on gXpfile.
__________________

Last edited by rain; 10-07-2007 at 10:07.
rain is offline
hip_hop_x
Senior Member
Join Date: Apr 2006
Old 06-11-2006 , 15:32  
Reply With Quote #3

Thx rain!
hip_hop_x is offline
Send a message via MSN to hip_hop_x Send a message via Yahoo to hip_hop_x
Reply


Thread Tools
Display Modes

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 08:09.


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