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

[HELP] Save Roundscore in vault


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
extream87
Senior Member
Join Date: Aug 2011
Old 06-24-2013 , 02:42   [HELP] Save Roundscore in vault
Reply With Quote #1

Someone can help me to save roundscore in vault and load it when i want?

I have this:

Code:
#include < amxmodx > #include < nvault > new g_Vault; new g_Score[ 2 ]; public plugin_init( ) {     register_message( get_user_msgid( "TextMsg" ), "Message_TextMsg" );     g_Vault = nvault_open( "Score" ); }     public Message_TextMsg( ) {     static Text[ 32 ];     get_msg_arg_string( 2, Text, charsmax( Text ) );     if( equal( Text, "#Terrorists_Win" ) )         g_Score[ 0 ]++;     else if( equal( Text, "#CTs_Win" ) )         g_Score[ 1 ]++; } public plugin_end( ) {     SaveScore( ); // This called when map end and server desactivated     nvault_close( g_Vault ); } SaveScore( ) {     static Data[ 64 ], Name[ 32 ], Frags[ 2 ], Deaths[ 2 ];     for( new Index = 1; Index <= get_maxplayers( ); Index++ )     {         switch( get_user_team( Index ) )         {             case 0:             {                 copy( Name, charsmax( Name ), "Terrorists" );                             Frags[ 0 ] = get_user_frags( Index );                                 Deaths[ 0 ] = get_user_deaths( Index );             }             case 1:             {                 copy( Name, charsmax( Name ), "Counter-Terrorists" );                 Frags[ 1 ] = get_user_frags( Index );                 Deaths[ 1 ] = get_user_deaths( Index );             }         }         formatex( Data, charsmax( Data ), "%d | %d | %d", g_Score[ get_user_team( Index ) ], Frags[ get_user_team( Index ) ], Deaths[ get_user_team( Index ) ] );         nvault_set( g_Vault, Name, Data );     }    }

Last edited by extream87; 06-24-2013 at 02:45.
extream87 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:05.


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