Raised This Month: $51 Target: $400
 12% 

Frag_Saver


Post New Thread Reply   
 
Thread Tools Display Modes
Contrenature
Member
Join Date: Nov 2008
Location: Latvia, Liepaya, Riga
Old 06-21-2009 , 18:02   Re: Frag_Saver
Reply With Quote #21

Nvault sux...
Our community support only Sql
There nothing specily.
Contrenature is offline
Send a message via Skype™ to Contrenature
-Acid-
Senior Member
Join Date: Feb 2009
Old 06-21-2009 , 19:08   Re: Frag_Saver
Reply With Quote #22

Did you read the description??
>:[ Contrenature
__________________
-Acid- is offline
[-X-ViSi0N]
Member
Join Date: Jul 2009
Old 07-23-2009 , 23:14   Re: Frag_Saver
Reply With Quote #23

I love this plugins... can you make it save BOT frags too? because BOT don't save their frags... and I want death to be saved too.... and I also want the frags saved by nickname... can you help me?
[-X-ViSi0N] is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-24-2009 , 00:38   Re: Frag_Saver
Reply With Quote #24

Quote:
Originally Posted by [-X-ViSi0N] View Post
I love this plugins... can you make it save BOT frags too? because BOT don't save their frags... and I want death to be saved too.... and I also want the frags saved by nickname... can you help me?
This will save real players frags by steam-id and bots frags by name. Saving all players frags by name makes no sense because any player can change their name to acquire another players frags.

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

new g_szKey33 ][ 33 ];
new 
boolg_bSaveFrags33 ];
new 
g_iFrags33 ];
new 
g_pEnabled;
new 
g_pSaveBots;
new 
g_iVault;

new const 
g_szVaultFile[] = "frag_saver";

public 
plugin_init()
{
    
register_plugin"Frag_Saver" "2.0" "-Acid-" );
    
    
register_event"ScoreInfo" "fwEvScoreInfo" "a" );
    
    
g_pEnabled register_cvar"fs_enabled" "1" );
    
g_pSaveBots register_cvar"fs_savebots" "1" );
}

public 
plugin_cfg()
{
    
g_iVault nvault_openg_szVaultFile );

    if ( 
g_iVault == INVALID_HANDLE )
        
set_fail_state"Error opening nVault" );
}

public 
plugin_end()
{
    
nvault_closeg_iVault );
}

public 
client_putinserverid )
{
    if ( !
get_pcvar_numg_pEnabled ) )
        return 
PLUGIN_CONTINUE;
        
    static 
iFrags;
    static 
iBotiBot is_user_botid );
    
    
g_bSaveFragsid ] = bool: ( !iBot || ( iBot && get_pcvar_numg_pSaveBots ) ) );
    
    if ( 
g_bSaveFragsid ] )
    {
        if ( 
iBot )
            
get_user_nameid g_szKeyid ] , 32 );
        else
            
get_user_authidid g_szKeyid ] , 32 );
    
        
iFrags nvault_getg_iVault g_szKeyid ] );
        
        if ( 
iFrags )
        {
            
g_iFragsid ] = iFrags;
            
set_user_fragsid iFrags );
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
client_disconnectid )
{
    if ( !
get_pcvar_numg_pEnabled ) )
        return 
PLUGIN_CONTINUE;
        
    static 
szFrags];
    
    if ( 
g_iFragsid ] )
    {
        
num_to_strg_iFrags[id] , szFrags );
        
nvault_setg_iVault g_szKeyid ] , szFrags );
    
        
g_iFragsid ] = 0;
        
g_bSaveFragsid ] = false;
        
g_szKeyid ][ ] = 0;
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
fwEvScoreInfo()
{
    static 
idid read_data);
    
    if ( !
get_pcvar_numg_pEnabled ) || !g_bSaveFragsid ] )
        return 
PLUGIN_CONTINUE;
        
    static 
iFragsiFrags read_data);
        
    if ( !
iFrags && g_iFragsid ] )
    {
        
set_user_fragsid g_iFragsid ] );
        return 
PLUGIN_CONTINUE;
    }
    
    
g_iFragsid ] = iFrags;
    
    return 
PLUGIN_CONTINUE;

__________________

Last edited by Bugsy; 07-24-2009 at 10:15.
Bugsy is offline
[-X-ViSi0N]
Member
Join Date: Jul 2009
Old 07-24-2009 , 02:56   Re: Frag_Saver
Reply With Quote #25

Thanks.... it would be better if Deaths also saved!

