Raised This Month: $ Target: $400
 0% 

How can detect


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 10-07-2009 , 11:09   Re: How can detect
Reply With Quote #3

You could do something like this:

Code:
#include < amxmodx > #include < fun > #include < nvault > new const VERSION[ ] = "0.1.0"; new g_iVault; new g_pFrags[ 33 ]; new g_pSteamID[ 33 ][ 35 ]; new g_iMaxPlayers; public plugin_init( ) {     register_plugin( "Frag Checker", VERSION, "Xellath" );         register_event( "DeathMsg", "eventDeath", "a" );         g_iMaxPlayers = get_maxplayers( ); } public plugin_cfg( ) {     new const szVaultname[ ] = "fragchecker";         g_iVault = nvault_open( szVaultname );         if ( g_iVault == INVALID_HANDLE )         set_fail_state( "Error opening nVault" ); } public plugin_end( ) {     nvault_close( g_iVault ); } public client_putinserver( iClient ) {     loadFrags( iClient );         checkFrags( iClient ); } public client_authorized( iClient ) {     get_user_authid( iClient, g_pSteamID[ iClient ], 34 ); } public client_disconnect( iClient ) {     saveFrags( iClient );         g_pFrags[ iClient ] = 0; } public eventDeath( ) {     static iAttacker, iVictim;         iAttacker = read_data( 1 );     iVictim = read_data( 2 );         if ( 1 <= iAttacker <= g_iMaxPlayers )     {         if ( iVictim != iAttacker )         {             g_pFrags[ iAttacker ]++;                         //checkFrags( iAttacker );         }     } } public checkFrags( iClient ) {     if ( g_pFrags[ iClient ] > 70 )     {         // Your code     } } public saveFrags( iClient ) {     static szData[ 256 ], szKey[ 36 ];         formatex( szData, 255, "%i", g_pFrags[ iClient ] );     formatex( szKey, 35, "%s", g_pSteamID[ iClient ] );         nvault_set( g_iVault, szKey, szData ); } public loadFrags( iClient ) {     static szData[ 256 ], szKey[ 36 ], szFrags[ 10 ];         formatex( szData, 255, "%i", g_pFrags[ iClient ] );     formatex( szKey, 35, "%s", g_pSteamID[ iClient ] );         nvault_get( g_iVault, szKey, szData, 255 );     parse( szData, szFrags, 9 );     g_pFrags[ iClient ] = str_to_num( szFrags ); }
__________________
Achievements API - a simple way for you to create your OWN custom achievements!

Last edited by Xellath; 10-08-2009 at 10:13.
Xellath is offline
 



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 22:40.


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