Add stat constants in plugins (#522)
* Add stat constants in plugins * Add missing include in dodstats.sma * Fix misplaced HIT_RIGHTLEG constant
This commit is contained in:
parent
56e8dcf3d5
commit
189f16fcc4
|
@ -33,5 +33,5 @@
|
|||
* Returning cellmin as value in get_score function
|
||||
* makes that rank won't be saved. */
|
||||
|
||||
public get_score(stats[11], body[8])
|
||||
return stats[0] - stats[1] - stats[3] // kills - deaths - teamkills
|
||||
public get_score(stats[11], body[MAX_BODYHITS])
|
||||
return stats[STATSX_KILLS] - stats[STATSX_DEATHS] - stats[STATSX_TEAMKILLS] // kills - deaths - teamkills
|
||||
|
|
|
@ -37,7 +37,7 @@ public client_disconnected(id)
|
|||
|
||||
remove_task(id)
|
||||
|
||||
new szTeam[16], szName[MAX_NAME_LENGTH], szAuthid[32], iStats[8], iHits[8], szWeapon[24]
|
||||
new szTeam[16], szName[MAX_NAME_LENGTH], szAuthid[32], iStats[STATSX_MAX_STATS], iHits[MAX_BODYHITS], szWeapon[24]
|
||||
new iUserid = get_user_userid(id)
|
||||
new _max = xmod_get_maxweapons()
|
||||
|
||||
|
@ -52,9 +52,9 @@ public client_disconnected(id)
|
|||
xmod_get_wpnname(i, szWeapon, charsmax(szWeapon))
|
||||
|
||||
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, iStats[4], iStats[5], iStats[0], iStats[2], iStats[3], iStats[6], iStats[1])
|
||||
szName, iUserid, szAuthid, szTeam, szWeapon, iStats[STATSX_SHOTS], iStats[STATSX_HITS], iStats[STATSX_KILLS], iStats[STATSX_HEADSHOTS], iStats[STATSX_TEAMKILLS], iStats[STATSX_DAMAGE], iStats[STATSX_DEATHS])
|
||||
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])
|
||||
szName, iUserid, szAuthid, szTeam, szWeapon, iHits[HIT_HEAD], iHits[HIT_CHEST], iHits[HIT_STOMACH], iHits[HIT_LEFTARM], iHits[HIT_RIGHTARM], iHits[HIT_LEFTLEG], iHits[HIT_RIGHTLEG])
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -78,17 +78,8 @@ public SpecRankInfo = 0 // displays rank info when spectating
|
|||
#define MAX_TEXT_LENGTH 255
|
||||
#define MAX_BUFFER_LENGTH 2047
|
||||
|
||||
// User stats parms id
|
||||
#define STATS_KILLS 0
|
||||
#define STATS_DEATHS 1
|
||||
#define STATS_HS 2
|
||||
#define STATS_TKS 3
|
||||
#define STATS_SHOTS 4
|
||||
#define STATS_HITS 5
|
||||
#define STATS_DAMAGE 6
|
||||
|
||||
// Global player flags.
|
||||
new BODY_PART[8][] =
|
||||
new BODY_PART[MAX_BODYHITS][] =
|
||||
{
|
||||
"WHOLEBODY",
|
||||
"HEAD",
|
||||
|
@ -140,14 +131,14 @@ new g_pHudFreezeLimit = 0
|
|||
new Float:g_fStartGame = 0.0
|
||||
new g_izTeamScore[MAX_TEAMS] = {0, ...}
|
||||
new g_izTeamEventScore[MAX_TEAMS] = {0, ...}
|
||||
new g_izTeamRndStats[MAX_TEAMS][8]
|
||||
new g_izTeamGameStats[MAX_TEAMS][8]
|
||||
new g_izTeamRndStats[MAX_TEAMS][STATSX_MAX_STATS]
|
||||
new g_izTeamGameStats[MAX_TEAMS][STATSX_MAX_STATS]
|
||||
new g_izUserUserID[MAX_PLAYERS + 1] = {0, ...}
|
||||
new g_izUserAttackerDistance[MAX_PLAYERS + 1] = {0, ...}
|
||||
new g_izUserVictimDistance[MAX_PLAYERS + 1][MAX_PLAYERS + 1]
|
||||
new g_izUserRndName[MAX_PLAYERS + 1][MAX_NAME_LENGTH]
|
||||
new g_izUserRndStats[MAX_PLAYERS + 1][8]
|
||||
new g_izUserGameStats[MAX_PLAYERS + 1][8]
|
||||
new g_izUserRndStats[MAX_PLAYERS + 1][STATSX_MAX_STATS]
|
||||
new g_izUserGameStats[MAX_PLAYERS + 1][STATSX_MAX_STATS]
|
||||
|
||||
// Common buffer to improve performance, as Small always zero-initializes all vars
|
||||
new g_sBuffer[MAX_BUFFER_LENGTH + 1] = ""
|
||||
|
@ -291,14 +282,14 @@ public cmdHudTest(id)
|
|||
#endif
|
||||
|
||||
// Stats formulas
|
||||
Float:accuracy(izStats[8])
|
||||
Float:accuracy(izStats[STATSX_MAX_STATS])
|
||||
{
|
||||
return izStats[STATS_SHOTS] ? (100.0 * float(izStats[STATS_HITS]) / float(izStats[STATS_SHOTS])) : (0.0);
|
||||
return izStats[STATSX_SHOTS] ? (100.0 * float(izStats[STATSX_HITS]) / float(izStats[STATSX_SHOTS])) : (0.0);
|
||||
}
|
||||
|
||||
Float:effec(izStats[8])
|
||||
Float:effec(izStats[STATSX_MAX_STATS])
|
||||
{
|
||||
return izStats[STATS_KILLS] ? (100.0 * float(izStats[STATS_KILLS]) / float(izStats[STATS_KILLS] + izStats[STATS_DEATHS])) : (0.0);
|
||||
return izStats[STATSX_KILLS] ? (100.0 * float(izStats[STATSX_KILLS]) / float(izStats[STATSX_KILLS] + izStats[STATSX_DEATHS])) : (0.0);
|
||||
}
|
||||
|
||||
// Distance formula (metric)
|
||||
|
@ -332,7 +323,7 @@ get_config_cvars()
|
|||
// Get and format attackers header and list.
|
||||
get_attackers(id, sBuffer[MAX_BUFFER_LENGTH + 1])
|
||||
{
|
||||
new izStats[8], izBody[8]
|
||||
new izStats[STATSX_MAX_STATS], izBody[MAX_BODYHITS]
|
||||
new iAttacker
|
||||
new iFound, iLen
|
||||
|
||||
|
@ -342,13 +333,13 @@ get_attackers(id, sBuffer[MAX_BUFFER_LENGTH + 1])
|
|||
// Get and format header. Add killing attacker statistics if user is dead.
|
||||
// Make sure shots is greater than zero or division by zero will occur.
|
||||
// To print a '%', 4 of them must done in a row.
|
||||
izStats[STATS_SHOTS] = 0
|
||||
izStats[STATSX_SHOTS] = 0
|
||||
iAttacker = g_izKilled[id][KILLED_KILLER_ID]
|
||||
|
||||
if (iAttacker)
|
||||
get_user_astats(id, iAttacker, izStats, izBody)
|
||||
|
||||
if (izStats[STATS_SHOTS] && ShowFullStats)
|
||||
if (izStats[STATSX_SHOTS] && ShowFullStats)
|
||||
{
|
||||
get_user_name(iAttacker, t_sName, charsmax(t_sName))
|
||||
iLen = formatex(sBuffer, charsmax(sBuffer), "%L -- %s -- %0.2f%% %L:^n", id, "ATTACKERS", t_sName, accuracy(izStats), id, "ACC")
|
||||
|
@ -364,20 +355,20 @@ get_attackers(id, sBuffer[MAX_BUFFER_LENGTH + 1])
|
|||
iFound = 1
|
||||
get_user_name(iAttacker, t_sName, charsmax(t_sName))
|
||||
|
||||
if (izStats[STATS_KILLS])
|
||||
if (izStats[STATSX_KILLS])
|
||||
{
|
||||
if (!ShowDistHS)
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%s -- %d %L / %d %L / %s^n", t_sName, izStats[STATS_HITS], id, "HIT_S",
|
||||
izStats[STATS_DAMAGE], id, "DMG", t_sWpn)
|
||||
else if (izStats[STATS_HS])
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%s -- %d %L / %d %L / %s / %0.0f m / HS^n", t_sName, izStats[STATS_HITS], id, "HIT_S",
|
||||
izStats[STATS_DAMAGE], id, "DMG", t_sWpn, distance(g_izUserAttackerDistance[id]))
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%s -- %d %L / %d %L / %s^n", t_sName, izStats[STATSX_HITS], id, "HIT_S",
|
||||
izStats[STATSX_DAMAGE], id, "DMG", t_sWpn)
|
||||
else if (izStats[STATSX_HEADSHOTS])
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%s -- %d %L / %d %L / %s / %0.0f m / HS^n", t_sName, izStats[STATSX_HITS], id, "HIT_S",
|
||||
izStats[STATSX_DAMAGE], id, "DMG", t_sWpn, distance(g_izUserAttackerDistance[id]))
|
||||
else
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%s -- %d %L / %d %L / %s / %0.0f m^n", t_sName, izStats[STATS_HITS], id, "HIT_S",
|
||||
izStats[STATS_DAMAGE], id, "DMG", t_sWpn, distance(g_izUserAttackerDistance[id]))
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%s -- %d %L / %d %L / %s / %0.0f m^n", t_sName, izStats[STATSX_HITS], id, "HIT_S",
|
||||
izStats[STATSX_DAMAGE], id, "DMG", t_sWpn, distance(g_izUserAttackerDistance[id]))
|
||||
}
|
||||
else
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%s -- %d %L / %d %L^n", t_sName, izStats[STATS_HITS], id, "HIT_S", izStats[STATS_DAMAGE], id, "DMG")
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%s -- %d %L / %d %L^n", t_sName, izStats[STATSX_HITS], id, "HIT_S", izStats[STATSX_DAMAGE], id, "DMG")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -390,7 +381,7 @@ get_attackers(id, sBuffer[MAX_BUFFER_LENGTH + 1])
|
|||
// Get and format victims header and list
|
||||
get_victims(id, sBuffer[MAX_BUFFER_LENGTH + 1])
|
||||
{
|
||||
new izStats[8], izBody[8]
|
||||
new izStats[STATSX_MAX_STATS], izBody[MAX_BODYHITS]
|
||||
new iVictim
|
||||
new iFound, iLen
|
||||
|
||||
|
@ -400,10 +391,10 @@ get_victims(id, sBuffer[MAX_BUFFER_LENGTH + 1])
|
|||
// Get and format header.
|
||||
// Make sure shots is greater than zero or division by zero will occur.
|
||||
// To print a '%', 4 of them must done in a row.
|
||||
izStats[STATS_SHOTS] = 0
|
||||
izStats[STATSX_SHOTS] = 0
|
||||
get_user_vstats(id, 0, izStats, izBody)
|
||||
|
||||
if (izStats[STATS_SHOTS])
|
||||
if (izStats[STATSX_SHOTS])
|
||||
iLen = formatex(sBuffer, charsmax(sBuffer), "%L -- %0.2f%% %L:^n", id, "VICTIMS", accuracy(izStats), id, "ACC")
|
||||
else
|
||||
iLen = formatex(sBuffer, charsmax(sBuffer), "%L:^n", id, "VICTIMS")
|
||||
|
@ -415,20 +406,20 @@ get_victims(id, sBuffer[MAX_BUFFER_LENGTH + 1])
|
|||
iFound = 1
|
||||
get_user_name(iVictim, t_sName, charsmax(t_sName))
|
||||
|
||||
if (izStats[STATS_DEATHS])
|
||||
if (izStats[STATSX_DEATHS])
|
||||
{
|
||||
if (!ShowDistHS)
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%s -- %d %L / %d %L / %s^n", t_sName, izStats[STATS_HITS], id, "HIT_S",
|
||||
izStats[STATS_DAMAGE], id, "DMG", t_sWpn)
|
||||
else if (izStats[STATS_HS])
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%s -- %d %L / %d %L / %s / %0.0f m / HS^n", t_sName, izStats[STATS_HITS], id, "HIT_S",
|
||||
izStats[STATS_DAMAGE], id, "DMG", t_sWpn, distance(g_izUserVictimDistance[id][iVictim]))
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%s -- %d %L / %d %L / %s^n", t_sName, izStats[STATSX_HITS], id, "HIT_S",
|
||||
izStats[STATSX_DAMAGE], id, "DMG", t_sWpn)
|
||||
else if (izStats[STATSX_HEADSHOTS])
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%s -- %d %L / %d %L / %s / %0.0f m / HS^n", t_sName, izStats[STATSX_HITS], id, "HIT_S",
|
||||
izStats[STATSX_DAMAGE], id, "DMG", t_sWpn, distance(g_izUserVictimDistance[id][iVictim]))
|
||||
else
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%s -- %d %L / %d %L / %s / %0.0f m^n", t_sName, izStats[STATS_HITS], id, "HIT_S",
|
||||
izStats[STATS_DAMAGE], id, "DMG", t_sWpn, distance(g_izUserVictimDistance[id][iVictim]))
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%s -- %d %L / %d %L / %s / %0.0f m^n", t_sName, izStats[STATSX_HITS], id, "HIT_S",
|
||||
izStats[STATSX_DAMAGE], id, "DMG", t_sWpn, distance(g_izUserVictimDistance[id][iVictim]))
|
||||
}
|
||||
else
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%s -- %d %L / %d %L^n", t_sName, izStats[STATS_HITS], id, "HIT_S", izStats[STATS_DAMAGE], id, "DMG")
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%s -- %d %L / %d %L^n", t_sName, izStats[STATSX_HITS], id, "HIT_S", izStats[STATSX_DAMAGE], id, "DMG")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -448,23 +439,23 @@ get_kill_info(id, iKiller, sBuffer[MAX_BUFFER_LENGTH + 1])
|
|||
|
||||
if (iKiller && iKiller != id)
|
||||
{
|
||||
new izAStats[8], izABody[8], izVStats[8], iaVBody[8]
|
||||
new izAStats[STATSX_MAX_STATS], izABody[MAX_BODYHITS], izVStats[STATSX_MAX_STATS], iaVBody[MAX_BODYHITS]
|
||||
|
||||
iFound = 1
|
||||
get_user_name(iKiller, t_sName, charsmax(t_sName))
|
||||
|
||||
izAStats[STATS_HITS] = 0
|
||||
izAStats[STATS_DAMAGE] = 0
|
||||
izAStats[STATSX_HITS] = 0
|
||||
izAStats[STATSX_DAMAGE] = 0
|
||||
t_sWpn[0] = 0
|
||||
get_user_astats(id, iKiller, izAStats, izABody, t_sWpn, charsmax(t_sWpn))
|
||||
|
||||
izVStats[STATS_HITS] = 0
|
||||
izVStats[STATS_DAMAGE] = 0
|
||||
izVStats[STATSX_HITS] = 0
|
||||
izVStats[STATSX_DAMAGE] = 0
|
||||
get_user_vstats(id, iKiller, izVStats, iaVBody)
|
||||
|
||||
iLen = formatex(sBuffer, charsmax(sBuffer), "%L^n", id, "KILLED_YOU_DIST", t_sName, t_sWpn, distance(g_izUserAttackerDistance[id]))
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%L^n", id, "DID_DMG_HITS", izAStats[STATS_DAMAGE], izAStats[STATS_HITS], g_izKilled[id][KILLED_KILLER_HEALTH], g_izKilled[id][KILLED_KILLER_ARMOUR])
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%L^n", id, "YOU_DID_DMG", izVStats[STATS_DAMAGE], izVStats[STATS_HITS])
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%L^n", id, "DID_DMG_HITS", izAStats[STATSX_DAMAGE], izAStats[STATSX_HITS], g_izKilled[id][KILLED_KILLER_HEALTH], g_izKilled[id][KILLED_KILLER_ARMOUR])
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%L^n", id, "YOU_DID_DMG", izVStats[STATSX_DAMAGE], izVStats[STATSX_HITS])
|
||||
}
|
||||
|
||||
return iFound
|
||||
|
@ -482,11 +473,11 @@ add_most_disruptive(id, sBuffer[MAX_BUFFER_LENGTH + 1])
|
|||
// Find player.
|
||||
for (iPlayer = 1; iPlayer <= MaxClients; iPlayer++)
|
||||
{
|
||||
if (g_izUserRndStats[iPlayer][STATS_DAMAGE] >= iMaxDamage && (g_izUserRndStats[iPlayer][STATS_DAMAGE] > iMaxDamage || g_izUserRndStats[iPlayer][STATS_HS] > iMaxHeadShots))
|
||||
if (g_izUserRndStats[iPlayer][STATSX_DAMAGE] >= iMaxDamage && (g_izUserRndStats[iPlayer][STATSX_DAMAGE] > iMaxDamage || g_izUserRndStats[iPlayer][STATSX_HEADSHOTS] > iMaxHeadShots))
|
||||
{
|
||||
iMaxDamageId = iPlayer
|
||||
iMaxDamage = g_izUserRndStats[iPlayer][STATS_DAMAGE]
|
||||
iMaxHeadShots = g_izUserRndStats[iPlayer][STATS_HS]
|
||||
iMaxDamage = g_izUserRndStats[iPlayer][STATSX_DAMAGE]
|
||||
iMaxHeadShots = g_izUserRndStats[iPlayer][STATSX_HEADSHOTS]
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -499,7 +490,7 @@ add_most_disruptive(id, sBuffer[MAX_BUFFER_LENGTH + 1])
|
|||
new Float:fRndAcc = accuracy(g_izUserRndStats[iPlayer])
|
||||
|
||||
formatex(t_sText, charsmax(t_sText), "%L: %s^n%d %L / %d %L -- %0.2f%% %L / %0.2f%% %L^n", id, "MOST_DMG", g_izUserRndName[iPlayer],
|
||||
g_izUserRndStats[iPlayer][STATS_HITS], id, "HIT_S", iMaxDamage, id, "DMG", fGameEff, id, "EFF", fRndAcc, id, "ACC")
|
||||
g_izUserRndStats[iPlayer][STATSX_HITS], id, "HIT_S", iMaxDamage, id, "DMG", fGameEff, id, "EFF", fRndAcc, id, "ACC")
|
||||
add(sBuffer, charsmax(sBuffer), t_sText)
|
||||
}
|
||||
|
||||
|
@ -518,11 +509,11 @@ add_best_score(id, sBuffer[MAX_BUFFER_LENGTH + 1])
|
|||
// Find player
|
||||
for (iPlayer = 1; iPlayer <= MaxClients; iPlayer++)
|
||||
{
|
||||
if (g_izUserRndStats[iPlayer][STATS_KILLS] >= iMaxKills && (g_izUserRndStats[iPlayer][STATS_KILLS] > iMaxKills || g_izUserRndStats[iPlayer][STATS_HS] > iMaxHeadShots))
|
||||
if (g_izUserRndStats[iPlayer][STATSX_KILLS] >= iMaxKills && (g_izUserRndStats[iPlayer][STATSX_KILLS] > iMaxKills || g_izUserRndStats[iPlayer][STATSX_HEADSHOTS] > iMaxHeadShots))
|
||||
{
|
||||
iMaxKillsId = iPlayer
|
||||
iMaxKills = g_izUserRndStats[iPlayer][STATS_KILLS]
|
||||
iMaxHeadShots = g_izUserRndStats[iPlayer][STATS_HS]
|
||||
iMaxKills = g_izUserRndStats[iPlayer][STATSX_KILLS]
|
||||
iMaxHeadShots = g_izUserRndStats[iPlayer][STATSX_HEADSHOTS]
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -582,8 +573,8 @@ save_team_chatscore(id, sBuffer[MAX_TEXT_LENGTH + 1])
|
|||
// Get and format total stats.
|
||||
add_total_stats(id, sBuffer[MAX_BUFFER_LENGTH + 1])
|
||||
{
|
||||
formatex(t_sText, charsmax(t_sText), "%L: %d %L / %d hs -- %d %L / %d %L^n", id, "TOTAL", g_izUserRndStats[0][STATS_KILLS], id, "KILL_S",
|
||||
g_izUserRndStats[0][STATS_HS], g_izUserRndStats[0][STATS_HITS], id, "HITS", g_izUserRndStats[0][STATS_SHOTS], id, "SHOT_S")
|
||||
formatex(t_sText, charsmax(t_sText), "%L: %d %L / %d hs -- %d %L / %d %L^n", id, "TOTAL", g_izUserRndStats[0][STATSX_KILLS], id, "KILL_S",
|
||||
g_izUserRndStats[0][STATSX_HEADSHOTS], g_izUserRndStats[0][STATSX_HITS], id, "HITS", g_izUserRndStats[0][STATSX_SHOTS], id, "SHOT_S")
|
||||
add(sBuffer, charsmax(sBuffer), t_sText)
|
||||
}
|
||||
|
||||
|
@ -594,12 +585,12 @@ add_attacker_hits(id, iAttacker, sBuffer[MAX_BUFFER_LENGTH + 1])
|
|||
|
||||
if (iAttacker && iAttacker != id)
|
||||
{
|
||||
new izStats[8], izBody[8], iLen
|
||||
new izStats[STATSX_MAX_STATS], izBody[MAX_BODYHITS], iLen
|
||||
|
||||
izStats[STATS_HITS] = 0
|
||||
izStats[STATSX_HITS] = 0
|
||||
get_user_astats(id, iAttacker, izStats, izBody)
|
||||
|
||||
if (izStats[STATS_HITS])
|
||||
if (izStats[STATSX_HITS])
|
||||
{
|
||||
iFound = 1
|
||||
iLen = strlen(sBuffer)
|
||||
|
@ -627,18 +618,18 @@ format_kill_ainfo(id, iKiller, sBuffer[MAX_BUFFER_LENGTH + 1])
|
|||
|
||||
if (iKiller && iKiller != id)
|
||||
{
|
||||
new izStats[8], izBody[8]
|
||||
new izStats[STATSX_MAX_STATS], izBody[MAX_BODYHITS]
|
||||
new iLen
|
||||
|
||||
iFound = 1
|
||||
get_user_name(iKiller, t_sName, charsmax(t_sName))
|
||||
izStats[STATS_HITS] = 0
|
||||
izStats[STATSX_HITS] = 0
|
||||
get_user_astats(id, iKiller, izStats, izBody, t_sWpn, charsmax(t_sWpn))
|
||||
|
||||
iLen = formatex(sBuffer, charsmax(sBuffer), "%L (%dhp, %dap) >>", id, "KILLED_BY_WITH", t_sName, t_sWpn, distance(g_izUserAttackerDistance[id]),
|
||||
g_izKilled[id][KILLED_KILLER_HEALTH], g_izKilled[id][KILLED_KILLER_ARMOUR])
|
||||
|
||||
if (izStats[STATS_HITS])
|
||||
if (izStats[STATSX_HITS])
|
||||
{
|
||||
for (new i = 1; i < sizeof(izBody); i++)
|
||||
{
|
||||
|
@ -661,24 +652,24 @@ format_kill_ainfo(id, iKiller, sBuffer[MAX_BUFFER_LENGTH + 1])
|
|||
format_kill_vinfo(id, iKiller, sBuffer[MAX_BUFFER_LENGTH + 1])
|
||||
{
|
||||
new iFound = 0
|
||||
new izStats[8]
|
||||
new izBody[8]
|
||||
new izStats[STATSX_MAX_STATS]
|
||||
new izBody[MAX_BODYHITS]
|
||||
new iLen
|
||||
|
||||
izStats[STATS_HITS] = 0
|
||||
izStats[STATS_DAMAGE] = 0
|
||||
izStats[STATSX_HITS] = 0
|
||||
izStats[STATSX_DAMAGE] = 0
|
||||
get_user_vstats(id, iKiller, izStats, izBody)
|
||||
|
||||
if (iKiller && iKiller != id)
|
||||
{
|
||||
iFound = 1
|
||||
get_user_name(iKiller, t_sName, charsmax(t_sName))
|
||||
iLen = formatex(sBuffer, charsmax(sBuffer), "%L >>", id, "YOU_HIT", t_sName, izStats[STATS_HITS], izStats[STATS_DAMAGE])
|
||||
iLen = formatex(sBuffer, charsmax(sBuffer), "%L >>", id, "YOU_HIT", t_sName, izStats[STATSX_HITS], izStats[STATSX_DAMAGE])
|
||||
}
|
||||
else
|
||||
iLen = formatex(sBuffer, charsmax(sBuffer), "%L >>", id, "LAST_RES", izStats[STATS_HITS], izStats[STATS_DAMAGE])
|
||||
iLen = formatex(sBuffer, charsmax(sBuffer), "%L >>", id, "LAST_RES", izStats[STATSX_HITS], izStats[STATSX_DAMAGE])
|
||||
|
||||
if (izStats[STATS_HITS])
|
||||
if (izStats[STATSX_HITS])
|
||||
{
|
||||
for (new i = 1; i < sizeof(izBody); i++)
|
||||
{
|
||||
|
@ -698,7 +689,7 @@ format_kill_vinfo(id, iKiller, sBuffer[MAX_BUFFER_LENGTH + 1])
|
|||
format_top15(id, sBuffer[MAX_BUFFER_LENGTH + 1])
|
||||
{
|
||||
new iMax = get_statsnum()
|
||||
new izStats[8], izBody[8]
|
||||
new izStats[STATSX_MAX_STATS], izBody[MAX_BODYHITS]
|
||||
new iLen = 0
|
||||
|
||||
if (iMax > 15)
|
||||
|
@ -724,16 +715,16 @@ format_top15(id, sBuffer[MAX_BUFFER_LENGTH + 1])
|
|||
get_stats(i, izStats, izBody, t_sName, charsmax(t_sName))
|
||||
replace_string(t_sName, charsmax(t_sName), "<", "[")
|
||||
replace_string(t_sName, charsmax(t_sName), ">", "]")
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%2d %-22.22s %6d %6d %6d %6d %4d %3.0f%% %3.0f%%^n", i + 1, t_sName, izStats[STATS_KILLS],
|
||||
izStats[STATS_DEATHS], izStats[STATS_HITS], izStats[STATS_SHOTS], izStats[STATS_HS], effec(izStats), accuracy(izStats))
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%2d %-22.22s %6d %6d %6d %6d %4d %3.0f%% %3.0f%%^n", i + 1, t_sName, izStats[STATSX_KILLS],
|
||||
izStats[STATSX_DEATHS], izStats[STATSX_HITS], izStats[STATSX_SHOTS], izStats[STATSX_HEADSHOTS], effec(izStats), accuracy(izStats))
|
||||
}
|
||||
}
|
||||
|
||||
// Get and format rank stats.
|
||||
format_rankstats(id, sBuffer[MAX_BUFFER_LENGTH + 1], iMyId = 0)
|
||||
{
|
||||
new izStats[8] = {0, ...}
|
||||
new izBody[8]
|
||||
new izStats[STATSX_MAX_STATS] = {0, ...}
|
||||
new izBody[MAX_BODYHITS]
|
||||
new iRankPos, iLen
|
||||
new lKills[16], lDeaths[16], lHits[16], lShots[16], lDamage[16], lEff[16], lAcc[16]
|
||||
|
||||
|
@ -752,10 +743,10 @@ format_rankstats(id, sBuffer[MAX_BUFFER_LENGTH + 1], iMyId = 0)
|
|||
iLen = formatex(sBuffer, charsmax(sBuffer), "<meta charset=utf-8><body bgcolor=#000000><font color=#FFB000><pre>")
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%L %L^n^n", id, (!iMyId || iMyId == id) ? "YOUR" : "PLAYERS", id, "RANK_IS", iRankPos, get_statsnum())
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%6s: %d (%d with hs)^n%6s: %d^n%6s: %d^n%6s: %d^n%6s: %d^n%6s: %0.2f%%^n%6s: %0.2f%%^n^n",
|
||||
lKills, izStats[STATS_KILLS], izStats[STATS_HS], lDeaths, izStats[STATS_DEATHS], lHits, izStats[STATS_HITS], lShots, izStats[STATS_SHOTS],
|
||||
lDamage, izStats[STATS_DAMAGE], lEff, effec(izStats), lAcc, accuracy(izStats))
|
||||
lKills, izStats[STATSX_KILLS], izStats[STATSX_HEADSHOTS], lDeaths, izStats[STATSX_DEATHS], lHits, izStats[STATSX_HITS], lShots, izStats[STATSX_SHOTS],
|
||||
lDamage, izStats[STATSX_DAMAGE], lEff, effec(izStats), lAcc, accuracy(izStats))
|
||||
|
||||
new L_BODY_PART[8][32]
|
||||
new L_BODY_PART[MAX_BODYHITS][32]
|
||||
|
||||
for (new i = 1; i < sizeof(L_BODY_PART); i++)
|
||||
{
|
||||
|
@ -763,15 +754,15 @@ format_rankstats(id, sBuffer[MAX_BUFFER_LENGTH + 1], iMyId = 0)
|
|||
}
|
||||
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%10s:^n%10s: %d^n%10s: %d^n%10s: %d^n%10s: %d^n%10s: %d^n%10s: %d^n%10s: %d", "HITS",
|
||||
L_BODY_PART[1], izBody[1], L_BODY_PART[2], izBody[2], L_BODY_PART[3], izBody[3], L_BODY_PART[4], izBody[4], L_BODY_PART[5],
|
||||
izBody[5], L_BODY_PART[6], izBody[6], L_BODY_PART[7], izBody[7])
|
||||
L_BODY_PART[HIT_HEAD], izBody[HIT_HEAD], L_BODY_PART[HIT_CHEST], izBody[HIT_CHEST], L_BODY_PART[HIT_STOMACH], izBody[HIT_STOMACH], L_BODY_PART[HIT_LEFTARM], izBody[HIT_LEFTARM], L_BODY_PART[HIT_RIGHTARM],
|
||||
izBody[HIT_RIGHTARM], L_BODY_PART[HIT_LEFTLEG], izBody[HIT_LEFTLEG], L_BODY_PART[HIT_RIGHTLEG], izBody[HIT_RIGHTLEG])
|
||||
}
|
||||
|
||||
// Get and format stats.
|
||||
format_stats(id, sBuffer[MAX_BUFFER_LENGTH + 1])
|
||||
{
|
||||
new izStats[8] = {0, ...}
|
||||
new izBody[8]
|
||||
new izStats[STATSX_MAX_STATS] = {0, ...}
|
||||
new izBody[MAX_BODYHITS]
|
||||
new iWeapon, iLen
|
||||
new lKills[16], lDeaths[16], lHits[16], lShots[16], lDamage[16], lEff[16], lAcc[16], lWeapon[16]
|
||||
|
||||
|
@ -791,8 +782,8 @@ format_stats(id, sBuffer[MAX_BUFFER_LENGTH + 1])
|
|||
|
||||
iLen = formatex(sBuffer, charsmax(sBuffer), "<meta charset=utf-8><body bgcolor=#000000><font color=#FFB000><pre>")
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%6s: %d (%d with hs)^n%6s: %d^n%6s: %d^n%6s: %d^n%6s: %d^n%6s: %0.2f%%^n%6s: %0.2f%%^n^n",
|
||||
lKills, izStats[STATS_KILLS], izStats[STATS_HS], lDeaths, izStats[STATS_DEATHS], lHits, izStats[STATS_HITS], lShots, izStats[STATS_SHOTS],
|
||||
lDamage, izStats[STATS_DAMAGE], lEff, effec(izStats), lAcc, accuracy(izStats))
|
||||
lKills, izStats[STATSX_KILLS], izStats[STATSX_HEADSHOTS], lDeaths, izStats[STATSX_DEATHS], lHits, izStats[STATSX_HITS], lShots, izStats[STATSX_SHOTS],
|
||||
lDamage, izStats[STATSX_DAMAGE], lEff, effec(izStats), lAcc, accuracy(izStats))
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%-12.12s %6s %6s %6s %6s %6s %4s^n", lWeapon, lKills, lDeaths, lHits, lShots, lDamage, lAcc)
|
||||
|
||||
for (iWeapon = 1; iWeapon < xmod_get_maxweapons() && charsmax(sBuffer) - iLen > 0 ; iWeapon++)
|
||||
|
@ -800,8 +791,8 @@ format_stats(id, sBuffer[MAX_BUFFER_LENGTH + 1])
|
|||
if (get_user_wstats(id, iWeapon, izStats, izBody))
|
||||
{
|
||||
xmod_get_wpnname(iWeapon, t_sWpn, charsmax(t_sWpn))
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%-12.12s %6d %6d %6d %6d %6d %3.0f%%^n", t_sWpn, izStats[STATS_KILLS], izStats[STATS_DEATHS],
|
||||
izStats[STATS_HITS], izStats[STATS_SHOTS], izStats[STATS_DAMAGE], accuracy(izStats))
|
||||
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%-12.12s %6d %6d %6d %6d %6d %3.0f%%^n", t_sWpn, izStats[STATSX_KILLS], izStats[STATSX_DEATHS],
|
||||
izStats[STATSX_HITS], izStats[STATSX_SHOTS], izStats[STATSX_DAMAGE], accuracy(izStats))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1045,7 +1036,7 @@ public cmdRank(id)
|
|||
return PLUGIN_HANDLED
|
||||
}
|
||||
|
||||
new izStats[8], izBody[8]
|
||||
new izStats[STATSX_MAX_STATS], izBody[MAX_BODYHITS]
|
||||
new iRankPos, iRankMax
|
||||
new Float:fEff, Float:fAcc
|
||||
|
||||
|
@ -1055,7 +1046,7 @@ public cmdRank(id)
|
|||
fEff = effec(izStats)
|
||||
fAcc = accuracy(izStats)
|
||||
|
||||
client_print(id, print_chat, "* %L", id, "YOUR_RANK_IS", iRankPos, iRankMax, izStats[STATS_KILLS], izStats[STATS_HITS], fEff, fAcc)
|
||||
client_print(id, print_chat, "* %L", id, "YOUR_RANK_IS", iRankPos, iRankMax, izStats[STATSX_KILLS], izStats[STATSX_HITS], fEff, fAcc)
|
||||
|
||||
return PLUGIN_CONTINUE
|
||||
}
|
||||
|
@ -1443,7 +1434,7 @@ kill_stats(id)
|
|||
g_fzShowUserStatsTime[id] = get_gametime()
|
||||
|
||||
// Add user death stats to user round stats
|
||||
new izStats[8], izBody[8]
|
||||
new izStats[STATSX_MAX_STATS], izBody[MAX_BODYHITS]
|
||||
new iTeam, i
|
||||
new iKiller
|
||||
|
||||
|
@ -1651,7 +1642,7 @@ public eventShowRank(id)
|
|||
|
||||
if (is_user_connected(iPlayer))
|
||||
{
|
||||
new izStats[8], izBody[8]
|
||||
new izStats[STATSX_MAX_STATS], izBody[MAX_BODYHITS]
|
||||
new iRankPos, iRankMax
|
||||
|
||||
get_user_name(iPlayer, t_sName, charsmax(t_sName))
|
||||
|
|
|
@ -28,13 +28,14 @@
|
|||
*/
|
||||
|
||||
#include <amxmodx>
|
||||
#include <dodx>
|
||||
|
||||
#define KILLS stats[0]
|
||||
#define DEATHS stats[1]
|
||||
#define TK stats[3]
|
||||
#define SCORE stats[7]
|
||||
#define KILLS stats[DODX_KILLS]
|
||||
#define DEATHS stats[DODX_DEATHS]
|
||||
#define TK stats[DODX_TEAMKILLS]
|
||||
#define SCORE stats[DODX_POINTS]
|
||||
|
||||
public get_score(stats[9],body[8]){
|
||||
public get_score(stats[DODX_MAX_STATS],body[MAX_BODYHITS]){
|
||||
if (!DEATHS)
|
||||
DEATHS = 1
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ new g_center1_sync
|
|||
new g_center2_sync
|
||||
new g_left_sync
|
||||
|
||||
new g_bodyParts[8][] = {
|
||||
new g_bodyParts[MAX_BODYHITS][] = {
|
||||
"WHOLEBODY",
|
||||
"HEAD",
|
||||
"CHEST",
|
||||
|
@ -294,19 +294,19 @@ public cmdStats(id){
|
|||
|
||||
/* build list of attackers */
|
||||
getAttackers(id) {
|
||||
new name[MAX_NAME_LENGTH],wpn[32], stats[9],body[8],found=0
|
||||
new name[MAX_NAME_LENGTH],wpn[32], stats[DODX_MAX_STATS],body[MAX_BODYHITS],found=0
|
||||
new pos = format(g_Buffer,charsmax(g_Buffer),"%L^n",id,"ATTACKERS")
|
||||
for(new a = 1; a <= MaxClients; ++a){
|
||||
|
||||
if(get_user_astats(id,a,stats,body,wpn,charsmax(wpn)))
|
||||
{
|
||||
found = 1
|
||||
if (stats[0])
|
||||
if (stats[DODX_KILLS])
|
||||
format(wpn,charsmax(wpn)," -- %s",wpn)
|
||||
else
|
||||
wpn[0] = 0
|
||||
get_user_name(a,name,charsmax(name))
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"%s -- %d %L / %d %L%s^n",name,stats[6],id,"DMG",stats[5],id,"HIT_S",wpn)
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"%s -- %d %L / %d %L%s^n",name,stats[DODX_DAMAGE],id,"DMG",stats[DODX_HITS],id,"HIT_S",wpn)
|
||||
}
|
||||
}
|
||||
return found
|
||||
|
@ -315,18 +315,18 @@ getAttackers(id) {
|
|||
|
||||
/* build list of victims */
|
||||
getVictims(id) {
|
||||
new name[MAX_NAME_LENGTH],wpn[32], stats[9],body[8],found=0
|
||||
new name[MAX_NAME_LENGTH],wpn[32], stats[DODX_MAX_STATS],body[MAX_BODYHITS],found=0
|
||||
new pos = format(g_Buffer,charsmax(g_Buffer),"%L^n",id,"VICTIMS")
|
||||
for(new a = 1; a <= MaxClients; ++a){
|
||||
if(get_user_vstats(id,a,stats,body,wpn,charsmax(wpn)))
|
||||
{
|
||||
found = 1
|
||||
if (stats[1])
|
||||
if (stats[DODX_DEATHS])
|
||||
format(wpn,charsmax(wpn)," -- %s",wpn)
|
||||
else
|
||||
wpn[0] = 0
|
||||
get_user_name(a,name,charsmax(name))
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"%s -- %d %L / %d %L%s^n",name,stats[6],id,"DMG",stats[5],id,"HITS",wpn)
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"%s -- %d %L / %d %L%s^n",name,stats[DODX_DAMAGE],id,"DMG",stats[DODX_HITS],id,"HITS",wpn)
|
||||
}
|
||||
}
|
||||
return found
|
||||
|
@ -334,7 +334,7 @@ getVictims(id) {
|
|||
|
||||
/* build list of hita for AV List */
|
||||
getHits(id,killer) {
|
||||
new stats[9], body[8], pos = 0
|
||||
new stats[DODX_MAX_STATS], body[MAX_BODYHITS], pos = 0
|
||||
g_Buffer[0] = 0
|
||||
get_user_astats(id,killer,stats,body)
|
||||
for(new a = 1; a < sizeof(body); ++a)
|
||||
|
@ -344,7 +344,7 @@ getHits(id,killer) {
|
|||
|
||||
/* build list of hits for say hp */
|
||||
getMyHits(id,killed) {
|
||||
new name[MAX_NAME_LENGTH], stats[9], body[8], found = 0
|
||||
new name[MAX_NAME_LENGTH], stats[DODX_MAX_STATS], body[MAX_BODYHITS], found = 0
|
||||
get_user_name(killed,name,charsmax(name))
|
||||
new pos = format(g_Buffer,charsmax(g_Buffer),"%L",id,"YOU_HIT",name)
|
||||
get_user_vstats(id,killed,stats,body)
|
||||
|
@ -367,13 +367,13 @@ public cmdKiller(id) {
|
|||
return PLUGIN_HANDLED
|
||||
}
|
||||
if (g_Killers[id][0]) {
|
||||
new name[MAX_NAME_LENGTH], stats[9], body[8], wpn[32], mstats[9], mbody[8]
|
||||
new name[MAX_NAME_LENGTH], stats[DODX_MAX_STATS], body[MAX_BODYHITS], wpn[32], mstats[DODX_MAX_STATS], mbody[MAX_BODYHITS]
|
||||
get_user_name(g_Killers[id][0],name,charsmax(name))
|
||||
get_user_astats(id,g_Killers[id][0],stats,body,wpn,charsmax(wpn))
|
||||
get_user_vstats(id,g_Killers[id][0],mstats,mbody)
|
||||
client_print(id,print_chat,"%L",id,"KILL_INFO1", name,wpn,float(g_Killers[id][2]) * 0.0254 )
|
||||
client_print(id,print_chat,"%L",id,"KILL_INFO2", stats[6],stats[5], g_Killers[id][1] )
|
||||
client_print(id,print_chat,"%L",id,"KILL_INFO3", mstats[6], mstats[5] )
|
||||
client_print(id,print_chat,"%L",id,"KILL_INFO2", stats[DODX_DAMAGE],stats[DODX_HITS], g_Killers[id][1] )
|
||||
client_print(id,print_chat,"%L",id,"KILL_INFO3", mstats[DODX_DAMAGE], mstats[DODX_HITS] )
|
||||
|
||||
if (getMyHits(id,g_Killers[id][0])) client_print(id,print_chat,"%L",id,"KILL_INFO4",g_Buffer)
|
||||
}
|
||||
|
@ -479,7 +479,7 @@ public round_end(){
|
|||
|
||||
if ( !EndRoundStats ) return PLUGIN_CONTINUE
|
||||
|
||||
new g_Buffer2[1024], len, players[MAX_PLAYERS], pnum, stats[9],bodyhits[8]
|
||||
new g_Buffer2[1024], len, players[MAX_PLAYERS], pnum, stats[DODX_MAX_STATS],bodyhits[MAX_BODYHITS]
|
||||
get_players( players , pnum )
|
||||
|
||||
|
||||
|
@ -488,25 +488,25 @@ public round_end(){
|
|||
|
||||
for(new i = 0; i < pnum; ++i){
|
||||
get_user_rstats( players[i],stats, bodyhits )
|
||||
if ( stats[7] > score ){
|
||||
if ( stats[DODX_POINTS] > score ){
|
||||
who1 = players[i]
|
||||
score = stats[7]
|
||||
score = stats[DODX_POINTS]
|
||||
}
|
||||
}
|
||||
for(new i = 0; i < pnum; ++i){
|
||||
get_user_rstats( players[i],stats, bodyhits )
|
||||
if ( stats[0] > kills ){
|
||||
if ( stats[DODX_KILLS] > kills ){
|
||||
who2 = players[i]
|
||||
kills = stats[0]
|
||||
hs = stats[2]
|
||||
kills = stats[DODX_KILLS]
|
||||
hs = stats[DODX_HEADSHOTS]
|
||||
}
|
||||
}
|
||||
for(new i = 0; i < pnum; ++i){
|
||||
get_user_rstats( players[i],stats, bodyhits )
|
||||
if ( stats[6] > damage ){
|
||||
if ( stats[DODX_DAMAGE] > damage ){
|
||||
who3 = players[i]
|
||||
hits = stats[5]
|
||||
damage = stats[6]
|
||||
hits = stats[DODX_HITS]
|
||||
damage = stats[DODX_DAMAGE]
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -632,15 +632,15 @@ public client_death(killer,victim,wpnindex,hitplace,TK)
|
|||
|
||||
|
||||
if ( ShowKiller && !(!get_cvar_num("dodstats_rankbots") && (is_user_bot(killer) || is_user_bot(victim))) ){
|
||||
new stats[9], body[8], wpn[32], mstats[9], mbody[8]
|
||||
new stats[DODX_MAX_STATS], body[MAX_BODYHITS], wpn[32], mstats[DODX_MAX_STATS], mbody[MAX_BODYHITS]
|
||||
|
||||
get_user_astats(victim,killer,stats,body,wpn,charsmax(wpn))
|
||||
get_user_vstats(victim,killer,mstats,mbody)
|
||||
set_hudmessage(220,80,0,0.05,0.15,0, statstime, 12.0, 1.0, 2.0, -1)
|
||||
getHits(victim,killer)
|
||||
show_hudmessage(victim,"%L%L%L%L",victim,"KILL_INFO1",killer_name,wpn,float(g_Killers[victim][2]) * 0.0254,
|
||||
/*2*/ victim,"KILL_INFO2",stats[6],stats[5],g_Killers[victim][1],
|
||||
/*3*/ victim,"KILL_INFO3",mstats[6],mstats[5],
|
||||
/*2*/ victim,"KILL_INFO2",stats[DODX_DAMAGE],stats[DODX_HITS],g_Killers[victim][1],
|
||||
/*3*/ victim,"KILL_INFO3",mstats[DODX_DAMAGE],mstats[DODX_HITS],
|
||||
/*4*/ victim,"KILL_INFO4",g_Buffer )
|
||||
}
|
||||
|
||||
|
@ -919,7 +919,7 @@ public cmdStatsMe(id){
|
|||
}
|
||||
|
||||
displayStats_steam(id,dest) {
|
||||
new name[MAX_NAME_LENGTH], stats[9], body[8]
|
||||
new name[MAX_NAME_LENGTH], stats[DODX_MAX_STATS], body[MAX_BODYHITS]
|
||||
get_user_wstats(id,0,stats,body)
|
||||
|
||||
new pos = copy(g_Buffer,charsmax(g_Buffer),"<html><head><meta charset=utf-8><style type=^"text/css^">pre{color:#FFB000;}body{background:Black;margin-left:8px;margin-top:0px; color:#FFB000;}</style></head><pre><body>")
|
||||
|
@ -927,7 +927,7 @@ displayStats_steam(id,dest) {
|
|||
dest,"M_KILLS",dest,"M_DEATHS",dest,"M_SCORE",dest,"M_TKS",dest,"M_HITS",dest,"M_SHOTS",dest,"M_HS")
|
||||
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"<tr><td>%d</td><td>%d</td><td>%d</td><td>%d</td><td>%d</td><td>%d</td><td>%d</td></tr></table><br><br><br>",
|
||||
stats[0],stats[1],stats[7],stats[3],stats[5],stats[4],stats[2])
|
||||
stats[DODX_KILLS],stats[DODX_DEATHS],stats[DODX_POINTS],stats[DODX_TEAMKILLS],stats[DODX_HITS],stats[DODX_SHOTS],stats[DODX_HEADSHOTS])
|
||||
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"<table><tr><td>%L</td><td>%L</td><td>%L</td><td>%L</td><td>%L</td><td>%L<td></tr>",
|
||||
dest,"M_WEAPON",dest,"M_SHOTS",dest,"M_HITS",dest,"M_DAMAGE",dest,"M_KILLS",dest,"M_DEATHS")
|
||||
|
@ -935,10 +935,10 @@ displayStats_steam(id,dest) {
|
|||
for(new a = 1; a < DODMAX_WEAPONS; ++a) {
|
||||
if (get_user_wstats(id,a,stats,body)){
|
||||
if ( xmod_is_melee_wpn(a) )
|
||||
stats[4] = -1;
|
||||
stats[DODX_SHOTS] = -1;
|
||||
xmod_get_wpnname(a,name,charsmax(name))
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"<tr><td>%s</td><td>%d</td><td>%d</td><td>%d</td><td>%d</td><td>%d</td></tr>^n",
|
||||
name,stats[4],stats[5],stats[6],stats[0],stats[1])
|
||||
name,stats[DODX_SHOTS],stats[DODX_HITS],stats[DODX_DAMAGE],stats[DODX_KILLS],stats[DODX_DEATHS])
|
||||
}
|
||||
}
|
||||
copy(g_Buffer[pos],charsmax(g_Buffer)-pos,"</table></pre></body></html>")
|
||||
|
@ -958,7 +958,7 @@ public cmdRank(id){
|
|||
}
|
||||
|
||||
displayRank_steam(id,dest) {
|
||||
new name[MAX_NAME_LENGTH], stats[9], body[8]
|
||||
new name[MAX_NAME_LENGTH], stats[DODX_MAX_STATS], body[MAX_BODYHITS]
|
||||
new rank_pos = get_user_stats(id,stats,body)
|
||||
|
||||
new pos = copy(g_Buffer,charsmax(g_Buffer),"<html><head><meta charset=utf-8><style type=^"text/css^">pre{color:#FFB000;}body{background:Black;margin-left:8px;margin-top:0px;color:#FFB000;}</style></head><pre><body>")
|
||||
|
@ -968,9 +968,9 @@ displayRank_steam(id,dest) {
|
|||
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,
|
||||
"<tr><td>%d</td><td>%d</td><td>%d</td><td>%d</td><td>%d</td><td>%d</td><td>%d</td></tr></table><br><br>",
|
||||
stats[0],stats[1],stats[7],stats[3],stats[5],stats[4],stats[2])
|
||||
stats[DODX_KILLS],stats[DODX_DEATHS],stats[DODX_POINTS],stats[DODX_TEAMKILLS],stats[DODX_HITS],stats[DODX_SHOTS],stats[DODX_HEADSHOTS])
|
||||
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"%L^n%L: %d^n%L: %d^n%L: %d^n%L: %d^n%L: %d^n%L: %d^n%L: %d^n",dest,"M_HITS",dest,g_bodyParts[1],body[1],dest,g_bodyParts[2],body[2],dest,g_bodyParts[3],body[3],dest,g_bodyParts[4],body[4],dest,g_bodyParts[5],body[5],dest,g_bodyParts[6],body[6],dest,g_bodyParts[7],body[7])
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"%L^n%L: %d^n%L: %d^n%L: %d^n%L: %d^n%L: %d^n%L: %d^n%L: %d^n",dest,"M_HITS",dest,g_bodyParts[HIT_HEAD],body[HIT_HEAD],dest,g_bodyParts[HIT_CHEST],body[HIT_CHEST],dest,g_bodyParts[HIT_STOMACH],body[HIT_STOMACH],dest,g_bodyParts[HIT_LEFTARM],body[HIT_LEFTARM],dest,g_bodyParts[HIT_RIGHTARM],body[HIT_RIGHTARM],dest,g_bodyParts[HIT_LEFTLEG],body[HIT_LEFTLEG],dest,g_bodyParts[HIT_RIGHTLEG],body[HIT_RIGHTLEG])
|
||||
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"%L <b>%d</b> %L <b>%d</b>",dest,(id==dest)?"M_YOUR_RANK_IS":"M_THEIR_RANK_IS",
|
||||
rank_pos,dest,"M_OF",get_statsnum())
|
||||
|
@ -997,7 +997,7 @@ public cmdTop15(id) {
|
|||
|
||||
/* get top 15 */
|
||||
getTop15_steam(id){
|
||||
new stats[9], body[8], name[MAX_NAME_LENGTH]
|
||||
new stats[DODX_MAX_STATS], body[MAX_BODYHITS], name[MAX_NAME_LENGTH]
|
||||
|
||||
new pos = copy(g_Buffer,charsmax(g_Buffer),"<html><head><meta charset=utf-8><style type=^"text/css^">pre{color:#FFB000;}body{background:Black;margin-left:8px;margin-top:0px;color:#FFB000;}</style></head><pre><body>")
|
||||
|
||||
|
@ -1012,7 +1012,7 @@ getTop15_steam(id){
|
|||
replace_all(name, charsmax(name), "<", "[")
|
||||
replace_all(name, charsmax(name), ">", "]")
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"<tr><td>%d.</td><td>%s</td><td>%d</td><td>%d</td><td>%d</td><td>%d</td><td>%d</td><td>%d</td><td>%d</td></tr>^n",
|
||||
a+1,name,stats[0],stats[1],stats[7],stats[3],stats[5],stats[4],stats[2])
|
||||
a+1,name,stats[DODX_KILLS],stats[DODX_DEATHS],stats[DODX_POINTS],stats[DODX_TEAMKILLS],stats[DODX_HITS],stats[DODX_SHOTS],stats[DODX_HEADSHOTS])
|
||||
}
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"</table></pre></body></html>")
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ public plugin_init()
|
|||
public client_disconnected(id) {
|
||||
if ( is_user_bot( id ) || !is_user_connected(id) || !isDSMActive() ) return PLUGIN_CONTINUE
|
||||
remove_task( id )
|
||||
new szTeam[16],szName[MAX_NAME_LENGTH],szAuthid[32], iStats[9], iHits[8], szWeapon[16]
|
||||
new szTeam[16],szName[MAX_NAME_LENGTH],szAuthid[32], iStats[DODX_MAX_STATS], iHits[MAX_BODYHITS], szWeapon[16]
|
||||
new iUserid = get_user_userid( id )
|
||||
get_user_info(id,"team", szTeam, charsmax(szTeam) )
|
||||
szTeam[0] -= 32;
|
||||
|
@ -34,9 +34,9 @@ public client_disconnected(id) {
|
|||
if( get_user_wstats( id , i ,iStats , iHits ) ) {
|
||||
xmod_get_wpnlogname( i , szWeapon , charsmax(szWeapon) )
|
||||
log_message("^"%s<%d><%s><%s>^" triggered ^"weaponstats^" (weapon ^"%s^") (shots ^"%d^") (hits ^"%d^") (kills ^"%d^") (headshots ^"%d^") (tks ^"%d^") (damage ^"%d^") (deaths ^"%d^") (score ^"%d^")",
|
||||
szName,iUserid,szAuthid,szTeam,szWeapon,iStats[4],iStats[5],iStats[0], iStats[2],iStats[3],iStats[6],iStats[1],iStats[7])
|
||||
szName,iUserid,szAuthid,szTeam,szWeapon,iStats[DODX_SHOTS],iStats[DODX_HITS],iStats[DODX_KILLS], iStats[DODX_HEADSHOTS],iStats[DODX_TEAMKILLS],iStats[DODX_DAMAGE],iStats[DODX_DEATHS],iStats[DODX_POINTS])
|
||||
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])
|
||||
szName,iUserid,szAuthid,szTeam,szWeapon,iHits[HIT_HEAD],iHits[HIT_CHEST],iHits[HIT_STOMACH], iHits[HIT_LEFTARM],iHits[HIT_RIGHTARM],iHits[HIT_LEFTLEG],iHits[HIT_RIGHTLEG])
|
||||
}
|
||||
}
|
||||
new iTime = get_user_time( id , 1 )
|
||||
|
|
|
@ -75,7 +75,7 @@ new g_center2_sync
|
|||
new g_left_sync
|
||||
new g_damage_sync
|
||||
|
||||
new g_bodyParts[8][] = {
|
||||
new g_bodyParts[MAX_BODYHITS][] = {
|
||||
"whole body",
|
||||
"head",
|
||||
"chest",
|
||||
|
@ -220,18 +220,18 @@ public cmdStatsMe(id){
|
|||
}
|
||||
|
||||
displayStats(id,dest) {
|
||||
new name[32], stats[8], body[8]
|
||||
new name[32], stats[STATSX_MAX_STATS], body[MAX_BODYHITS]
|
||||
get_user_wstats(id,0,stats,body)
|
||||
new pos = format(g_Buffer,charsmax(g_Buffer),"Kills: %d^nDeaths: %d^nTKs: %d^nDamage: %d^nHits: %d^nShots: %d^n^n",
|
||||
stats[0],stats[1],stats[3],stats[6],stats[5],stats[4])
|
||||
stats[STATSX_KILLS],stats[STATSX_DEATHS],stats[STATSX_TEAMKILLS],stats[STATSX_DAMAGE],stats[STATSX_HITS],stats[STATSX_SHOTS])
|
||||
new a
|
||||
for( a = 1; a < TFCMAX_WEAPONS; a++) {
|
||||
if (get_user_wstats(id,a,stats,body)){
|
||||
if ( xmod_is_melee_wpn(a) )
|
||||
stats[4] = -1;
|
||||
stats[STATSX_SHOTS] = -1;
|
||||
xmod_get_wpnname(a,name,charsmax(name))
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"%s shots: %d hits: %d damage: %d kills: %d deaths: %d^n",
|
||||
name,stats[4],stats[5],stats[6],stats[0],stats[1])
|
||||
name,stats[STATSX_SHOTS],stats[STATSX_HITS],stats[STATSX_DAMAGE],stats[STATSX_KILLS],stats[STATSX_DEATHS])
|
||||
}
|
||||
}
|
||||
get_user_name(id,name,charsmax(name))
|
||||
|
@ -248,13 +248,13 @@ public cmdRank(id){
|
|||
}
|
||||
|
||||
displayRank(id,dest) {
|
||||
new name[MAX_NAME_LENGTH], stats[8], body[8]
|
||||
new name[MAX_NAME_LENGTH], stats[STATSX_MAX_STATS], body[MAX_BODYHITS]
|
||||
new rank_pos = get_user_stats(id,stats,body)
|
||||
new pos = format(g_Buffer,charsmax(g_Buffer),"Kills: %d^nDeaths: %d^nTKs: %d^nDamage: %d^nHits: %d^nShots: %d^n^n",
|
||||
stats[0],stats[1],stats[3],stats[6],stats[5],stats[4])
|
||||
stats[STATSX_KILLS],stats[STATSX_DEATHS],stats[STATSX_TEAMKILLS],stats[STATSX_DAMAGE],stats[STATSX_HITS],stats[STATSX_SHOTS])
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"Hits:^n%s: %d^n%s: %d^n%s: %d^n%s: %d^n%s: %d^n%s: %d^n%s: %d^n^n",
|
||||
g_bodyParts[1],body[1],g_bodyParts[2],body[2],g_bodyParts[3],body[3], g_bodyParts[4],body[4],
|
||||
g_bodyParts[5],body[5],g_bodyParts[6],body[6],g_bodyParts[7],body[7])
|
||||
g_bodyParts[HIT_HEAD],body[HIT_HEAD],g_bodyParts[HIT_CHEST],body[HIT_CHEST],g_bodyParts[HIT_STOMACH],body[HIT_STOMACH], g_bodyParts[HIT_LEFTARM],body[HIT_LEFTARM],
|
||||
g_bodyParts[HIT_RIGHTARM],body[HIT_RIGHTARM],g_bodyParts[HIT_LEFTLEG],body[HIT_LEFTLEG],g_bodyParts[HIT_RIGHTLEG],body[HIT_RIGHTLEG])
|
||||
format(g_Buffer[pos],charsmax(g_Buffer)-pos,"%s rank is %d of %d",(id==dest)?"Your":"His", rank_pos,get_statsnum())
|
||||
get_user_name(id,name,charsmax(name))
|
||||
show_motd(dest,g_Buffer,name)
|
||||
|
@ -272,7 +272,7 @@ public cmdTop15(id) {
|
|||
|
||||
/* get top 15 */
|
||||
getTop15(){
|
||||
new stats[8], body[8], name[MAX_NAME_LENGTH]
|
||||
new stats[STATSX_MAX_STATS], body[MAX_BODYHITS], name[MAX_NAME_LENGTH]
|
||||
new pos = copy(g_Buffer,charsmax(g_Buffer),"# nick kills/deaths TKs hits/shots/headshots^n")
|
||||
new imax = get_statsnum()
|
||||
if (imax > 15) imax = 15
|
||||
|
@ -280,7 +280,7 @@ getTop15(){
|
|||
get_stats(a,stats,body,name,charsmax(name))
|
||||
replace_all(name, charsmax(name), "<", "[")
|
||||
replace_all(name, charsmax(name), ">", "]")
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"%2d. %-28.27s %d/%d %d %d/%d/%d^n",a+1,name,stats[0],stats[1],stats[3],stats[5],stats[4],stats[2])
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"%2d. %-28.27s %d/%d %d %d/%d/%d^n",a+1,name,stats[STATSX_KILLS],stats[STATSX_DEATHS],stats[STATSX_TEAMKILLS],stats[STATSX_HITS],stats[STATSX_SHOTS],stats[STATSX_HEADSHOTS])
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -318,18 +318,18 @@ public cmdStats(id){
|
|||
|
||||
/* build list of attackers */
|
||||
getAttackers(id) {
|
||||
new name[MAX_NAME_LENGTH],wpn[32], stats[8],body[8],found=0
|
||||
new name[MAX_NAME_LENGTH],wpn[32], stats[STATSX_MAX_STATS],body[MAX_BODYHITS],found=0
|
||||
new pos = copy(g_Buffer,charsmax(g_Buffer),"Attackers:^n")
|
||||
for(new a = 1; a <= MaxClients; ++a){
|
||||
|
||||
if(get_user_astats(id,a,stats,body,wpn,charsmax(wpn))){
|
||||
found = 1
|
||||
if (stats[0])
|
||||
if (stats[STATSX_KILLS])
|
||||
format(wpn,charsmax(wpn)," -- %s",wpn)
|
||||
else
|
||||
wpn[0] = 0
|
||||
get_user_name(a,name,charsmax(name))
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"%s -- %d dmg / %d hit(s)%s^n",name,stats[6],stats[5],wpn)
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"%s -- %d dmg / %d hit(s)%s^n",name,stats[STATSX_DAMAGE],stats[STATSX_HITS],wpn)
|
||||
}
|
||||
}
|
||||
return found
|
||||
|
@ -338,17 +338,17 @@ getAttackers(id) {
|
|||
|
||||
/* build list of victims */
|
||||
getVictims(id) {
|
||||
new name[MAX_NAME_LENGTH],wpn[32], stats[8],body[8],found=0
|
||||
new name[MAX_NAME_LENGTH],wpn[32], stats[STATSX_MAX_STATS],body[MAX_BODYHITS],found=0
|
||||
new pos = copy(g_Buffer,charsmax(g_Buffer),"Victims:^n")
|
||||
for(new a = 1; a <= MaxClients; ++a){
|
||||
if(get_user_vstats(id,a,stats,body,wpn,charsmax(wpn))){
|
||||
found = 1
|
||||
if (stats[1])
|
||||
if (stats[STATSX_DEATHS])
|
||||
format(wpn,charsmax(wpn)," -- %s",wpn)
|
||||
else
|
||||
wpn[0] = 0
|
||||
get_user_name(a,name,charsmax(name))
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"%s -- %d dmg / %d hit(s)%s^n",name,stats[6],stats[5],wpn)
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"%s -- %d dmg / %d hit(s)%s^n",name,stats[STATSX_DAMAGE],stats[STATSX_HITS],wpn)
|
||||
}
|
||||
}
|
||||
return found
|
||||
|
@ -356,7 +356,7 @@ getVictims(id) {
|
|||
|
||||
/* build list of hita for AV List */
|
||||
getHits(id,killer) {
|
||||
new stats[8], body[8], pos = 0
|
||||
new stats[STATSX_MAX_STATS], body[MAX_BODYHITS], pos = 0
|
||||
g_Buffer[0] = 0
|
||||
get_user_astats(id,killer,stats,body)
|
||||
for(new a = 1; a < sizeof(body); ++a)
|
||||
|
@ -367,7 +367,7 @@ getHits(id,killer) {
|
|||
|
||||
/* build list of hits for say hp */
|
||||
getMyHits(id,killed) {
|
||||
new name[MAX_NAME_LENGTH], stats[8], body[8], found = 0
|
||||
new name[MAX_NAME_LENGTH], stats[STATSX_MAX_STATS], body[MAX_BODYHITS], found = 0
|
||||
get_user_name(killed,name,charsmax(name))
|
||||
new pos = format(g_Buffer,charsmax(g_Buffer),"You hit %s in:",name)
|
||||
get_user_vstats(id,killed,stats,body)
|
||||
|
@ -390,14 +390,14 @@ public cmdKiller(id) {
|
|||
return PLUGIN_HANDLED
|
||||
}
|
||||
if (g_Killers[id][0]) {
|
||||
new name[MAX_NAME_LENGTH], stats[8], body[8], wpn[32], mstats[8], mbody[8]
|
||||
new name[MAX_NAME_LENGTH], stats[STATSX_MAX_STATS], body[MAX_BODYHITS], wpn[32], mstats[STATSX_MAX_STATS], mbody[MAX_BODYHITS]
|
||||
get_user_name(g_Killers[id][0],name,charsmax(name))
|
||||
get_user_astats(id,g_Killers[id][0],stats,body,wpn,charsmax(wpn))
|
||||
client_print(id,print_chat,"%s killed you with %s from distance of %.2f meters", name,wpn,float(g_Killers[id][3]) * 0.0254 )
|
||||
client_print(id,print_chat,"He did %d damage to you with %d hit%s and still had %dhp and %dap",
|
||||
stats[6],stats[5],(stats[5]==1)?"":"s" , g_Killers[id][1],g_Killers[id][2] )
|
||||
stats[STATSX_DAMAGE],stats[STATSX_HITS],(stats[STATSX_HITS]==1)?"":"s" , g_Killers[id][1],g_Killers[id][2] )
|
||||
if ( get_user_vstats(id,g_Killers[id][0],mstats,mbody) ) {
|
||||
client_print(id,print_chat,"You did %d damage to him with %d hit%s",mstats[6], mstats[5],(mstats[5]==1)?"":"s" )
|
||||
client_print(id,print_chat,"You did %d damage to him with %d hit%s",mstats[STATSX_DAMAGE], mstats[STATSX_HITS],(mstats[STATSX_HITS]==1)?"":"s" )
|
||||
getMyHits(id,g_Killers[id][0])
|
||||
client_print(id,print_chat, "%s", g_Buffer)
|
||||
}
|
||||
|
@ -527,15 +527,15 @@ public client_death(killer,victim,wpnindex,hitplace,TK){
|
|||
|
||||
|
||||
if ( ShowKiller && !(!get_cvar_num("tfcstats_rankbots") && (is_user_bot(killer) || is_user_bot(killer))) ){
|
||||
new stats[8], body[8], wpn[32], mstats[8], mbody[8]
|
||||
new stats[STATSX_MAX_STATS], body[MAX_BODYHITS], wpn[32], mstats[STATSX_MAX_STATS], mbody[MAX_BODYHITS]
|
||||
|
||||
get_user_astats(victim,killer,stats,body,wpn,charsmax(wpn))
|
||||
get_user_vstats(victim,killer,mstats,mbody)
|
||||
set_hudmessage(220,80,0,0.05,0.15,0, statstime, 12.0, 1.0, 2.0, -1)
|
||||
getHits(victim,killer)
|
||||
show_hudmessage(victim,"%s killed you with %s^nfrom distance of %.2f meters.^nHe did %d damage to you with %d hit(s)^nand still has %dhp and %dap.^nYou did %d damage to him with %d hit(s).^nHe hits you in:^n%s",
|
||||
killer_name,wpn,float(g_Killers[victim][3]) * 0.0254, stats[6],stats[5],
|
||||
g_Killers[victim][1],g_Killers[victim][2], mstats[6],mstats[5],g_Buffer )
|
||||
killer_name,wpn,float(g_Killers[victim][3]) * 0.0254, stats[STATSX_DAMAGE],stats[STATSX_HITS],
|
||||
g_Killers[victim][1],g_Killers[victim][2], mstats[STATSX_DAMAGE],mstats[STATSX_HITS],g_Buffer )
|
||||
}
|
||||
|
||||
if ( KillerHp ){
|
||||
|
|
|
@ -23,7 +23,7 @@ public plugin_init()
|
|||
public client_disconnected(id) {
|
||||
if ( is_user_bot( id ) ) return PLUGIN_CONTINUE
|
||||
remove_task( id )
|
||||
new szTeam[16],szName[MAX_NAME_LENGTH],szAuthid[32], iStats[8], iHits[8], szWeapon[24]
|
||||
new szTeam[16],szName[MAX_NAME_LENGTH],szAuthid[32], iStats[STATSX_MAX_STATS], iHits[MAX_BODYHITS], szWeapon[24]
|
||||
new iUserid = get_user_userid( id )
|
||||
get_user_team(id, szTeam, charsmax(szTeam) )
|
||||
get_user_name(id, szName , charsmax(szName) )
|
||||
|
@ -33,9 +33,9 @@ public client_disconnected(id) {
|
|||
xmod_get_wpnlogname( i , szWeapon , charsmax(szWeapon) )
|
||||
|
||||
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,iStats[4],iStats[5],iStats[0], iStats[2],iStats[3],iStats[6],iStats[1])
|
||||
szName,iUserid,szAuthid,szTeam,szWeapon,iStats[STATSX_SHOTS],iStats[STATSX_HITS],iStats[STATSX_KILLS], iStats[STATSX_HEADSHOTS],iStats[STATSX_TEAMKILLS],iStats[STATSX_DAMAGE],iStats[STATSX_DEATHS])
|
||||
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])
|
||||
szName,iUserid,szAuthid,szTeam,szWeapon,iHits[HIT_HEAD],iHits[HIT_CHEST],iHits[HIT_STOMACH], iHits[HIT_LEFTARM],iHits[HIT_RIGHTARM],iHits[HIT_LEFTLEG],iHits[HIT_RIGHTLEG])
|
||||
}
|
||||
}
|
||||
new iTime = get_user_time( id , 1 )
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include <amxmodx>
|
||||
|
||||
public get_score(stats[8],body[8])
|
||||
public get_score(stats[STATSX_MAX_STATS],body[MAX_BODYHITS])
|
||||
{
|
||||
return stats[0] - stats[1] /* kills - deaths */
|
||||
return stats[STATSX_KILLS] - stats[STATSX_DEATHS] /* kills - deaths */
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ new Float:g_DeathStats[MAX_PLAYERS + 1]
|
|||
new g_center1_sync
|
||||
new g_damage_sync
|
||||
|
||||
new g_bodyParts[8][] = {"whole body","head","chest","stomach","left arm","right arm","left leg","right leg"}
|
||||
new g_bodyParts[MAX_BODYHITS][] = {"whole body","head","chest","stomach","left arm","right arm","left leg","right leg"}
|
||||
|
||||
new g_HeMessages[4][] = {
|
||||
"%s sends a little gift to %s",
|
||||
|
@ -165,17 +165,17 @@ public cmdStatsMe(id){
|
|||
}
|
||||
|
||||
public displayStats(id,dest) {
|
||||
new name[32], stats[8], body[8]
|
||||
new name[32], stats[STATSX_MAX_STATS], body[MAX_BODYHITS]
|
||||
get_user_wstats(id,0,stats,body)
|
||||
new pos = format(g_Buffer,charsmax(g_Buffer),"Kills: %d^nDeaths: %d^nTKs: %d^nDamage: %d^nHits: %d^nShots: %d^n^n",
|
||||
stats[0],stats[1],stats[3],stats[6],stats[5],stats[4])
|
||||
stats[STATSX_KILLS],stats[STATSX_DEATHS],stats[STATSX_TEAMKILLS],stats[STATSX_DAMAGE],stats[STATSX_HITS],stats[STATSX_SHOTS])
|
||||
for(new a = 1; a < TSMAX_WEAPONS; ++a) {
|
||||
if (get_user_wstats(id,a,stats,body)){
|
||||
if ( xmod_is_melee_wpn(a) )
|
||||
stats[4] = -1;
|
||||
stats[STATSX_SHOTS] = -1;
|
||||
xmod_get_wpnname(a,name,charsmax(name))
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"%s shots: %d hits: %d damage: %d kills: %d deaths: %d^n",
|
||||
name,stats[4],stats[5],stats[6],stats[0],stats[1])
|
||||
name,stats[STATSX_SHOTS],stats[STATSX_HITS],stats[STATSX_DAMAGE],stats[STATSX_KILLS],stats[STATSX_DEATHS])
|
||||
}
|
||||
}
|
||||
get_user_name(id,name,charsmax(name))
|
||||
|
@ -193,13 +193,13 @@ public cmdRank(id){
|
|||
}
|
||||
|
||||
displayRank(id,dest) {
|
||||
new name[MAX_NAME_LENGTH], stats[8], body[8]
|
||||
new name[MAX_NAME_LENGTH], stats[STATSX_MAX_STATS], body[MAX_BODYHITS]
|
||||
new rank_pos = get_user_stats(id,stats,body)
|
||||
new pos = format(g_Buffer,charsmax(g_Buffer),"Kills: %d^nDeaths: %d^nTKs: %d^nDamage: %d^nHits: %d^nShots: %d^n^n",
|
||||
stats[0],stats[1],stats[3],stats[6],stats[5],stats[4])
|
||||
stats[STATSX_KILLS],stats[STATSX_DEATHS],stats[STATSX_TEAMKILLS],stats[STATSX_DAMAGE],stats[STATSX_HITS],stats[STATSX_SHOTS])
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"Hits:^n%s: %d^n%s: %d^n%s: %d^n%s: %d^n%s: %d^n%s: %d^n%s: %d^n^n",
|
||||
g_bodyParts[1],body[1],g_bodyParts[2],body[2],g_bodyParts[3],body[3], g_bodyParts[4],body[4],
|
||||
g_bodyParts[5],body[5],g_bodyParts[6],body[6],g_bodyParts[7],body[7])
|
||||
g_bodyParts[HIT_HEAD],body[HIT_HEAD],g_bodyParts[HIT_CHEST],body[HIT_CHEST],g_bodyParts[HIT_STOMACH],body[HIT_STOMACH], g_bodyParts[HIT_LEFTARM],body[HIT_LEFTARM],
|
||||
g_bodyParts[HIT_RIGHTARM],body[HIT_RIGHTARM],g_bodyParts[HIT_LEFTLEG],body[HIT_LEFTLEG],g_bodyParts[HIT_RIGHTLEG],body[HIT_RIGHTLEG])
|
||||
format(g_Buffer[pos],charsmax(g_Buffer)-pos,"%s rank is %d of %d",(id==dest)?"Your":"His", rank_pos,get_statsnum())
|
||||
get_user_name(id,name,charsmax(name))
|
||||
show_motd(dest,g_Buffer,name)
|
||||
|
@ -217,7 +217,7 @@ public cmdTop15(id) {
|
|||
|
||||
/* get top 15 */
|
||||
getTop15(){
|
||||
new stats[8], body[8], name[MAX_NAME_LENGTH]
|
||||
new stats[STATSX_MAX_STATS], body[MAX_BODYHITS], name[MAX_NAME_LENGTH]
|
||||
new pos = copy(g_Buffer,charsmax(g_Buffer),"# nick kills/deaths TKs hits/shots/headshots^n")
|
||||
new imax = get_statsnum()
|
||||
if (imax > 15) imax = 15
|
||||
|
@ -225,7 +225,7 @@ getTop15(){
|
|||
get_stats(a,stats,body,name,charsmax(name))
|
||||
replace_all(name, charsmax(name), "<", "[")
|
||||
replace_all(name, charsmax(name), ">", "]")
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"%2d. %-28.27s %d/%d %d %d/%d/%d^n",a+1,name,stats[0],stats[1],stats[3],stats[5],stats[4],stats[2])
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"%2d. %-28.27s %d/%d %d %d/%d/%d^n",a+1,name,stats[STATSX_KILLS],stats[STATSX_DEATHS],stats[STATSX_TEAMKILLS],stats[STATSX_HITS],stats[STATSX_SHOTS],stats[STATSX_HEADSHOTS])
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -260,17 +260,17 @@ public cmdStats(id){
|
|||
|
||||
/* build list of attackers */
|
||||
getAttackers(id) {
|
||||
new name[MAX_NAME_LENGTH],wpn[32], stats[8],body[8],found=0
|
||||
new name[MAX_NAME_LENGTH],wpn[32], stats[STATSX_MAX_STATS],body[MAX_BODYHITS],found=0
|
||||
new pos = copy(g_Buffer,charsmax(g_Buffer),"Attackers:^n")
|
||||
for(new a = 1; a <= MaxClients; ++a){
|
||||
if(get_user_astats(id,a,stats,body,wpn,charsmax(wpn))){
|
||||
found = 1
|
||||
if (stats[0])
|
||||
if (stats[STATSX_KILLS])
|
||||
format(wpn,charsmax(wpn)," -- %s",wpn)
|
||||
else
|
||||
wpn[0] = 0
|
||||
get_user_name(a,name,charsmax(name))
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"%s -- %d dmg / %d hit(s)%s^n",name,stats[6],stats[5],wpn)
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"%s -- %d dmg / %d hit(s)%s^n",name,stats[STATSX_DAMAGE],stats[STATSX_HITS],wpn)
|
||||
}
|
||||
}
|
||||
return found
|
||||
|
@ -278,17 +278,17 @@ getAttackers(id) {
|
|||
|
||||
/* build list of victims */
|
||||
getVictims(id) {
|
||||
new name[MAX_NAME_LENGTH],wpn[32], stats[8],body[8],found=0
|
||||
new name[MAX_NAME_LENGTH],wpn[32], stats[STATSX_MAX_STATS],body[MAX_BODYHITS],found=0
|
||||
new pos = copy(g_Buffer,charsmax(g_Buffer),"Victims:^n")
|
||||
for(new a = 1; a <= MaxClients; ++a){
|
||||
if(get_user_vstats(id,a,stats,body,wpn,charsmax(wpn))){
|
||||
found = 1
|
||||
if (stats[1])
|
||||
if (stats[STATSX_DEATHS])
|
||||
format(wpn,charsmax(wpn)," -- %s",wpn)
|
||||
else
|
||||
wpn[0] = 0
|
||||
get_user_name(a,name,charsmax(name))
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"%s -- %d dmg / %d hit(s)%s^n",name,stats[6],stats[5],wpn)
|
||||
pos += format(g_Buffer[pos],charsmax(g_Buffer)-pos,"%s -- %d dmg / %d hit(s)%s^n",name,stats[STATSX_DAMAGE],stats[STATSX_HITS],wpn)
|
||||
}
|
||||
}
|
||||
return found
|
||||
|
@ -296,7 +296,7 @@ getVictims(id) {
|
|||
|
||||
/* build list of hita for AV List */
|
||||
getHits(id,killer) {
|
||||
new stats[8], body[8], pos = 0
|
||||
new stats[STATSX_MAX_STATS], body[MAX_BODYHITS], pos = 0
|
||||
g_Buffer[0] = 0
|
||||
get_user_astats(id,killer,stats,body)
|
||||
for(new a = 1; a < sizeof(body); ++a)
|
||||
|
@ -307,7 +307,7 @@ getHits(id,killer) {
|
|||
|
||||
/* build list of hits for say hp */
|
||||
getMyHits(id,killed) {
|
||||
new name[MAX_NAME_LENGTH], stats[8], body[8], found = 0
|
||||
new name[MAX_NAME_LENGTH], stats[STATSX_MAX_STATS], body[MAX_BODYHITS], found = 0
|
||||
get_user_name(killed,name,charsmax(name))
|
||||
new pos = format(g_Buffer,charsmax(g_Buffer),"You hit %s in:",name)
|
||||
get_user_vstats(id,killed,stats,body)
|
||||
|
@ -450,15 +450,15 @@ public client_death(killer,victim,wpnindex,hitplace,TK){
|
|||
|
||||
DisplayKillInfo(victim){
|
||||
if ( ShowKiller ){
|
||||
new name[MAX_NAME_LENGTH], stats[8], body[8], wpn[32], mstats[8], mbody[8]
|
||||
new name[MAX_NAME_LENGTH], stats[STATSX_MAX_STATS], body[MAX_BODYHITS], wpn[32], mstats[STATSX_MAX_STATS], mbody[MAX_BODYHITS]
|
||||
get_user_name(g_Killers[victim][0],name,charsmax(name))
|
||||
get_user_astats(victim,g_Killers[victim][0],stats,body,wpn,charsmax(wpn))
|
||||
get_user_vstats(victim,g_Killers[victim][0],mstats,mbody)
|
||||
set_hudmessage(220,80,0,0.05,0.15,0, 6.0, 12.0, 1.0, 2.0, -1)
|
||||
getHits(victim,g_Killers[victim][0])
|
||||
show_hudmessage(victim,"%s killed you with %s^nfrom distance of %.2f meters.^nHe did %d damage to you with %d hit(s)^nand still has %dhp.^nYou did %d damage to him with %d hit(s).^nHe hits you in:^n%s",
|
||||
name,wpn,float(g_Killers[victim][2]) * 0.0254, stats[6],stats[5],
|
||||
g_Killers[victim][1], mstats[6],mstats[5],g_Buffer )
|
||||
name,wpn,float(g_Killers[victim][2]) * 0.0254, stats[STATSX_DAMAGE],stats[STATSX_HITS],
|
||||
g_Killers[victim][1], mstats[STATSX_DAMAGE],mstats[STATSX_HITS],g_Buffer )
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -503,14 +503,14 @@ public cmdKiller(id) {
|
|||
return PLUGIN_HANDLED
|
||||
}
|
||||
if (g_Killers[id][0]) {
|
||||
new name[MAX_NAME_LENGTH], stats[8], body[8], wpn[32], mstats[8], mbody[8]
|
||||
new name[MAX_NAME_LENGTH], stats[STATSX_MAX_STATS], body[MAX_BODYHITS], wpn[32], mstats[STATSX_MAX_STATS], mbody[MAX_BODYHITS]
|
||||
get_user_name(g_Killers[id][0],name,charsmax(name))
|
||||
get_user_astats(id,g_Killers[id][0],stats,body,wpn,charsmax(wpn))
|
||||
get_user_vstats(id,g_Killers[id][0],mstats,mbody)
|
||||
client_print(id,print_chat,"%s killed you with %s from distance of %.2f meters", name,wpn,float(g_Killers[id][2]) * 0.0254 )
|
||||
client_print(id,print_chat,"He did %d damage to you with %d hit(s) and still had %dhp",
|
||||
stats[6],stats[5], g_Killers[id][1] )
|
||||
client_print(id,print_chat,"You did %d damage to him with %d hit(s)",mstats[6], mstats[5] )
|
||||
stats[STATSX_DAMAGE],stats[STATSX_HITS], g_Killers[id][1] )
|
||||
client_print(id,print_chat,"You did %d damage to him with %d hit(s)",mstats[STATSX_DAMAGE], mstats[STATSX_HITS] )
|
||||
if (getMyHits(id,g_Killers[id][0])) client_print(id,print_chat, "%s", g_Buffer)
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -25,7 +25,7 @@ public plugin_init()
|
|||
public client_disconnected(id) {
|
||||
if ( is_user_bot( id ) ) return PLUGIN_CONTINUE
|
||||
remove_task( id )
|
||||
new szTeam[16],szName[MAX_NAME_LENGTH],szAuthid[32], iStats[8], iHits[8], szWeapon[16]
|
||||
new szTeam[16],szName[MAX_NAME_LENGTH],szAuthid[32], iStats[STATSX_MAX_STATS], iHits[MAX_BODYHITS], szWeapon[16]
|
||||
new iUserid = get_user_userid( id )
|
||||
|
||||
// team
|
||||
|
@ -37,12 +37,12 @@ public client_disconnected(id) {
|
|||
if( get_user_wstats( id , i ,iStats , iHits ) ) {
|
||||
xmod_get_wpnlogname( i , szWeapon , charsmax(szWeapon) )
|
||||
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,iStats[4],iStats[5],iStats[0],
|
||||
iStats[2],iStats[3],iStats[6],iStats[1])
|
||||
szName,iUserid,szAuthid,szTeam,szWeapon,iStats[STATSX_SHOTS],iStats[STATSX_HITS],iStats[STATSX_KILLS],
|
||||
iStats[STATSX_HEADSHOTS],iStats[STATSX_TEAMKILLS],iStats[STATSX_DAMAGE],iStats[STATSX_DEATHS])
|
||||
|
||||
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])
|
||||
szName,iUserid,szAuthid,szTeam,szWeapon,iHits[HIT_HEAD],iHits[HIT_CHEST],iHits[HIT_STOMACH],
|
||||
iHits[HIT_LEFTARM],iHits[HIT_RIGHTARM],iHits[HIT_LEFTLEG],iHits[HIT_RIGHTLEG])
|
||||
}
|
||||
}
|
||||
new iTime = get_user_time( id , 1 )
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include <amxmodx>
|
||||
|
||||
public get_score(stats[8],body[8])
|
||||
public get_score(stats[STATSX_MAX_STATS],body[MAX_BODYHITS])
|
||||
{
|
||||
return stats[0] - stats[1] - stats[3] /* kills - deaths - TKs */
|
||||
return stats[STATSX_KILLS] - stats[STATSX_DEATHS] - stats[STATSX_TEAMKILLS] /* kills - deaths - TKs */
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user