Raised This Month: $51 Target: $400
 12% 

[INC] Savev - Old Style of save data


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
grs4
Senior Member
Join Date: Dec 2010
Location: Poland
Old 08-25-2012 , 14:11   [INC] Savev - Old Style of save data
Reply With Quote #1

Hi everybady, first im sorry for my bad english, because from Poland, and
im partly use translate.google.pl(.en) to translate to english (im 14 old)

Im create this save to my mod.

This save like nvault.

What do they function
PHP Code:
SaveData(const file[], const key[], const data[]) 
Save data[] to file[] to key[] i.e:
PHP Code:
new nick[33
get_user_name(idnick32
LoadData("file.txt"nick"Data"
PHP Code:
LoadData(const file[], const key[], data[], len
Load data from file[] from key[] to data[] lenght len i.e:
PHP Code:
new nick[33], data[33
get_user_name(idnick32
LoadData("file.txt"nickdata32
PHP Code:
DeleteData(const file[], const key[]) 
Delete data from file[] from key[] i.e:
PHP Code:
new nick[33
get_user_name(idnick32
DeleteData("file.txt"nick
PHP Code:
const file[] 
- file name with extension: "file.txt"
PHP Code:
const key[] 
- Key, after which a saved :
PHP Code:
const data[] 
- What must save / What is load.
PHP Code:
len 
- how many are saved (only in LoadData)

File is created in: addons/amxmodx/Save_v2/file_name.extension
How to use this:
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <savev>
#include <fun>

#define PLUGIN "Save"
#define VERSION "1.0"
#define AUTHOR "tomcionek15 & grs4"

new file[] = "player_frags.txt"
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /save""Save")
    
register_clcmd("say /load""Load")
    
}
public 
Save(id)
{
    new 
nick[33], data[64]
    
get_user_name(idnick32)
    
formatex(data63"%d %d %d %d"get_user_frags(id), get_user_deaths(id), get_user_health(id), get_user_armor(id))
   
SaveData(filenickdata)
}
public 
Load(id)
{
    new 
nick[33], data[64]
    
get_user_name(idnick32)
    
LoadData(filenickdata63)
    
    new 
fg[5], dg[5], zg[5], ag[5]
    
parse(datafg5dg,5zg5ag5)
    
    
client_print(id3"Last result")
    
client_print(id3"%d kills and you died %dx,"str_to_num(fg), str_to_num(dg))
    
client_print(id3"had %d HP, i %d AP"str_to_num(zg), str_to_num(ag))

this is effect:

/zapisz = /save
Last resoult:
You have 1 kill, 4 deads, 98 HP, 0 AP
/wczytaj = /load

content of the file : Save_v2/player_frags.txt :

"STRIKER--McPr0 " "1 4 98 0"// kill, deads, hp, armor
.inc file in attachament
and used .sma

===

All what im doing, im doing for people
Attached Files
File Type: sma Get Plugin or Get Source (test.sma - 819 views - 1.1 KB)
File Type: inc savev.inc (1.6 KB, 342 views)
grs4 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-25-2012 , 14:22   Re: [INC] Savev - Old Style of save data
Reply With Quote #2

This is redundant with the existing saving methods that exist. This is almost the same as set/get_vaultdata except you allow specifying a file-name.
__________________

Last edited by Bugsy; 08-25-2012 at 14:22.
Bugsy is offline
grs4
Senior Member
Join Date: Dec 2010
Location: Poland
Old 08-25-2012 , 14:24   Re: [INC] Savev - Old Style of save data
Reply With Quote #3

You must interactive set data in quotes
IN nvault you dont set data because This file is in use
grs4 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-25-2012 , 14:43   Re: [INC] Savev - Old Style of save data
Reply With Quote #4

I'm not referring to nvault, I'm referring to the regular vault natives which store data in plain text in the format of "KEY[TAB]DATA".

Data is stored in data\vault\vault.ini

set_vaultdata
get_vaultdata
remove_vaultdata
delete_vaultdata
vaultdata_exists
__________________

Last edited by Bugsy; 08-25-2012 at 15:42.
Bugsy is offline
grs4
Senior Member
Join Date: Dec 2010
Location: Poland
Old 08-25-2012 , 17:53   Re: [INC] Savev - Old Style of save data
Reply With Quote #5

Ok, im nothing have to nvualt, i slowly go to the target

Last edited by grs4; 08-25-2012 at 17:53.
grs4 is offline
.BaTmaN
New Member
Join Date: Aug 2012
Old 08-26-2012 , 14:36   Re: [INC] Savev - Old Style of save data
Reply With Quote #6

is Nice
.BaTmaN is offline
aaarnas
Veteran Member
Join Date: Jun 2008
Location: Lithuania
Old 08-27-2012 , 13:12   Re: [INC] Savev - Old Style of save data
Reply With Quote #7

If you saving info to file, you may add feature to store much more information, not only data[].
It's nvault negative side, that with one key you can save only one thing.
__________________
My plugins:
[ZP] ZM_VIP (v2.0.0 is comming. v1.9.1 BETA is out!)


Last edited by aaarnas; 08-27-2012 at 13:12.
aaarnas is offline
grs4
Senior Member
Join Date: Dec 2010
Location: Poland
Old 08-28-2012 , 12:03   Re: [INC] Savev - Old Style of save data
Reply With Quote #8

'll Work on it
grs4 is offline
csaba1998
Member
Join Date: Mar 2013
Old 11-10-2014 , 01:10   Re: [INC] Savev - Old Style of save data
Reply With Quote #9

Can I use to my mode, grs4?
Is it works, when I save data to player id?
csaba1998 is offline
grs4
Senior Member
Join Date: Dec 2010
Location: Poland
Old 02-05-2015 , 06:04   Re: [INC] Savev - Old Style of save data
Reply With Quote #10

It have to. ;p
grs4 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 08:46.


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