- Ошибка
-
фото с ошибкой ниже
- ОС
- Linux
- Amx Mod X
-
AMX Mod X 1.9.0.5232 (http://www.amxmodx.org)
- Билд
-
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.4.0.658-dev
Build date: 15:04:52 Aug 11 2018 (1582)
Build from: https://github.com/dreamstalker/rehlds/commit/0ce0af7
- ReGamedll
-
ReGameDLL version: 5.7.0.314-dev
Build date: 10:33:17 Oct 5 2018
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/7aeca16
- Версия Metamod
-
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 17:47:54 Aug 24 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/0cf2f70
- Список метамодулей
-
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] Reunion RUN - reunion_mm_i386.so v0.1.0.92 ini Start Never
[ 2] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 3] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 4] Revoice RUN - revoice_mm_i386.so v0.1.0.32 ini Start Never
[ 5] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5232 ini Start ANY
[ 6] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 7] WHBlocker RUN - whblocker_mm_i386.so v1.5.695 ini Chlvl ANY
[ 8] Fun RUN - fun_amxx_i386.so v1.9.0.5232 pl5 ANY ANY
[ 9] MySQL RUN - mysql_amxx_i386.so v1.9.0.5232 pl5 ANY ANY
[10] Engine RUN - engine_amxx_i386.so v1.9.0.5232 pl5 ANY ANY
[11] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5232 pl5 ANY ANY
[12] GeoIP RUN - geoip_amxx_i386.so v1.9.0.5232 pl5 ANY ANY
[13] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5232 pl5 ANY ANY
[14] CSX RUN - csx_amxx_i386.so v1.9.0.5232 pl5 ANY ANY
[15] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5232 pl5 ANY ANY
[16] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl5 ANY Never
[17] ReAPI RUN - reapi_amxx_i386.so v5.6.0.160-dev pl5 ANY Never
17 plugins, 17 running
- Список плагинов
-
Currently loaded plugins:
name version author file status
[ 1] admin_loader 0.3.7 kanagava admin_loader.am running
[ 2] FreshBans 1.3.7b kanagava fresh_bans.amxx running
[ 3] Admin Loader 2.5.2 neygomon admin_loader_fo running
[ 4] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 5] ReAPI Test 1.0 s1lent reapi_test.amxx running
[ 6] Aliases checker 1.0.3 kanagava alias_detector. running
[ 7] ReChecker Logging freesrv custom rc_logging.amxx running
[ 8] RC BaseChanger freesrv custom rc_basechanger. running
[ 9] amx_kickmenu reasons a 0.3a Beta Flash kickmenu_reason running
[ 10] Team Balance Control 1.3.9 gyxoBka TeamBalanceCont running
[ 11] block ip 0.2 legenda amx_blockip.amx running
[ 12] AMXX Gag 1.4.9 xPaw & Exolent amx_gag.amxx running
[ 13] Block reclams 1.5 Sutar block_reclams.a running
[ 14] Bad nick 2.0 termitok bad_nick.amxx running
[ 15] Ban Sound: Fresh Bans 1.0 Leo_[BH] fb_ban_sound.am running
[ 16] mute menu 1.0 cheap_suit mutemenu.amxx running
[ 17] Admin Chat 1.8.2 AMXX Dev Team adminchat.amxx running
[ 18] Admin Commands 1.8.2 AMXX Dev Team admincmd.amxx running
[ 19] Anti Flood 1.8.2 AMXX Dev Team antiflood.amxx running
[ 20] Commands Menu 1.8.2 AMXX Dev Team cmdmenu.amxx running
[ 21] Info. Messages 1.8.2 AMXX Dev Team imessage.amxx running
[ 22] AmxModMenu_New 1.0 CaNiBaL | Remake menufront.amxx running
[ 23] Maps Menu 1.8.1.3746 AMXX Dev Team mapsmenu.amxx running
[ 24] NextMap 1.8.2 AMXX Dev Team nextmap.amxx running
[ 25] Nextmap Chooser 1.8.2 AMXX Dev Team mapchooser.amxx running
[ 26] Players Menu 1.8.2 AMXX Dev Team plmenu.amxx running
[ 27] Plugin Menu 1.8.2 AMXX Dev Team pluginmenu.amxx running
[ 28] Restrict Weapons 1.8.2 AMXX Dev Team restmenu.amxx running
[ 29] TimeLeft 1.8.2 AMXX Dev Team timeleft.amxx running
[ 30] Scrolling Message 1.8.2 AMXX Dev Team scrollmsg.amxx running
[ 31] Admin Votes 1.8.2 AMXX Dev Team adminvote.amxx running
[ 32] CS Misc. Stats 1.8.2 AMXX Dev Team miscstats.amxx running
[ 33] CS Stats Logging 1.8.2 AMXX Dev Team stats_logging.a running
[ 34] Stats Configuration 1.8.2 AMXX Dev Team statscfg.amxx running
[ 35] Mode 2x2 1.9 s1lent mode.amxx running
[ 36] [ReAPI] AWPoff 1.4.3 PAffAEJIkA :3 awp_off.amxx running
[ 37] No Players Map 1.2 SKAJIbnEJIb no_players_map. running
[ 38] unknown unknown unknown resetscore.amxx running
[ 39] Admin ESP 0.3 Kost & miRror | admin_esp_mini. running
[ 40] Advanced MapChooser 1.4 neygomon advanced_mapcho running
[ 41] Auto recording demo 2.0 IzI | Bonaqua (R amx_autodemorec running
[ 42] [MvPRO] Ping Fixer 1.5 MvPRO Administra mvpro_pstable.a running
[ 43] c4 timer 1.1 cheap_suit c4timer.amxx running
[ 44] WeaponMenu 1.0 -NegaTiV- weaponmenu.amxx running
[ 45] Afk Control 0.5.1 neygomon afk_control.amx running
[ 46] Ping Control 1.31 neygomon Ping_Control.am running
[ 47] Killa HP 1.6 jas0n killa_hp.amxx running
[ 48] Advert Messages 1.2 neygomon adverts.amxx running
[ 49] IDEAL VIP 3.2.5 Ba/lePa | Remake ideal_vip.amxx running
[ 50] Prefix Manager 0.1 serfreeman1337 prefixManager.a running
[ 51] Advanced Experience Sy 0.4 serfreeman1337 aes_main.amxx running
[ 52] AES: StatsX 0.5+1 serfreeman1337 aes_statsx_cstr running
52 plugins, 52 running
- Автор плагина
- serfreeman1337
- Версия плагина
- #define VERSION "0.1"
- Исходный код
-
/*
* Prefix Manager v. 0.1
* by serfreeman1337 http://gf.hldm.org/
*/
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Prefix Manager"
#define VERSION "0.1"
#define AUTHOR "serfreeman1337"
// префикс по флагам
#define USE_PREFIX_ACCESS
// префикс для топ игроков
#define USE_PREFIX_TOP // cstrike only
// префикс по steamid
#define USE_PREFIX_STEAMID
// префикс по клиенту
#define USE_PREFIX_DPROTO // no steam only
// префикс звания из AES
#define USE_PREFIX_AES
#if defined USE_PREFIX_TOP
#include <csstats>
#endif
#if defined USE_PREFIX_AES
#include <aes_main>
#endif
enum _:cvars {
CVAR_MAX_PREFIXES
}
new cvar[cvars]
enum _:prfx {
PREFIX_ALL,
#if defined USE_PREFIX_ACCESS
PREFIX_ACCESS,
#endif
#if defined USE_PREFIX_TOP
PREFIX_TOP,
#endif
#if defined USE_PREFIX_STEAMID
PREFIX_STEAMID,
#endif
#if defined USE_PREFIX_DPROTO
PREFIX_DPROTO,
#endif
#if defined USE_PREFIX_AES
PREFIX_AES,
#endif
PREFIX_END
}
new prefixWayId[prfx][] = {
"all",
#if defined USE_PREFIX_ACCESS
"access",
#endif
#if defined USE_PREFIX_TOP
"top",
#endif
#if defined USE_PREFIX_STEAMID
"steamid",
#endif
#if defined USE_PREFIX_DPROTO
"dproto",
#endif
#if defined USE_PREFIX_AES
"aes",
#endif
""
}
enum _:prefixDataStruct {
PREFIX_ID,
PREFIX_POS,
PREFIX_DATA[128],
bool:PREFIX_FORMAT,
PREFIX_NAME[128],
PREFIX_WEIGHT,
PREFIX_GROUP,
Array:PREFIX_SKIP,
bool:PREFIX_UNCOUNT
}
new Array:prefixes
new prefixCount
new g_maxplayers
new teamMsgString[][] = {
"#Cstrike_Chat_CT",
"#Cstrike_Chat_T",
"#Cstrike_Chat_CT_Dead",
"#Cstrike_Chat_T_Dead",
"#Cstrike_Chat_Spec"
}
new Trie:teamMsgPointers
#if defined USE_PREFIX_STEAMID
new steamIdPrefix[33]
new Trie:prefixForId
#endif
#if defined USE_PREFIX_DPROTO
new pDprotoProvider
new playerClient[33]
#endif
new prefixMax
public plugin_init(){
register_plugin(PLUGIN,VERSION,AUTHOR)
// Максимальное кол-во префиксов
cvar[CVAR_MAX_PREFIXES] = register_cvar("pm_max_count","2")
}
/*
* загрузка конфигурации
*/
public plugin_cfg(){
new configFile[256]
get_configsdir(configFile,255)
add(configFile,255,"/prefixManager.ini")
new f = fopen(configFile,"rt")
if(!f){ // не удалось открыть конфиг-файл
log_amx("config file not found")
return PLUGIN_CONTINUE
}
prefixes = ArrayCreate(prefixDataStruct,1)
new buf[512]
new tmpWay[20],tmpData[128],tmpFormat[10],tmpName[128],tmpWeight[10],tmpSkip[20],tmpUncount[2],tmpGroup[10],datPrefixId
new prefixInfo[prefixDataStruct],bool:isTeamFormat,prefixNum
// читаем содержимое файла
while(!feof(f)){
fgets(f,buf,511)
trim(buf)
// пропускаем пустые строки и комментарии
if(!buf[0] || buf[0] == ';')
continue
// очищаем предыдущий результат
tmpWay[0] = 0 // указатель префикса
tmpData[0] = 0 // доп. информация для префикса
tmpFormat[0] = 0 // тип модифакции сообщений префиксом
tmpName[0] = 0 // название этого префикса
tmpSkip[0] = 0 // пропуск префиксов
tmpUncount[0] = 0 // не считать данный префикс
tmpGroup[0] = 0 // группа префикса
datPrefixId = -1 // ID префикса
parse(buf,tmpWay,19,tmpData,127,tmpFormat,9,tmpName,127,tmpWeight,9,tmpSkip,19,tmpUncount,1,tmpGroup,9)
// проверяем наличие признака префикса
for(new i ; i < prfx - 1 ; ++i){
if(strcmp(tmpWay,prefixWayId[i]) != 0)
continue
datPrefixId = i // нашли ID префикса
}
// префикс не найден, пероходим к следующей строке
if(datPrefixId == -1)
continue
arrayset(prefixInfo,0,prefixDataStruct)
// задаем параметры префикса
prefixInfo[PREFIX_ID] = datPrefixId // ID префикса
prefixInfo[PREFIX_POS] = prefixNum++
prefixInfo[PREFIX_FORMAT] = strcmp(tmpFormat,"prefix") == 0 ? false : true // форматирование чата или просто добавление префикса
prefixInfo[PREFIX_WEIGHT] = str_to_num(tmpWeight) // вес
prefixInfo[PREFIX_GROUP] = tmpGroup[0] ? str_to_num(tmpGroup) : 1
prefixInfo[PREFIX_UNCOUNT] = str_to_num(tmpUncount) ? true : false
// строим массив с префиксами для пропуска
if(tmpSkip[0]){
new stPos,ePos,rawPoint[20]
prefixInfo[PREFIX_SKIP] = _:ArrayCreate(1,1)
do {
ePos = strfind(tmpSkip[stPos],",")
formatex(rawPoint,ePos,tmpSkip[stPos])
ArrayPushCell(prefixInfo[PREFIX_SKIP] ,str_to_num(rawPoint))
stPos += ePos + 1
} while (ePos != -1)
}
replace_all2(tmpName,127,"^^1","^1")
replace_all2(tmpName,127,"^^2","^2")
replace_all2(tmpName,127,"^^3","^3")
replace_all2(tmpName,127,"^^4","^4")
replace_all2(tmpName,127,"%","%%")
// доп. обработка согласно префиксам
switch(datPrefixId){
case PREFIX_ALL: {
}
#if defined USE_PREFIX_ACCESS
case PREFIX_ACCESS:
prefixInfo[PREFIX_DATA][0] = read_flags(tmpData) // считаем бит сумму флагов
#endif
#if defined USE_PREFIX_TOP
case PREFIX_TOP:
prefixInfo[PREFIX_DATA][0] = str_to_num(tmpData)
#endif
#if defined USE_PREFIX_STEAMID
case PREFIX_STEAMID:{
if(prefixForId == Invalid_Trie)
prefixForId = TrieCreate()
prefixInfo[PREFIX_DATA][0] = prefixCount
TrieSetCell(prefixForId,tmpData,prefixCount)
}
#endif
#if defined USE_PREFIX_DPROTO
case PREFIX_DPROTO:
prefixInfo[PREFIX_DATA][0] = str_to_num(tmpData)
#endif
#if defined USE_PREFIX_AES
case PREFIX_AES:{}
#endif
default: continue
}
if(prefixInfo[PREFIX_FORMAT] && contain(tmpName,"#team#") != -1)
isTeamFormat = true
copy(prefixInfo[PREFIX_NAME],127,tmpName)
ArrayPushArray(prefixes,prefixInfo)
prefixCount ++
}
fclose(f)
if(!prefixCount)
return PLUGIN_CONTINUE
// сортировка префиксов по весу
#if AMXX_VERSION_NUM < 183
ArraySort(prefixes,"SortPrefixesByWeight")
#else
ArraySortEx(prefixes,"SortPrefixesByWeight")
#endif
if(isTeamFormat){
teamMsgPointers = TrieCreate()
for(new i ; i < sizeof teamMsgString ; ++i)
TrieSetCell(teamMsgPointers,teamMsgString[i],1)
}
#if defined USE_PREFIX_DPROTO
pDprotoProvider = get_cvar_pointer( "dp_r_id_provider" ) // dproto interface
#endif
g_maxplayers = get_maxplayers()
prefixMax = get_pcvar_num(cvar[CVAR_MAX_PREFIXES])
register_message(get_user_msgid("SayText"),"MsgHook_SayText")
register_dictionary("prefixManager.txt")
return PLUGIN_CONTINUE
}
public client_putinserver(id){
#if defined USE_PREFIX_STEAMID
new authId[36]
get_user_authid(id,authId,35)
if(prefixForId == Invalid_Trie || !TrieGetCell(prefixForId,authId,steamIdPrefix[id]))
steamIdPrefix[id] = -1
#endif
#if defined USE_PREFIX_DPROTO
if(!pDprotoProvider){
playerClient[id] = 0
}else if( is_user_bot(id) || is_user_hltv(id) )
playerClient[id] = 0
else {
server_cmd( "dp_clientinfo %d", id )
server_exec()
playerClient[id] = get_pcvar_num(pDprotoProvider)
}
#endif
}
#if AMXX_VERSION_NUM >= 183
public SortPrefixesByWeight(Array:array, prefix1[], prefix2[]){
if(prefix1[PREFIX_WEIGHT] > prefix2[PREFIX_WEIGHT])
return -1
else if (prefix1[PREFIX_WEIGHT] < prefix2[PREFIX_WEIGHT])
return 1
return 0
}
#else
public SortPrefixesByWeight(Array:array, item1, item2){
new prefix1[prefixDataStruct],prefix2[prefixDataStruct]
ArrayGetArray(array,item1,prefix1)
ArrayGetArray(array,item2,prefix2)
if(prefix1[PREFIX_WEIGHT] > prefix2[PREFIX_WEIGHT])
return -1
else if (prefix1[PREFIX_WEIGHT] < prefix2[PREFIX_WEIGHT])
return 1
return 0
}
#endif
public MsgHook_SayText(msgId,msgDest,reciever){
if(msgDest != MSG_ONE)
return PLUGIN_CONTINUE
new id = get_msg_arg_int(1)
if( !(0 < id <= g_maxplayers) )
return PLUGIN_CONTINUE
static formatedMsg[191],chatHead[191],contentMsg[191]
static msgLastId,Float:msgLastTime
if(msgLastId == id && msgLastTime == get_gametime()){
set_msg_arg_string(2,formatedMsg)
set_msg_arg_string(4,contentMsg)
return PLUGIN_CONTINUE
}
new len,bool:isTeamMsg
get_msg_arg_string(2,chatHead,190) // указатель
get_msg_arg_string(4,contentMsg,190) // сообщение
if(teamMsgPointers)
isTeamMsg = TrieGetCell(teamMsgPointers,chatHead,isTeamMsg)
if(!FormatPrefixes(id,formatedMsg,190,len,isTeamMsg)){
if(!strcmp(chatHead,"#Cstrike_Chat_All"))
len += formatex(formatedMsg[len],190-len,"^3%%s1^1 : %%s2")
else
len += formatex(formatedMsg[len],190-len,"%s",chatHead)
}
// не допускаем перехода лимита в 190 символов
if(strlen(formatedMsg) + strlen(contentMsg) >= 190){
new contentLen = 190 - strlen(chatHead) - strlen(contentMsg)
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()
return PLUGIN_CONTINUE
}
/*
* функция форматирования сообщения с префиксом
*/
public FormatPrefixes(id,fmt[],maxlen,&len,bool:isTeam){
new prefixInfo[prefixDataStruct]
new fmtPrefixes,msgFormer[128]
new Array:skipArray
len += formatex(fmt[len],maxlen-len,"^1")
new startLen = len // запоминаем для режима форматирования всего сообщения
static Trie:prefixByGroup,bool:prefixGroup
prefixGroup = false
for(new i ; i < prefixCount ; i++){
ArrayGetArray(prefixes,i,prefixInfo)
if(!prefixInfo[PREFIX_FORMAT] && fmtPrefixes >= prefixMax)
continue
if(skipArray && check_prefix_for_skip(skipArray,prefixInfo[PREFIX_POS]))
continue
switch(prefixInfo[PREFIX_ID]){
#if defined USE_PREFIX_ACCESS
case PREFIX_ACCESS:
if(!(get_user_flags(id) & prefixInfo[PREFIX_DATA][0]))
continue
#endif
#if defined USE_PREFIX_TOP
case PREFIX_TOP:{
new st[8],rank = get_user_stats(id,st,st)
if(rank > prefixInfo[PREFIX_DATA][0])
continue
new rankStr[10]
num_to_str(rank,rankStr,9)
replace_all2(prefixInfo[PREFIX_NAME],127,"#rank#",rankStr)
}
#endif
#if defined USE_PREFIX_STEAMID
case PREFIX_STEAMID:{
if(steamIdPrefix[id] == -1)
continue
else if(steamIdPrefix[id] != prefixInfo[PREFIX_DATA][0])
continue
}
#endif
#if defined USE_PREFIX_DPROTO
case PREFIX_DPROTO:
if(playerClient[id] != prefixInfo[PREFIX_DATA][0])
continue
#endif
#if defined USE_PREFIX_AES
case PREFIX_AES:{
new aStats[AES_ST_END],levelName[64]
aes_get_player_stats(id,aStats)
aes_get_level_name(aStats[AES_ST_LEVEL],levelName,63,LANG_SERVER)
replace_all2(prefixInfo[PREFIX_NAME],127,"#rank#",levelName)
}
#endif
}
if(prefixInfo[PREFIX_SKIP] != Invalid_Array)
skipArray = prefixInfo[PREFIX_SKIP]
// это простой префикс
if(!prefixInfo[PREFIX_FORMAT]){
if(prefixInfo[PREFIX_GROUP] == 1){
len += formatex(fmt[len],maxlen - len,"%s%s",fmtPrefixes ? " " : "",prefixInfo[PREFIX_NAME])
if(!prefixInfo[PREFIX_UNCOUNT])
fmtPrefixes ++
else if(!fmtPrefixes)
len += formatex(fmt[len],maxlen - len," ")
}else{
if(prefixByGroup == Invalid_Trie)
prefixByGroup = TrieCreate()
new groupKey[14],groupText[191],groupLen
formatex(groupKey,13,"#prefix%d#",prefixInfo[PREFIX_GROUP])
TrieGetString(prefixByGroup,groupKey,groupText,190)
groupLen = strlen(groupText)
formatex(groupText[groupLen],190 - groupLen,"%s%s",groupLen ? " " : "",prefixInfo[PREFIX_NAME])
TrieSetString(prefixByGroup,groupKey,groupText)
prefixGroup = true
}
}else if(!msgFormer[0]) // это режим форматирования вида сообщения
copy(msgFormer,127,prefixInfo[PREFIX_NAME])
arrayset(prefixInfo,0,prefixDataStruct)
}
if(fmtPrefixes)
len += formatex(fmt[len],maxlen - len," ")
// форматирование сообщения
if(msgFormer[0]){
replace_all2(msgFormer,127,"#prefix#",fmt) // заменяем на префиксы
if(prefixGroup){ // груповой префикс
new w,l,r = 0
new raw[14],groupText[191]
new fmted
do {
w = contain(msgFormer[l],"#prefix")
if(w == -1)
break
l += w + 7
r = contain(msgFormer[l],"#") + l
if(r - l <= 0)
continue
formatex(raw,r - l,msgFormer[l])
formatex(raw,13,"#prefix%d#",str_to_num(raw))
if(!TrieGetString(prefixByGroup,raw,groupText,190)){
replace(msgFormer,127,raw,"")
l -= strlen(raw) - 2
}else{
formatex(groupText,190,"%s%s",fmted ? " " : "",groupText)
replace_all2(msgFormer,127,raw,groupText)
l += strlen(groupText) - strlen(raw)
fmted ++
}
} while(l != -1)
TrieClear(prefixByGroup)
}
// тег команды для чата
if(contain(msgFormer,"#team#") != -1){
if(isTeam){
new lngKey[11],teamTag[30]
formatex(lngKey,10,"CHAT_TEAM%d",get_user_team(id))
formatex(teamTag,29,"%L",LANG_SERVER,lngKey)
replace_all2(msgFormer,127,"#team#",teamTag)
}else
replace_all2(msgFormer,127,"#team#","")
}
// тег убитого
if(contain(msgFormer,"#dead#") != -1){
if(!is_user_alive(id)){
new deadTag[30]
formatex(deadTag,29,"%L",LANG_SERVER,get_user_team(id) != 0 ? "CHAT_DEAD" : "CHAT_DEAD0")
replace_all2(msgFormer,127,"#dead#",deadTag)
}else
replace_all2(msgFormer,127,"#dead#","")
}
len = formatex(fmt[startLen],maxlen - startLen,msgFormer)
}
return msgFormer[0] ? true : false
}
check_prefix_for_skip(Array:which,prefixNum){
for(new i ; i < ArraySize(which) ; ++i)
if(ArrayGetCell(which,i) == prefixNum)
return true
return false
}
/* Replaces a contained string iteratively.
* This ensures that no infinite replacements will take place by
* intelligently moving to the next string position each iteration.
*/
/*
* небольшой фикс от serfreeman1337
* прекращаем заменять если не хвататет места
* чтобы избежать проблем с replace() buffer not big enough
*/
stock replace_all2(string[], len, const what[], const with[])
{
new pos = 0;
if ((pos = contain(string, what)) == -1)
{
return 0;
}
new total = 0;
new with_len = strlen(with);
new diff = strlen(what) - with_len;
new total_len = strlen(string);
new temp_pos = 0;
while (total_len + with_len < len && replace(string[pos], len - pos, what, with) != 0)
{
total++;
/* jump to position after replacement */
pos += with_len;
/* update cached length of string */
total_len -= diff;
/* will the next call be operating on the last character? */
if (pos >= total_len)
{
break;
}
/* find the next position from our offset */
temp_pos = contain(string[pos], what);
/* if it's invalid, we're done */
if (temp_pos == -1)
{
break;
}
/* otherwise, reposition and update counters */
pos += temp_pos;
}
return total;
}
Здравствуйте , если заходить со steam клиента то выдаёт в чате [TOP-1] [ADMIN] s1 : s2 , а если заходить с no steam клиента то плагин работает нормально.
Что нужно сделать чтоб со steam клиента плагин работал стабильно ?
Что нужно сделать чтоб со steam клиента плагин работал стабильно ?
В этой теме было размещено решение! Перейти к решению.
Download all Attachments
-
1.2 MB Просмотры: 350
-
1.4 MB Просмотры: 334
-
1.4 MB Просмотры: 337