How do you save deaths? I try reverse the Frags to Deaths but it failed... can someone help?

Last edited by [-X-ViSi0N]; 07-24-2009 at 08:37.
[-X-ViSi0N] is offline
algoasi
Member
Join Date: Nov 2008
Location: Pluton
Old 07-24-2009 , 22:08   Re: Frag_Saver
Reply With Quote #26

great plugin ... but the deaths should also save
algoasi is offline
Send a message via MSN to algoasi
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-25-2009 , 10:26   Re: Frag_Saver
Reply With Quote #27

Save kills & deaths with bot support

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

#define OFFSET_CSDEATHS            444
#define fm_set_user_deaths(%1,%2)    set_pdata_int( %1, OFFSET_CSDEATHS, %2, 5)  

new g_szKey33 ][ 33 ];
new 
boolg_bSaveScore33 ];
new 
g_iFrags33 ];
new 
g_iDeaths33 ];
new 
g_pEnabled;
new 
g_pSaveBots;
new 
g_iVault;

new const 
g_szVaultFile[] = "score_saver";

public 
plugin_init()
{
    
register_plugin"Score Saver" "1.0" "bugsy" );
    
    
register_event"ScoreInfo" "fwEvScoreInfo" "a" );
    
    
g_pEnabled register_cvar"fs_enabled" "1" );
    
g_pSaveBots register_cvar"fs_savebots" "1" );
}

public 
plugin_cfg()
{
    
g_iVault nvault_openg_szVaultFile );

    if ( 
g_iVault == INVALID_HANDLE )
        
set_fail_state"Error opening nVault" );
}

public 
plugin_end()
{
    
nvault_closeg_iVault );
}

public 
client_putinserverid )
{
    if ( !
get_pcvar_numg_pEnabled ) )
        return 
PLUGIN_CONTINUE;
        
    static 
iBotiBot is_user_botid );
    static 
szVaultData10 ] , szFrags] , szDeaths] , iTimestamp;
    
    
g_bSaveScoreid ] = bool: ( !iBot || ( iBot && get_pcvar_numg_pSaveBots ) ) );
    
    if ( 
g_bSaveScoreid ] )
    {
        if ( 
iBot )
            
get_user_nameid g_szKeyid ] , 32 );
        else
            
get_user_authidid g_szKeyid ] , 32 );
    
        if ( 
nvault_lookupg_iVault g_szKeyid ] , szVaultData iTimestamp ) )
        {
            
strbreakszVaultData szFrags szDeaths );
            
            
g_iFragsid ] = str_to_numszFrags );
            
g_iDeathsid ] = str_to_numszDeaths );
            
            
//I tested the plugin using PodBots and I was getting a server crash at mapchange
            //when trying to call SetScore at putinserver(). This seems to have fixed it.
            
set_task0.1 "SetScore" id );
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
client_disconnectid )
{
    if ( !
get_pcvar_numg_pEnabled ) )
        return 
PLUGIN_CONTINUE;
        
    static 
szVaultData10 ];
    
    if ( 
g_iFragsid ] || g_iDeathsid ] )
    {
        
formatexszVaultData "%d %d" g_iFragsid ] , g_iDeathsid ] );
        
        
nvault_setg_iVault g_szKeyid ] , szVaultData );
    
        
g_szKeyid ][ ] = EOS;
        
g_iFragsid ] = 0;
        
g_iDeathsid ] = 0;
        
g_bSaveScoreid ] = false;
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
fwEvScoreInfo()
{
    static 
idid read_data);
    
    if ( !
get_pcvar_numg_pEnabled ) || !g_bSaveScoreid ] )
        return 
PLUGIN_CONTINUE;
        
    static 
iFragsiFrags read_data);
    static 
iDeathsiDeaths read_data);
    
    if ( ( !
iFrags && !iDeaths ) && ( g_iFragsid ] || g_iDeathsid ] ) )
    {
        
SetScoreid );
        
        return 
PLUGIN_CONTINUE;
    }
    
    
g_iFragsid ] = iFrags;
    
g_iDeathsid ] = iDeaths;
    
    return 
PLUGIN_CONTINUE;
}

public 
SetScoreid )
{
    
fm_set_user_fragsid g_iFragsid ] );
    
fm_set_user_deathsid g_iDeathsid ] );

__________________
Bugsy is offline
[-X-ViSi0N]
Member
Join Date: Jul 2009
Old 07-25-2009 , 23:49   Re: Frag_Saver
Reply With Quote #28

Quote:
Originally Posted by Bugsy View Post
Save kills & deaths with bot support

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

