Use the new constants in various place.

This commit is contained in:
Arkshine
2014-07-20 12:27:02 +02:00
parent e84653571c
commit 07534edfcd
36 changed files with 341 additions and 376 deletions

View File

@ -36,14 +36,14 @@
#include <amxmisc>
#include <tfcx>
new g_menuPosition[33]
new g_menuPlayers[33][32]
new g_menuPlayersNum[33]
new g_menuOption[33]
new g_menuSettings[33]
new g_menuPosition[MAX_PLAYERS]
new g_menuPlayers[MAX_PLAYERS][MAX_PLAYERS]
new g_menuPlayersNum[MAX_PLAYERS]
new g_menuOption[MAX_PLAYERS]
new g_menuSettings[MAX_PLAYERS]
new g_menuSelect[33][64]
new g_menuSelectNum[33]
new g_menuSelect[MAX_PLAYERS][64]
new g_menuSelectNum[MAX_PLAYERS]
#define MAX_CLCMDS 24
@ -138,7 +138,7 @@ public actionBanMenu(id, key)
}
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
new name[32], name2[32], authid[32], authid2[32]
new name[MAX_NAME_LENGTH], name2[MAX_NAME_LENGTH], authid[32], authid2[32]
get_user_name(player, name2, 31)
get_user_authid(id, authid, 31)
get_user_authid(player, authid2, 31)
@ -215,7 +215,7 @@ displayBanMenu(id, pos)
new menuBody[512]
new b = 0
new i
new name[32]
new name[MAX_NAME_LENGTH]
new start = pos * 7
if (start >= g_menuPlayersNum[id])
@ -298,7 +298,7 @@ public actionSlapMenu(id,key) {
default: {
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
new name2[32]
new name2[MAX_NAME_LENGTH]
get_user_name(player,name2,31)
if (!is_user_alive(player)) {
@ -307,7 +307,7 @@ public actionSlapMenu(id,key) {
return PLUGIN_HANDLED
}
new authid[32],authid2[32], name[32]
new authid[32],authid2[32], name[MAX_NAME_LENGTH]
get_user_authid(id,authid,31)
get_user_authid(player,authid2,31)
@ -351,7 +351,7 @@ displaySlapMenu(id, pos)
new menuBody[512]
new b = 0
new i
new name[32]
new name[MAX_NAME_LENGTH]
new start = pos * 7
if (start >= g_menuPlayersNum[id])
@ -427,7 +427,7 @@ public actionKickMenu(id,key)
default: {
new player = g_menuPlayers[id][g_menuPosition[id] * 8 + key]
new authid[32],authid2[32], name[32], name2[32]
new authid[32],authid2[32], name[MAX_NAME_LENGTH], name2[MAX_NAME_LENGTH]
get_user_authid(id,authid,31)
get_user_authid(player,authid2,31)
get_user_name(id,name,31)
@ -461,7 +461,7 @@ displayKickMenu(id, pos)
new menuBody[512]
new b = 0
new i
new name[32]
new name[MAX_NAME_LENGTH]
new start = pos * 8
if (start >= g_menuPlayersNum[id])
@ -530,7 +530,7 @@ public actionTeamMenu(id,key) {
case 9: displayTeamMenu(id,--g_menuPosition[id])
default: {
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
new authid[32],authid2[32], name[32], name2[32]
new authid[32],authid2[32], name[MAX_NAME_LENGTH], name2[MAX_NAME_LENGTH]
get_user_name(player,name2,31)
get_user_authid(id,authid,31)
get_user_authid(player,authid2,31)
@ -570,7 +570,7 @@ displayTeamMenu(id, pos)
new menuBody[512]
new b = 0
new i, iteam
new name[32]
new name[MAX_NAME_LENGTH]
new start = pos * 7
if (start >= g_menuPlayersNum[id])
@ -647,7 +647,7 @@ public actionClcmdMenu(id,key) {
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
new flags = g_clcmdMisc[g_menuSelect[id][g_menuOption[id]]][1]
if (is_user_connected(player)) {
new command[64], authid[32], name[32], userid[32]
new command[64], authid[32], name[MAX_NAME_LENGTH], userid[32]
copy(command,63,g_clcmdCmd[g_menuSelect[id][g_menuOption[id]]])
get_user_authid(player,authid,31)
get_user_name(player,name,31)
@ -680,7 +680,7 @@ displayClcmdMenu(id, pos)
new menuBody[512]
new b = 0
new i
new name[32]
new name[MAX_NAME_LENGTH]
new start = pos * 7
if (start >= g_menuPlayersNum[id])

View File

@ -47,20 +47,20 @@ public DoubleKill
public DoubleKillSound
public BulletDamage
new g_streakKills[33][2]
new g_multiKills[33][2]
new g_streakKills[MAX_PLAYERS][2]
new g_multiKills[MAX_PLAYERS][2]
new Float:g_prevKill
new g_prevKillerId
new g_KillCount;
new g_userPosition[33]
new g_userState[33]
new g_userPlayers[33][32]
new g_userPosition[MAX_PLAYERS]
new g_userState[MAX_PLAYERS]
new g_userPlayers[MAX_PLAYERS][MAX_PLAYERS]
new g_Buffer[2048]
new g_Killers[33][4]
new Float:g_DeathStats[33]
new g_Killers[MAX_PLAYERS][4]
new Float:g_DeathStats[MAX_PLAYERS]
new g_center1_sync
new g_center2_sync
@ -240,7 +240,7 @@ public cmdRank(id){
}
displayRank(id,dest) {
new name[32], stats[8], body[8]
new name[MAX_NAME_LENGTH], stats[8], body[8]
new rank_pos = get_user_stats(id,stats,body)
new pos = format(g_Buffer,2047,"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])
@ -264,7 +264,7 @@ public cmdTop15(id) {
/* get top 15 */
getTop15(){
new stats[8], body[8], name[32]
new stats[8], body[8], name[MAX_NAME_LENGTH]
new pos = copy(g_Buffer,2047,"# nick kills/deaths TKs hits/shots/headshots^n")
new imax = get_statsnum()
if (imax > 15) imax = 15
@ -278,14 +278,14 @@ getTop15(){
public endGameStats(){
if ( EndPlayer ){
new players[32], inum
new players[MAX_PLAYERS], inum
get_players(players,inum)
for(new i = 0; i < inum; ++i){
displayStats(players[i],players[i])
}
}
else if ( EndTop15 ){
new players[32], inum
new players[MAX_PLAYERS], inum
get_players(players,inum)
getTop15()
for(new i = 0; i < inum; ++i)
@ -310,10 +310,9 @@ public cmdStats(id){
/* build list of attackers */
getAttackers(id) {
new name[32],wpn[32], stats[8],body[8],found=0
new name[MAX_NAME_LENGTH],wpn[32], stats[8],body[8],found=0
new pos = copy(g_Buffer,2047,"Attackers:^n")
new amax = get_maxplayers()
for(new a = 1; a <= amax; ++a){
for(new a = 1; a <= MaxClients; ++a){
if(get_user_astats(id,a,stats,body,wpn,31)){
found = 1
@ -331,10 +330,9 @@ getAttackers(id) {
/* build list of victims */
getVictims(id) {
new name[32],wpn[32], stats[8],body[8],found=0
new name[MAX_NAME_LENGTH],wpn[32], stats[8],body[8],found=0
new pos = copy(g_Buffer,2047,"Victims:^n")
new amax = get_maxplayers()
for(new a = 1; a <= amax; ++a){
for(new a = 1; a <= MaxClients; ++a){
if(get_user_vstats(id,a,stats,body,wpn,31)){
found = 1
if (stats[1])
@ -361,7 +359,7 @@ getHits(id,killer) {
/* build list of hits for say hp */
getMyHits(id,killed) {
new name[32], stats[8], body[8], found = 0
new name[MAX_NAME_LENGTH], stats[8], body[8], found = 0
get_user_name(killed,name,31)
new pos = format(g_Buffer,2047,"You hit %s in:",name)
get_user_vstats(id,killed,stats,body)
@ -384,7 +382,7 @@ public cmdKiller(id) {
return PLUGIN_HANDLED
}
if (g_Killers[id][0]) {
new name[32], stats[8], body[8], wpn[33], mstats[8], mbody[8]
new name[MAX_NAME_LENGTH], stats[8], body[8], wpn[33], mstats[8], mbody[8]
get_user_name(g_Killers[id][0],name,31)
get_user_astats(id,g_Killers[id][0],stats,body,wpn,31)
client_print(id,print_chat,"%s killed you with %s from distance of %.2f meters", name,wpn,float(g_Killers[id][3]) * 0.0254 )
@ -436,7 +434,7 @@ showStatsMenu(id,pos){
if (start >= inum) start = pos = g_userPosition[id] = 0
new len = format(menu_body,511,"Server Stats %d/%d^n^n",pos + 1,((inum/max_menupos)+((inum%max_menupos)?1:0)))
new name[32], end = start + max_menupos, keys = (1<<9)|(1<<7)
new name[MAX_NAME_LENGTH], end = start + max_menupos, keys = (1<<9)|(1<<7)
if (end > inum) end = inum
for(new a = start; a < end; ++a){
get_user_name(g_userPlayers[id][a],name,31)
@ -474,7 +472,7 @@ public client_damage(attacker,victim,damage,wpnindex,hitplace,TA){
/* save state at death */
public client_death(killer,victim,wpnindex,hitplace,TK){
new killer_name[32]
new killer_name[MAX_NAME_LENGTH]
get_user_name(killer,killer_name,31)
if ( KillingStreak || KillingStreakSound ){
@ -486,7 +484,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK){
new headshot = ( hitplace == HIT_HEAD ) ? 1:0
new selfKill = ( killer == victim ) ? 1:0
new victim_name[32]
new victim_name[MAX_NAME_LENGTH]
get_user_name(victim,victim_name,31)
new Float:statstime = get_cvar_float("tfcstats_statstime")
@ -548,7 +546,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK){
if ( (a >>= 1) > 6 ) a = 6
if ( KillingStreak ){
set_hudmessage(0, 100, 255, 0.05, 0.55, 2, 0.02, 6.0, 0.01, 0.1, -1)
for (new i=1;i<=get_maxplayers();i++){
for (new i=1;i<=MaxClients;i++){
if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
continue
ShowSyncHudMsg(i, g_left_sync, g_KillingMsg[ a ], killer_name)
@ -572,7 +570,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK){
if ( xmod_is_melee_wpn(wpnindex) && ( KnifeKill || KnifeKillSound ) ){
if ( KnifeKill ){
set_hudmessage(255, 100, 100, -1.0, 0.15, 1, 6.0, 6.0, 0.5, 0.15, -1)
for (new i=1;i<=get_maxplayers();i++){
for (new i=1;i<=MaxClients;i++){
if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
continue
@ -584,7 +582,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK){
else if ( grenade ){
if ( GrenadeKill ){
set_hudmessage(255, 100, 100, -1.0, 0.15, 1, 6.0, 6.0, 0.5, 0.15, -1)
for (new i=1;i<=get_maxplayers();i++){
for (new i=1;i<=MaxClients;i++){
if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
continue
ShowSyncHudMsg(i, g_center1_sync, g_HeMessages[ random_num(0,3)],killer_name,victim_name)
@ -601,7 +599,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK){
replace( message, sizeof(message)-1, "$wn", weapon )
replace( message, sizeof(message)-1, "$kn", killer_name )
set_hudmessage(100, 100, 255, -1.0, 0.19, 0, 6.0, 6.0, 0.5, 0.15, -1)
for (new i=1;i<=get_maxplayers();i++){
for (new i=1;i<=MaxClients;i++){
if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
continue
ShowSyncHudMsg(i, g_center2_sync, "%s", message)
@ -635,7 +633,7 @@ public showDoubleKill(){
return PLUGIN_CONTINUE
if ( DoubleKill ) {
new name[32],message[128]
new name[MAX_NAME_LENGTH],message[128]
get_user_name(g_prevKillerId,name,31)
copy( message, 127, g_DoubleKillMsg[pos] )
replace( message, 127 , "$kn", name )
@ -645,7 +643,7 @@ public showDoubleKill(){
replace( message, 127 , "$kk", kills )
}
set_hudmessage(65, 102, 158, -1.0, 0.25, 0, 6.0, 6.0, 0.5, 0.15, -1)
for (new i=1;i<=get_maxplayers();i++){
for (new i=1;i<=MaxClients;i++){
if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
continue
show_hudmessage(i, "%s", message)
@ -664,11 +662,11 @@ public checkKills(param[]){
a -= 3
if ( a > -1 ){
if ( MultiKill ) {
new name[32]
new name[MAX_NAME_LENGTH]
get_user_name(id,name,31)
set_hudmessage(255, 0, 100, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, -1)
if ( a > 6 ) a = 6
for (new i=1;i<=get_maxplayers();i++){
for (new i=1;i<=MaxClients;i++){
if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
continue
ShowSyncHudMsg(i, g_left_sync, g_MultiKillMsg[a],name,g_multiKills[id][0],g_multiKills[id][1])

View File

@ -35,8 +35,8 @@
#include <amxmodx>
#include <tfcx>
new g_pingSum[33]
new g_pingCount[33]
new g_pingSum[MAX_PLAYERS]
new g_pingCount[MAX_PLAYERS]
public plugin_init()
register_plugin("TFC Stats Logging",AMXX_VERSION_STR,"AMXX Dev Team")
@ -44,7 +44,7 @@ public plugin_init()
public client_disconnect(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 szTeam[16],szName[MAX_NAME_LENGTH],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 )