Sorry about the cl_buy, I tought you knew where to download it -
https://forums.alliedmods.net/showthread.php?t=149380
About the debug, that's what I was doing, Bugsy already told me to always do it when something return a invalid value:
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
enum Settings
{
arPlayerKills,
}
new PlayerData[33][Settings]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg","death","a")
set_task(1.0,"showHud",. flags = "b")
}
public death()
{
PlayerData[read_data(1)][arPlayerKills]++
}
public showHud()
{
new iMostSays = GetTop(arPlayerKills)
new UserName[32]
get_user_name(iMostSays, UserName, 31)
set_hudmessage(0,255,0, -1.0, 0.0, 0, 1.0, 1.0)
show_hudmessage(0,"First Player: %s, Kills: %d",UserName, PlayerData[iMostSays][arPlayerKills])
}
GetTop(Settings:arOffset)
{
new Players[32], iPlayersnum, data[1]
data[0] = any:arOffset
get_players(Players, iPlayersnum)
SortCustom1D(Players, iPlayersnum, "SortCustom", data, 1)
return Players[0]
}
public SortCustom(elem1, elem2, array[], data[], datasize)
{
new Settings:arOffset
if(!datasize)
arOffset = Settings:data[0]
if(PlayerData[elem1][arOffset] > PlayerData[elem2][arOffset])
return -1
else if(PlayerData[elem1][arOffset] < PlayerData[elem2][arOffset])
return 1
return 0
}
I have 7 kills and the bot have 4, it shows the bot's name, not mine.
__________________