Raised This Month: $ Target: $400
 0% 

I need help with nVault


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GolfCart
Junior Member
Join Date: Jun 2013
Old 06-26-2016 , 13:23   I need help with nVault
Reply With Quote #1

Hello, I use nVault and I have some problems. First let me post the codes.

Here is code when I want to restart kills...
PHP Code:
register_clcmd("say /resetall""RestartUbistava"); 
And here is "RestartUbistava" code...
PHP Code:
public RestartUbistava(id)
{
    
nvault_prune(g_vault0get_systime() - 1);
    
server_cmd("changelevel de_dust2");

And now, problem is that when I use /resetall command it reset every entrie except my. Is that cuz I have admin flags or something? Please, I need fast answer.

Last edited by GolfCart; 06-26-2016 at 15:29. Reason: [Solved]
GolfCart is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 06-26-2016 , 13:37   Re: I need help with nVault
Reply With Quote #2

PHP Code:
nvault_prune(g_vault0get_systime() - 1
PHP Code:
nvault_prune(g_vault0get_systime() + 1
Try it
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 06-26-2016 at 13:38.
EFFx is offline
GolfCart
Junior Member
Join Date: Jun 2013
Old 06-26-2016 , 13:40   Re: I need help with nVault
Reply With Quote #3

Quote:
Originally Posted by EFFx View Post
PHP Code:
nvault_prune(g_vault0get_systime() - 1
PHP Code:
nvault_prune(g_vault0get_systime() + 1
Try it
Same problem.
GolfCart is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 06-26-2016 , 14:04   Re: I need help with nVault
Reply With Quote #4

Quote:
Originally Posted by GolfCart View Post
Same problem.
post the hole code.
__________________
JusTGo is offline
GolfCart
Junior Member
Join Date: Jun 2013
Old 06-26-2016 , 14:14   Re: I need help with nVault
Reply With Quote #5

PHP Code:
#include <amxmodx>
#include <nvault>  

new g_vault;

public 
plugin_init() { 
    
register_clcmd("say /resetall""RestartUbistava");
    
    
g_vault nvault_open("KnifeSystem");
    if(
g_vault== INVALID_HANDLEset_fail_state("Greska pri otvaranju gVaulta");  
}

public 
client_putinserver(id)
{
    
LoadData(id)
}

public 
client_disconnect(id)
{
    
SaveData(id)
}

public 
SaveData(id

    new 
AuthID[35
    
get_user_authid(id,AuthID,34)
    new 
vaultkey[64],vaultdata[256
 
    
format(vaultkey,63,"%s-Knife",AuthID
    
format(vaultdata,255,"%i",ubistva_igraca[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-Knife",AuthID
    
format(vaultdata,255,"%i",ubistva_igraca[id]) 
    
    
nvault_get(g_vault,vaultkey,vaultdata,255
    
replace_all(vaultdata255"#"" "
    new 
ubistva[32]
    
parse(vaultdataubistva31
    
ubistva_igraca[id] = str_to_num(ubistva
    return 
PLUGIN_CONTINUE 
}  

public 
plugin_end()
{
    
nvault_close(g_vault)
}

public 
RestartUbistava(id)
{
    
nvault_prune(g_vault0get_systime() + 1)
    
ColorChat(0NORMAL"^4[Knife Mod] ^1Administrator je restartovao ubistva svim igracima.");
    
server_cmd("changelevel de_dust2");

There is also other part of code but it's not connected to this problem.

Last edited by GolfCart; 06-26-2016 at 14:14.
GolfCart is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 06-26-2016 , 14:49   Re: I need help with nVault
Reply With Quote #6

Use

PHP Code:
public RestartUbistava(id)
{
    new 
szPlayers[32],iNum
    get_players
(szPlayers,iNum)
    for(new 
iNumi++)
    {
          
ubistva_igraca[players[i]] = 0
    
}
    
nvault_prune(g_vault0get_systime() + 1)
    
ColorChat(0NORMAL"^4[Knife Mod] ^1Administrator je restartovao ubistva svim igracima.");

    
server_cmd("changelevel de_dust2");

nvault_prune delete all knives saved on g_vault. So you need just reset for alive players.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 06-26-2016 at 14:50.
EFFx is offline
GolfCart
Junior Member
Join Date: Jun 2013
Old 06-26-2016 , 15:28   Re: I need help with nVault
Reply With Quote #7

Quote:
Originally Posted by EFFx View Post
nvault_prune delete all knives saved on g_vault. So you need just reset for alive players.
Case solved, thank you.
GolfCart is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-26-2016 , 20:52   Re: I need help with nVault
Reply With Quote #8

get_systime() - 1 and get_systime() + 1 makes no sense and serves no purpose as this just adds or removes 1 second from the current time. You should just do nvault_prune( g_vault , 0 , get_systime() ).
__________________
Bugsy is offline
GolfCart
Junior Member
Join Date: Jun 2013
Old 06-27-2016 , 08:35   Re: I need help with nVault
Reply With Quote #9

Quote:
Originally Posted by Bugsy View Post
get_systime() - 1 and get_systime() + 1 makes no sense and serves no purpose as this just adds or removes 1 second from the current time. You should just do nvault_prune( g_vault , 0 , get_systime() ).
Yeah, I figured it out already by taking a look on your nVault thread. Thanks.
Here is the working code..
PHP Code:
public RestartujUbistva()
{
    new 
iPlayer[32], iNum
    get_players
(iPlayeriNum)
    for(new 
iiNumi++) 
    {
        
ubistva_igraca[iPlayer[i]] = 0;
    }
    
nvault_prune(g_vault0get_systime())
    
server_cmd("changelevel de_dust2");
    return 
PLUGIN_CONTINUE


Last edited by GolfCart; 06-27-2016 at 08:36.
GolfCart 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 09:54.


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