I don’t need privileges for issuing / top on the flag, I just need the player’s chat prefix with [top5]
The plugin "Top SayPrefix", maybe this is added to your plugin, or please tell me what needs to be fixed in this code to work with your chat manager:
Код за потвърждение: Избери целия код
/*
CSTRIKE Top Say v. 0.4
by serfreeman1337 http://gf.hldm.org/
Thanks to:
damilurg for testing
v. 0.4 26.04.14
- general optimization (thx to Safety1st)
- add option to show rank position in prefix
- removed colored translit plugin support
v. 0.3 07.04.14
- optimization
- back-end compatibility with other plugins
v. 0.2 31.12.13
- added colored translit plugin support
v. 0.1 29.12.13
- adds prefix for top players in chat
*/
#include <amxmodx>
#include <csstats>
#define PLUGIN "Top SayPrefix"
#define VERSION "0.4"
#define AUTHOR "serfreeman1337"
#define TOP_RANK 30
#define TOP_PREFIX "^1[^4TOP-#rank#^1]"
new g_maxplayers
new msgHolder[191],msgLastId,Float:msgLastTime,bool:notRankedYet
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_message(get_user_msgid("SayText"),"Msg_SayText")
g_maxplayers = get_maxplayers()
}
public Msg_SayText(MsgID,MsgDEST,MsgPLAYER){
if(MsgDEST != MSG_ONE)
return PLUGIN_CONTINUE
new id = get_msg_arg_int(1)
if(!id || id > g_maxplayers)
return PLUGIN_CONTINUE
// проверяем кеш
if(msgLastId == id && msgLastTime == get_gametime()){
if(notRankedYet) // игрок без тега
return PLUGIN_CONTINUE
// сообщение из кеша
set_msg_arg_string(2,msgHolder)
return PLUGIN_CONTINUE
}
new st[8]
new rank = get_user_stats(id,st,st)
new str_rank[8]
num_to_str(rank,str_rank,7)
// проверяем на ТОП
if(rank > TOP_RANK){ // игрок не топ игрок
// записываем данные в кеш
notRankedYet = true
msgLastId = id
msgLastTime = get_gametime()
return PLUGIN_CONTINUE
}else // игрок ТОП, сбрасываем указатель
notRankedYet = false
new formatedMsg[191],chatMsg[191],contentMsg[191]
get_msg_arg_string(2,chatMsg,190)
get_msg_arg_string(4,contentMsg,190)
if(!strcmp(chatMsg,"#Cstrike_Chat_All")){
formatex(formatedMsg,190,"%s ^3%%s1^1 : %%s2",TOP_PREFIX)
}else
formatex(formatedMsg,190,"%s %s",TOP_PREFIX,chatMsg)
replace_all(formatedMsg,190,"#rank#",str_rank)
// не допускаем перехода лимита в 190 символов
if(strlen(formatedMsg) + strlen(contentMsg) >= 189){
new contentLen = (strlen(formatedMsg) + strlen(contentMsg)) - 188 // no have idea why 188 :D
contentLen = strlen(contentMsg) - contentLen
if(((contentMsg[contentLen - 1] & 0xFF) >= 0xC2) && ((contentMsg[contentLen - 1] & 0xFF) <= 0xEF)) // Don't truncate a double-byte character
contentLen--
contentMsg[contentLen] = 0
set_msg_arg_string(4,contentMsg)
}
set_msg_arg_string(2,formatedMsg)
// сохраняем наше сообщение в кеш
msgLastId = id
msgLastTime = get_gametime()
copy(msgHolder,190,formatedMsg)
return PLUGIN_CONTINUE
}
At the expense of the plug-in "CM: Steam Prefix 1.0" the amxx 1.8.2 compiler gives an error, please help too!
► Покажи скъсения текст
scripting\CMSteamPrefix.sma(31) : error 017: undefined symbol "cm_set_user_prefix"
//
// 1 Error.
// Could not locate output file compiled\CMSteamPrefix.amx (compile failed).
#define ARG_CITY "$city$"
► Покажи скъсения текст
scripting\crx_chatmanager.sma(917) : error 017: undefined symbol "geoip_city"
// \scripting\crx_chatmanager.sma(917) : error 088: number of arguments does not match definition
//
// 2 Errors.
// Could not locate output file compiled\crx_chatmanager.amx (compile failed).
Tell me what is wrong and what needs to be done to do this for further compilation?
And at the expense of correct operation, do you need an updated "amxmodx/data/GeoIP.dat" database?
#define ARG_COUNTRY "$country$"
#define ARG_COUNTRY_CODE "$country_code$"
Shows an error and the question (?) Specified in the config!
I apologize for having so many questions, but please be so kind as to help me with this difficult task