 |
|
Thinkosaur
|

08-17-2012
, 14:18
Re: Save to .ini or .txt files
|
#2
|
Quote:
Originally Posted by Randomize
Can someone make this save to .ini or .txt file?
PHP Code:
g_vault = nvault_open("animod")
//we just opened a new connection NVAULT connection
// we will call it animod
register_clcmd("say /rank", "ShowHud")
register_clcmd("say_team /rank", "ShowHud")
}
public client_connect(id)
{
if(get_pcvar_num(SavePoint) == 1)
{
LoadData(id)
}
if(get_pcvar_num(SaveExp) == 1)
{
LoadData(id)
}
}
public client_disconnect(id)
{
if(get_pcvar_num(SavePoint) == 1)
{
SaveData(id)
}
if(get_pcvar_num(SaveExp) == 1)
{
SaveData(id)
}
PlayerPoint[id] = 0
PlayerExp[id] = 0
}
public SaveData(id)
{
new AuthID[35]
get_user_authid(id,AuthID,34)
new vaultkey[64],vaultdata[256]
format(vaultkey,63,"%s-Mod",AuthID)
format(vaultdata,255,"%i#%i#",PlayerPoint[id],PlayerExp[id])
nvault_set(g_vault,vaultkey,vaultdata)
return PLUGIN_CONTINUE
}
public LoadData(id)
{
new AuthID[35]
get_user_authid(id,AuthID,34)
new vaultkey[64],vaultdata[256]
format(vaultkey,63,"%s-Mod",AuthID)
format(vaultdata,255,"%i#%i#",PlayerPoint[id],PlayerExp[id])
nvault_get(g_vault,vaultkey,vaultdata,255)
replace_all(vaultdata, 255, "#", " ")
new playerpoint[32], playerexp[32]
parse(vaultdata, playerpoint, 31, playerexp, 31)
PlayerPoint[id] = str_to_num(playerpoint)
PlayerExp[id] = str_to_num(playerexp)
return PLUGIN_CONTINUE
}
|
There is no reason saving them in .txt file but thats your problem. Since you can't do this yourself this is more of request than "scripting help".
Why do you want to save in .txt file?
So correct section:
Suggestions / Requests
( Don't repost )
__________________
Accepting all kinds of requests via private message.
Last edited by matsi; 08-17-2012 at 14:18.
|
|
|
|