Raised This Month: $ Target: $400
 0% 

Save to .ini or .txt files


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
matsi
Thinkosaur
Join Date: Sep 2006
Old 08-17-2012 , 14:18   Re: Save to .ini or .txt files
Reply With Quote #2

Quote:
Originally Posted by Randomize View Post
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(vaultdata255"#"" ")
 
    new 
playerpoint[32], playerexp[32]
 
    
parse(vaultdataplayerpoint31playerexp31)
 
    
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.
matsi is offline
 



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 05:44.


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