Raised This Month: $ Target: $400
 0% 

How can detect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 10-07-2009 , 09:43   How can detect
Reply With Quote #1

how can i detect how many frags player has on server ? And when he has like 70 kill on server change his hp , grav , speed. ? And when he logs on again in server he stills has new hp , grav , speed .
DoviuX is offline
Send a message via Skype™ to DoviuX
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 10-07-2009 , 09:49   Re: How can detect
Reply With Quote #2

get_user_frags
__________________
alan_el_more is offline
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
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 22:40.


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