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

Frag_Saver


Post New Thread Reply   
 
Thread Tools Display Modes
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-22-2009 , 23:33   Re: Frag_Saver
Reply With Quote #11

Having trouble with what
__________________
Bugsy is offline
-Acid-
Senior Member
Join Date: Feb 2009
Old 05-22-2009 , 23:40   Re: Frag_Saver
Reply With Quote #12

To save the deaths too.
__________________
-Acid- is offline
orange
Senior Member
Join Date: Dec 2005
Old 05-23-2009 , 03:16   Re: Frag_Saver
Reply With Quote #13

why cant u just use sqlite instead of nvault ?
__________________
orange is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-23-2009 , 08:13   Re: Frag_Saver
Reply With Quote #14

Here is most of the work. You just need to add the g_iDeaths[33] array and then either add cstrike module or fakemeta code to set user deaths.

Score will be saved in kills:deaths format.

If 10 kills and 5 deaths, "10:5".

Save kills and deaths
PHP Code:
new szSave[10];
formatexszSave "%d:%d" g_iFrags[id] , g_iDeaths[id] );
nvault_setg_iVault g_szAuthID[id] , szSave 
Load kills and deaths
PHP Code:
new szSave[10];
    
if ( 
nvault_getg_iVault g_szAuthID[id] , szSave ) )
{
    new 
iSep containszSave ":" );
        
    if ( 
iSep > -)
    {
        
g_iDeaths[id] = str_to_numszSave[iSep+1] );
        
szSave[iSep] = 0;
        
g_iFrags[id] = str_to_numszSave );
    }

Your ScoreInfo forward (actually mine since I'm pretty sure I wrote all of this code originally) should look something like this:
PHP Code:
public fwEvScoreInfo()
{
    if ( !
get_pcvar_numg_pEnabled ) )
        return 
PLUGIN_CONTINUE;
    
    new 
id read_data);
    new 
iFrags read_data);
    new 
iDeaths read_data);
    
    
//The server resets scores at mapchange so this will set the players score [if g_iFrags[] > 0].
    
if ( ( !iFrags && g_iFragsid ] ) || ( !iDeaths && g_iDeathsid ] ) )
    {
        
set_user_fragsid g_iFragsid ] );
        
set_pdata_int idOFFSET_CSDEATHSg_iDeathsid ] );
        
cmdUpdateScoreBoardid );
        return 
PLUGIN_CONTINUE;
    }
    
    
g_iFragsid ] = iFrags;
    
g_iDeathsid ] = iDeaths;
    
    return 
PLUGIN_CONTINUE;

__________________
Bugsy is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 05-23-2009 , 19:20   Re: Frag_Saver
Reply With Quote #15

I don't see how this is necessary, due to mine supporting SQLite, but good job anyway.
__________________
In Flames we trust!
Nextra is offline
csl
Member
Join Date: Apr 2009
Old 05-23-2009 , 21:04   Re: Frag_Saver
Reply With Quote #16

Quote:
I don't see how this is necessary, due to mine supporting SQLite, but good job anyway.
u must fix it a bit ....
csl is offline
KadiR
Unnecessary Member
Join Date: Aug 2008
Location: Zürich / Switzerland
Old 05-24-2009 , 12:41   Re: Frag_Saver
Reply With Quote #17

http://forums.alliedmods.net/showthread.php?p=784573

?
KadiR is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-24-2009 , 12:43   Re: Frag_Saver
Reply With Quote #18

A plugin with identical functionality already exists (your plugin) so this plugin is redundant, but why does SQLite make it better? This may be a little more CPU friendly being it doesn't rely on SQL.
__________________

Last edited by Bugsy; 05-24-2009 at 12:57.
Bugsy is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 05-24-2009 , 15:50   Re: Frag_Saver
Reply With Quote #19

I'm not saying mine is better or that his is poorly done, just that Vault does not make that much of a difference.

Quote:
Originally Posted by csl View Post
u must fix it a bit ....
I know, I wish I had already found the problem you described.
__________________
In Flames we trust!
Nextra is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 06-21-2009 , 13:40   Re: Frag_Saver
Reply With Quote #20

Since cmdUpdateScoreBoard never called, you can remove it.
__________________
xPaw 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 08:41.


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