Raised This Month: $ Target: $400
 0% 

nvault save & loading


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 10-09-2015 , 13:20   nvault save & loading
Reply With Quote #1

Okay so i made this saving & loading but it seems to cut off the first letter in both steamid and name.
Anyone knows why?

Code:
SnusMumrikeN :  /load

nusMumrikeN TEAM_0:0:38415370
Code:
#include <amxmodx>
#include <nvault>
#include <colorchat>

#define PLUGIN "test save & load"
#define VERSION "1.0"
#define AUTHOR "ironskillz1"

new g_vault 

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_clcmd("say /save", "SaveData")
	register_clcmd("say /load", "LoadData")
	g_vault = nvault_open("test")
}

public SaveData(id)
{
	new vaultkey[33], name[33]
	get_user_authid(id, vaultkey, charsmax(vaultkey))
	get_user_name(id, name, charsmax(name))

	new vaultdata[256]
	formatex(vaultdata, charsmax(vaultdata), "%s %s", name[id], vaultkey[id])
	nvault_set(g_vault, vaultkey, vaultdata)
}

public LoadData(id)
{
	new vaultkey[33]
	get_user_authid(id, vaultkey, charsmax(vaultkey))

	new vaultdata[256]
	nvault_get(g_vault, vaultkey, vaultdata, charsmax(vaultdata))

	new name[33], steamid[33]
	parse(vaultdata, name, charsmax(name), steamid, charsmax(steamid))

	ColorChat( 0, GREY, "%s %s", name, steamid);
}
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
 



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 22:14.


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