Przecież to nie twój plugin więc dlaczego sma nie chciałeś podać?
//ZAPIS KASY
public plugin_cfg()
{
g_Vault = nvault_open( "forsa" );
//Make the plugin error if vault did not successfully open
if ( g_Vault == INVALID_HANDLE )
set_fail_state( "Error opening nVault" );
//This will remove all entries in the vault that are 5+ (or cvar+) days old at server-start
//or map-change
nvault_prune( g_Vault , 0 , get_systime() - ( 86400 * get_pcvar_num( g_pExpireDays ) ) );
}
public plugin_end()
{
//Close the vault when the plugin ends (map change\server shutdown\restart)
nvault_close( g_Vault );
}
public client_disconnect(id)
{
//Save a single item into the value of the entry.
//Example: STEAM_0:0:1234 16000
new szMoney[7]; //Data holder for the money amount
new szKey[40]; //Key used to save money "STEAM_0:0:1234MONEY"
formatex( szKey , 39 , "%sMONEY" , g_szAuthID[id] );
formatex( szMoney , 6 , "%d" , cs_get_user_money(id) );
nvault_set( g_Vault , szKey , szMoney );
// client_print( id , print_chat , "* Your money was saved to vault" );
}
public client_putinserver(id)
{
//Retrieve a single item from vault
//Example: STEAM_0:0:1234 16000
new szKey[40];
formatex( szKey , 39 , "%sMONEY" , g_szAuthID[id] );
new iMoney = nvault_get( g_Vault , szKey );
//If our money key was found, set the users money to the value we read from vault and
//delete the key so the player will not get the same money again.
if ( iMoney )
{
cs_set_user_money( id , iMoney , 1 );
nvault_remove( g_Vault , szKey );
client_print( id , print_chat , "* Your money was loaded from vault: $%d" , iMoney );
}
else
{
client_print( id , print_chat , "* You have no money entry in vault." );
}
}
w plugin_init usun komendy bo zapewne sa
Użytkownik kyku edytował ten post 07.05.2010 10:40