[API] Advanced Vault System 1.5 (12/06/2015)
Me Enseñan A Activar Esto En Mi Servidor XFAAAAAAA Soy Nuevo En Esto Y Este Plugin Estilo Mod Se Ve Muy Bueno  Ragestart

Pero Cuando Compilo Me Sale Un Error El Siguiente ::
----> /tmp/textx8YMdl.sma(59) : fatal error 100: cannot read from file: "adv_vault"

Quien Me Ayuda XFA  Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry Cutecry 
Responder
Hi, sorry i don't speak Spanish, but can you show us how to correctly make a prune system using this advanced Vault? I see there is no prune native in .inc.
Thank you.
Responder
(27/07/2021, 09:40 AM)ggsabb escribió: Hi, sorry i don't speak Spanish, but can you show us how to correctly make a prune system using this advanced Vault? I see there is no prune native in .inc.
Thank you.

It's easy man, I let u an example. But, try to speak in spanish here, it is a spanish forum.
My english level is bad, but i made this...

Código PHP:
// Im tired, when I have time I'll add 'Accounts System Menu', meanwhile about when we have enter to server our data gonna be loaded
// and data gonna be saved when you has disconnected or every new round

#include <amxmodx>
#include <amxmisc>
#include <adv_vault>
#include <cstrike>
#include <hamsandwich>

// Task which we call every second that we playing
#define TASK_CS 65900
#define ID_TASK (taskid - TASK_CS)

#define POST 1 // Just put 1 on that shit and delete this :p

// Some plugin shits
new const Plugin[] = "Adv-Vault - Simple System";
new const 
Version[] = "1.0";
new const 
Creator[] = "Emanuelitop15";
new const 
Account_Folder[] = "ADV-VAULT [ACCOUNTS]" // Folder which we save the data

// Enums (enumeradores *aprende español*)
enum
{
    
NO_ACCOUNT 0,
    
REGISTERED,
    
PLAYING
};
enum
{
    
PASS,
    
PLAYED_TIME,
    
MAX_FIELDS
};

// variables
new g_time_played[33];
new 
g_field[MAX_FIELDS], g_vault;
new 
g_acc_name[33][32], g_acc_pw[33][21], g_status[33];
new 
g_max_players;

public 
plugin_init()
{
    
register_plugin(PluginVersionCreator);
    
register_event("HLTV""event_round_start""a""1=0""2=0"); // We have to save the data every new round UwU (at least if server crashes, we don't lost too much data)
    
register_clcmd("say /time_here""clcmd_playing"); // This is a little check, to comprobar (wtf you say this in english) if the saved data is okay
    //RegisterHam(Ham_Spawn, "player", "player_spawn_post", POST); // We set the status account's player in PLAYING when spawns on the map;
    
    // We "create the accounts", which gonna be saved in this folder: Account_Folder
    
g_vault adv_vault_open(Account_Foldertrue);
    
g_field[PASS] = adv_vault_register_field(g_vault"Password"DATATYPE_STRINGcharsmax(g_acc_pw[]));
    
g_field[PLAYED_TIME] = adv_vault_register_field(g_vault"Time Played");
    
adv_vault_init(g_vault);

    
g_max_players get_maxplayers();
}

public 
client_putinserver(id)
{
    
// The way that we use to save the data of one or more players
    // need to be saved in some place, so that place is the name of that / those player(s)
    
get_user_name(idg_acc_name[id], charsmax(g_acc_name[])); // Now we gotta the name, now we have to load accounts
    // g_acc_pw[id][0] = '^0';
    // no matter if he/she is not register, this is neccesary
    
load_data(id);
    
// If we have the name in the registered accounts, data gonna be loaded

    // Our playing time...
    
set_task(1.0"playing_cs"id+TASK_CS__"b");
}

public 
client_disconnected(id)
{
    
remove_task(id+TASK_CS); // Are we still playing???
    
save_data(id); // When we left the game, data needs to be saved, so SAVE IT BITCHHHH
}

// Some day when the 'Accounts System Menu' has been incorporated, you'd have to delete this shit
public event_round_start() for (new player 1player <= g_max_playersplayer++) g_status[player] = PLAYINGsave_data(player);

load_data(id)
{
    if (!
adv_vault_get_prepare(g_vault_g_acc_name[id])) // If she/him isn't register yet,
    // we put her/his status account in NO_ACCOUNT and we load default
    // variables (i don't know how to say this in english xd)  
    
{
        
g_status[id] = NO_ACCOUNT;
        
g_time_played[id] = 0;
        return;
    }
    else 
// If we have saved data, we load it...
    
{
        
g_status[id] = REGISTERED// Now we know this player has an account and login menu will be different 
        
adv_vault_get_field(g_vaultg_field[PASS], g_acc_pw[id], charsmax(g_acc_pw[])); // Password
        
g_time_played[id] = adv_vault_get_field(g_vaultg_field[PLAYED_TIME]); // Time Played in the game
    
}
}

save_data(id)
{
    if (!
is_user_connected(id) || g_status[id] != PLAYING// He/She isn't connected or is not registered, we don't save data 
        
return;

    
adv_vault_set_start(g_vault); // We load our data
    
adv_vault_set_field(g_vaultg_field[PLAYED_TIME], g_time_played[id]);
    
adv_vault_set_end(g_vault0g_acc_name[id]); // And, all is finish here...

    
client_print(idprint_console"[ADV-VAULT SIMPLE] Your data was saved successfully!");
}

public 
playing_cs(taskid)
{
    static 
idid ID_TASK;

    if (!
is_user_connected(id) || cs_get_user_team(id) == CS_TEAM_SPECTATOR || cs_get_user_team(id) == CS_TEAM_UNASSIGNED /* is this neccesary now ?*/)
        return;

    
// We accumulate the time that we play here...
    
g_time_played[id]++; 
}

public 
clcmd_playing(id)
{
    if (!
g_time_played[id]) return;
    
client_print_color(idprint_team_default"^3[ADV-VAULT - SIMPLE]^1 You playing time here is^4 %s^1 seconds!"add_point(g_time_played[id]));
}

stock add_point(number)

    new 
countistr[29], str2[35], lennum_to_str(numberstrcharsmax(str));
    
len strlen(str);
    
    for (
0leni++)
    {
        if (
!= && ((len i) %== 0))
        {
            
add(str2charsmax(str2), "."1);
            
count++;
            
add(str2[i+count], 1str[i], 1);
        }
        else 
add(str2[i+count], 1str[i], 1);
    }
    return 
str2;


I hope it's works at least XD
___________________________________
SI NECESITAS UN PLUGIN TE LO HAGO $$$
COMUNICATE A MI DISCORD: Emanuelitop15#5005
Responder
Hi, sorry to say, i think you misunderstood what i mean. What i mean is something like nvault_prune: https://www.amxmodx.org/api/nvault/nvault_prune

Thank you.
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)