#define OFFSET_CSDEATHS            444
#define fm_set_user_deaths(%1,%2)    set_pdata_int( %1, OFFSET_CSDEATHS, %2, 5)  

new g_szKey33 ][ 33 ];
new 
boolg_bSaveScore33 ];
new 
g_iFrags33 ];
new 
g_iDeaths33 ];
new 
g_pEnabled;
new 
g_pSaveBots;
new 
g_iVault;

new const 
g_szVaultFile[] = "score_saver";

public 
plugin_init()
{
    
register_plugin"Score Saver" "1.0" "bugsy" );
    
    
register_event"ScoreInfo" "fwEvScoreInfo" "a" );
    
    
g_pEnabled register_cvar"fs_enabled" "1" );
    
g_pSaveBots register_cvar"fs_savebots" "1" );
}

public 
plugin_cfg()
{
    
g_iVault nvault_openg_szVaultFile );

    if ( 
g_iVault == INVALID_HANDLE )
        
set_fail_state"Error opening nVault" );
}

public 
plugin_end()
{
    
nvault_closeg_iVault );
}

public 
client_putinserverid )
{
    if ( !
get_pcvar_numg_pEnabled ) )
        return 
PLUGIN_CONTINUE;
        
    static 
iBotiBot is_user_botid );
    static 
szVaultData10 ] , szFrags] , szDeaths] , iTimestamp;
    
    
g_bSaveScoreid ] = bool: ( !iBot || ( iBot && get_pcvar_numg_pSaveBots ) ) );
    
    if ( 
g_bSaveScoreid ] )
    {
        if ( 
iBot )
            
get_user_nameid g_szKeyid ] , 32 );
        else
            
get_user_authidid g_szKeyid ] , 32 );
    
        if ( 
nvault_lookupg_iVault g_szKeyid ] , szVaultData iTimestamp ) )
        {
            
strbreakszVaultData szFrags szDeaths );
            
            
g_iFragsid ] = str_to_numszFrags );
            
g_iDeathsid ] = str_to_numszDeaths );
            
            
//I tested the plugin using PodBots and I was getting a server crash at mapchange
            //when trying to call SetScore at putinserver(). This seems to have fixed it.
            
set_task0.1 "SetScore" id );
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
client_disconnectid )
{
    if ( !
get_pcvar_numg_pEnabled ) )
        return 
PLUGIN_CONTINUE;
        
    static 
szVaultData10 ];
    
    if ( 
g_iFragsid ] || g_iDeathsid ] )
    {
        
formatexszVaultData "%d %d" g_iFragsid ] , g_iDeathsid ] );
        
        
nvault_setg_iVault g_szKeyid ] , szVaultData );
    
        
g_szKeyid ][ ] = EOS;
        
g_iFragsid ] = 0;
        
g_iDeathsid ] = 0;
        
g_bSaveScoreid ] = false;
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
fwEvScoreInfo()
{
    static 
idid read_data);
    
    if ( !
get_pcvar_numg_pEnabled ) || !g_bSaveScoreid ] )
        return 
PLUGIN_CONTINUE;
        
    static 
iFragsiFrags read_data);
    static 
iDeathsiDeaths read_data);
    
    if ( ( !
iFrags && !iDeaths ) && ( g_iFragsid ] || g_iDeathsid ] ) )
    {
        
SetScoreid );
        
        return 
PLUGIN_CONTINUE;
    }
    
    
g_iFragsid ] = iFrags;
    
g_iDeathsid ] = iDeaths;
    
    return 
PLUGIN_CONTINUE;
}

public 
SetScoreid )
{
    
fm_set_user_fragsid g_iFragsid ] );
    
fm_set_user_deathsid g_iDeathsid ] );

I tired this one... it only save frags, and it doesn't save deaths,

why don't make 2 seperate plugins...
1. Frag saver + bot support
2. Death saver + bot support
[-X-ViSi0N] is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-26-2009 , 10:25   Re: Frag_Saver
Reply With Quote #29

Quote:
Originally Posted by [-X-ViSi0N] View Post
I tired this one... it only save frags, and it doesn't save deaths,
It works for me (tested with podbots)
__________________
Bugsy is offline
[-X-ViSi0N]
Member
Join Date: Jul 2009
Old 07-27-2009 , 05:49   Re: Frag_Saver
Reply With Quote #30

well it doesn;t save my deaths, even bot's deaths too, I'll try to RE-compile again...
[-X-ViSi0N] 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 06:19.


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