Код за потвърждение: Избери целия код
#include <amxmodx>
#include <chatmanager>
#if !defined MAX_PLAYERS
const MAX_PLAYERS = 32
#endif
#define STEAM_PREFIX "&x04[Steam]"
new bool:g_bIsSteam[MAX_PLAYERS + 1]
public plugin_init()
{
register_plugin("CM: Steam Prefix", "1.0", "OciXCrom")
}
public client_authorized(id)
{
g_bIsSteam[id] = is_user_steam(id)
if(g_bIsSteam[id])
{
cm_on_player_data_updated(id)
}
}
public cm_on_player_data_updated(id)
{
if(g_bIsSteam[id])
{
cm_set_user_prefix(id, STEAM_PREFIX)
}
}
bool:is_user_steam(id)
{
static iPointer
if(iPointer || (iPointer = get_cvar_pointer("dp_r_id_provider")))
{
server_cmd("dp_clientinfo %d", id)
server_exec()
return get_pcvar_num(iPointer) == 2
}
return false
}
Код за потвърждение: Избери целия код
#include <amxmodx>
#include <chatmanager>
#include <csstats>
const TOP_RANK = 30
#define TOP_PREFIX "&x04[Top%i]"
public plugin_init()
{
register_plugin("CM: Top Prefix", "1.1", "OciXCrom")
}
public cm_on_player_data_updated(id)
{
static szRank[32], iStats[8], iHits[8]
get_user_stats(id, iStats, iHits)
if(iStats[7] <= TOP_RANK)
{
formatex(szRank, charsmax(szRank), TOP_PREFIX, iStats[7])
cm_set_user_prefix(id, szRank)
}
}
If they work together, then the prefix only shows: [$countr$][Top5]: Message, it is not displayed [steam][$admin_prefix$]
If you disable Steam and Top plugins, the chatmanager displays: [$countr$][$admin_prefix$]: Message
Another error in the logs!
Код за потвърждение: Избери целия код
L 03/22/2021 - 22:33:06: Start of error session.
L 03/22/2021 - 22:33:06: Info (map "$2000$") (file "addons/amxmodx/logs/error_20210322.log")
L 03/22/2021 - 22:33:06: replace() buffer not big enough (119>=97)
L 03/22/2021 - 22:33:06: [AMXX] Run time error 10 (plugin "crx_chatmanager4.8.amxx") (native "replace") - debug not enabled!
L 03/22/2021 - 22:33:06: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).