Can anyone tell me why is this not running. Appears "bad load" in amx_plugins.
Thanks.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <reapi>
new Float:g_fDamagect[33], g_iBestCtIndex, Float:g_fDamagete[33], g_iBestTeIndex
new szNameCt[32], szNameTe[32]
public plugin_init() {
register_plugin("Best CT & T", "1.0", "blabla")
RegisterHam(Ham_TakeDamage, "player", "Fw_TakeDamage_Post", 1)
register_logevent("RoundEnd", 2, "1=Round_End")
register_logevent("RoundStart", 2, "1=Round_Start")
register_clcmd("say /best", "ShowBest")
}
public Fw_TakeDamage_Post(iVictim, iInflictor, iAttacker, Float:fDamage, bitsDamageType)
{
if (!is_user_alive(iVictim) || !is_user_alive(iAttacker) || get_user_team(iVictim) != get_user_team(iAttacker))
return HAM_IGNORED
g_fDamagect[iAttacker] += fDamage
g_fDamagete[iAttacker] += fDamage
return HAM_HANDLED
}
public RoundEnd()
{
Get_Best_CT()
Get_Best_T()
get_user_name(g_iBestCtIndex, szNameCt, charsmax(g_iBestCtIndex))
get_user_name(g_iBestTeIndex, szNameTe, charsmax(g_iBestTeIndex))
if (g_iBestCtIndex == 0 || g_fDamagect[g_iBestCtIndex] == 0.0)
client_print(0, print_chat, "[Best Player] No best Counter-Terrorist this round.")
if (g_iBestTeIndex == 0 || g_fDamagete[g_iBestTeIndex] == 0.0)
client_print(0, print_chat, "[Best Player] No best Terrorist this round.")
set_hudmessage(0, 255, 0, -1.0, 0.23, 0, 6.0, 5.0)
show_hudmessage(0, "Best Counter Terrorist was [ %s ] with [ %i ] damage^n^nBest Terrorist was [ %s ] with [ %i ] damage", szNameCt, floatround(g_fDamagect[g_iBestCtIndex]), szNameTe, floatround(g_fDamagete[g_iBestTeIndex]))
}
public ShowBest(id)
{
Get_Best_CT()
Get_Best_T()
get_user_name(g_iBestCtIndex, szNameCt, charsmax(szNameCt)) // defender name
get_user_name(g_iBestTeIndex, szNameTe, charsmax(szNameTe)) // infector name
set_hudmessage(0, 255, 0, -1.0, 0.23, 0, 6.0, 5.0)
show_hudmessage(id, "Best Counter Terrorist is [ %s ] with [ %i ] damage^n^nBest Terrorist is [ %s ] with [ %i ] damage", szNameCt, floatround(g_fDamagect[g_iBestCtIndex]), szNameTe, floatround(g_fDamagete[g_iBestTeIndex]))
}
public RoundStart() // new round
{
set_task(3.0, "ResetDmg")
}
public ResetDmg() // reset Damage and Infects at new round start
{
for (new i = 1; i <= get_member_game(m_nMaxPlayers); i++)
{
g_fDamagect[i] = 0.0 // Reset Damage
g_fDamagete[i] = 0.0 // Reset Infects
}
}
public Get_Best_CT()
{
new Float:fTemp = 0.0
for (new i = 1; i <= get_member_game(m_nMaxPlayers); i++)
{
if (!is_user_connected(i))
continue
if (g_fDamagect[i] > fTemp)
{
fTemp = g_fDamagect[i]
g_iBestCtIndex = i
}
}
}
public Get_Best_T()
{
new Float:fTempp = 0.0
for (new i = 1; i <= get_member_game(m_nMaxPlayers); i++)
{
if (!is_user_connected(i))
continue
if (g_fDamagete[i] > fTempp)
{
fTempp = g_fDamagete[i]
g_iBestTeIndex = i
}
}
}