cleaned revision for cstrike plugins
This commit is contained in:
parent
a816767abb
commit
324f4c58a8
@ -50,5 +50,5 @@
|
|||||||
* Returning cellmin as value in get_score function
|
* Returning cellmin as value in get_score function
|
||||||
* makes that rank won't be saved. */
|
* makes that rank won't be saved. */
|
||||||
|
|
||||||
public get_score( stats[8] , body[8] )
|
public get_score(stats[8], body[8])
|
||||||
return stats[0] - stats[1] - stats[3] // kills - deaths - teamkills
|
return stats[0] - stats[1] - stats[3] // kills - deaths - teamkills
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -18,12 +18,12 @@
|
|||||||
* General Public License for more details.
|
* General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software Foundation,
|
* along with this program; if not, write to the Free Software Foundation,
|
||||||
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*
|
*
|
||||||
* In addition, as a special exception, the author gives permission to
|
* In addition, as a special exception, the author gives permission to
|
||||||
* link the code of this program with the Half-Life Game Engine ("HL
|
* link the code of this program with the Half-Life Game Engine ("HL
|
||||||
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
|
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
|
||||||
* L.L.C ("Valve"). You must obey the GNU General Public License in all
|
* L.L.C ("Valve"). You must obey the GNU General Public License in all
|
||||||
* respects for all of the code used other than the HL Engine and MODs
|
* respects for all of the code used other than the HL Engine and MODs
|
||||||
* from Valve. If you modify this file, you may extend this exception
|
* from Valve. If you modify this file, you may extend this exception
|
||||||
@ -38,46 +38,60 @@
|
|||||||
new g_pingSum[33]
|
new g_pingSum[33]
|
||||||
new g_pingCount[33]
|
new g_pingCount[33]
|
||||||
|
|
||||||
public plugin_init() {
|
public plugin_init()
|
||||||
register_plugin("CS Stats Logging",AMXX_VERSION_STR,"AMXX Dev Team")
|
{
|
||||||
|
register_plugin("CS Stats Logging", AMXX_VERSION_STR, "AMXX Dev Team")
|
||||||
}
|
}
|
||||||
|
|
||||||
public client_disconnect(id) {
|
public client_disconnect(id)
|
||||||
if ( is_user_bot(id) ) {
|
{
|
||||||
return
|
if (is_user_bot(id))
|
||||||
}
|
{
|
||||||
remove_task(id)
|
return
|
||||||
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 )
|
remove_task(id)
|
||||||
get_user_name(id, szName ,31 )
|
|
||||||
get_user_authid(id, szAuthid , 31 )
|
new szTeam[16], szName[32], szAuthid[32], iStats[8], iHits[8], szWeapon[24]
|
||||||
for (new i = 1 ; i < 31 ; ++i ) {
|
new iUserid = get_user_userid(id)
|
||||||
if ( get_user_wstats( id , i ,iStats , iHits ) ) {
|
|
||||||
xmod_get_wpnname( i , szWeapon , 23 )
|
get_user_team(id, szTeam, 15)
|
||||||
log_message("^"%s<%d><%s><%s>^" triggered ^"weaponstats^" (weapon ^"%s^") (shots ^"%d^") (hits ^"%d^") (kills ^"%d^") (headshots ^"%d^") (tks ^"%d^") (damage ^"%d^") (deaths ^"%d^")",
|
get_user_name(id, szName, 31)
|
||||||
szName,iUserid,szAuthid,szTeam,szWeapon,iStats[4],iStats[5],iStats[0], iStats[2],iStats[3],iStats[6],iStats[1])
|
get_user_authid(id, szAuthid, 31)
|
||||||
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,iHits[1],iHits[2],iHits[3], iHits[4],iHits[5],iHits[6],iHits[7])
|
for (new i = 1 ; i < 31 ; ++i)
|
||||||
}
|
{
|
||||||
}
|
if (get_user_wstats(id, i, iStats, iHits))
|
||||||
new iTime = get_user_time(id,1)
|
{
|
||||||
log_message("^"%s<%d><%s><%s>^" triggered ^"time^" (time ^"%d:%02d^")",
|
xmod_get_wpnname(i, szWeapon, 23)
|
||||||
szName,iUserid,szAuthid,szTeam, (iTime / 60), (iTime % 60) )
|
|
||||||
log_message("^"%s<%d><%s><%s>^" triggered ^"latency^" (ping ^"%d^")",
|
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, (g_pingSum[id] / ( g_pingCount[id] ? g_pingCount[id] : 1 ) ) )
|
szName, iUserid, szAuthid, szTeam, szWeapon, 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, iHits[1], iHits[2], iHits[3], iHits[4], iHits[5], iHits[6], iHits[7])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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)))
|
||||||
}
|
}
|
||||||
|
|
||||||
public client_putinserver(id) {
|
public client_putinserver(id)
|
||||||
if ( !is_user_bot(id) ) {
|
{
|
||||||
g_pingSum[ id ] = g_pingCount[ id ] = 0
|
if (!is_user_bot(id))
|
||||||
set_task( 19.5 , "getPing" , id , "" , 0 , "b" )
|
{
|
||||||
}
|
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)
|
new iPing, iLoss
|
||||||
g_pingSum[ id ] += iPing
|
|
||||||
++g_pingCount[ id ]
|
get_user_ping(id, iPing, iLoss)
|
||||||
|
g_pingSum[id] += iPing
|
||||||
|
++g_pingCount[id]
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user