From 4d1d2b5527198095121a83b2d1a05aed2e727b5a Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Tue, 3 Aug 2004 20:36:33 +0000 Subject: [PATCH] better code style --- plugins/stats_logging.sma | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/plugins/stats_logging.sma b/plugins/stats_logging.sma index 144869d3..150ef663 100755 --- a/plugins/stats_logging.sma +++ b/plugins/stats_logging.sma @@ -38,47 +38,46 @@ new g_pingSum[33] new g_pingCount[33] -public plugin_init() +public plugin_init() { register_plugin("CS Stats Logging",AMXX_VERSION_STR,"AMXX Dev Team") +} public client_disconnect(id) { - if ( is_user_bot( id ) ) return PLUGIN_CONTINUE - remove_task( id ) + if ( is_user_bot(id) ) return PLUGIN_CONTINUE + remove_task(id) new szTeam[16],szName[32],szAuthid[32], iStats[8], iHits[8], szWeapon[24] new iUserid = get_user_userid( id ) get_user_team(id, szTeam, 15 ) get_user_name(id, szName ,31 ) get_user_authid(id, szAuthid , 31 ) - for(new i = 1 ; i < 31 ; ++i ) { - if( get_user_wstats( id , i ,iStats , iHits ) ) { - + for (new i = 1 ; i < 31 ; ++i ) { + if ( get_user_wstats( id , i ,iStats , iHits ) ) { if ( i == CSW_HEGRENADE) copy(szWeapon[7],16,"grenade") else get_weaponname( i , szWeapon , 23 ) - + log_message("^"%s<%d><%s><%s>^" triggered ^"weaponstats^" (weapon ^"%s^") (shots ^"%d^") (hits ^"%d^") (kills ^"%d^") (headshots ^"%d^") (tks ^"%d^") (damage ^"%d^") (deaths ^"%d^")", szName,iUserid,szAuthid,szTeam,szWeapon[7],iStats[4],iStats[5],iStats[0], iStats[2],iStats[3],iStats[6],iStats[1]) log_message("^"%s<%d><%s><%s>^" triggered ^"weaponstats2^" (weapon ^"%s^") (head ^"%d^") (chest ^"%d^") (stomach ^"%d^") (leftarm ^"%d^") (rightarm ^"%d^") (leftleg ^"%d^") (rightleg ^"%d^")", szName,iUserid,szAuthid,szTeam,szWeapon[7],iHits[1],iHits[2],iHits[3], iHits[4],iHits[5],iHits[6],iHits[7]) } } - new iTime = get_user_time( id , 1 ) + new iTime = get_user_time(id,1) log_message("^"%s<%d><%s><%s>^" triggered ^"time^" (time ^"%d:%02d^")", szName,iUserid,szAuthid,szTeam, (iTime / 60), (iTime % 60) ) log_message("^"%s<%d><%s><%s>^" triggered ^"latency^" (ping ^"%d^")", szName,iUserid,szAuthid,szTeam, (g_pingSum[id] / ( g_pingCount[id] ? g_pingCount[id] : 1 ) ) ) - return PLUGIN_CONTINUE } public client_putinserver(id) { - if ( !is_user_bot( id ) ){ + if ( !is_user_bot(id) ) { g_pingSum[ id ] = g_pingCount[ id ] = 0 set_task( 19.5 , "getPing" , id , "" , 0 , "b" ) } } -public getPing( id ) { +public getPing(id) { new iPing, iLoss get_user_ping( id , iPing, iLoss) g_pingSum[ id ] += iPing