Участник
Пользователь
- Сообщения
- 175
- Реакции
- 11
- Ошибка
-
L 03/17/2018 - 19:40:32: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20180317.log")
L 03/17/2018 - 19:40:32: [ReAPI] RegisterHookChain: function with id (6149) doesn't exist in current API version.
L 03/17/2018 - 19:40:32: [AMXX] Displaying debug trace (plugin "aes_exp_cstrike.amxx", version "0.5.9 [REAPI]")
L 03/17/2018 - 19:40:32: [AMXX] Run time error 10: native error (native "RegisterHookChain")
L 03/17/2018 - 19:40:32: [AMXX] [0] aes_exp_cstrike.sma::plugin_cfg (line 129)
- ОС
- Linux
- Билд
-
3.4.0.639-dev
- ReGamedll
-
5.7.0.295-dev
- Список метамодулей
-
[ 1] Reunion RUN - reunion_mm_i386. v0.1.75 ini Start Never
[ 2] ReAuthCheck RUN - reauthcheck_mm_i v0.1.6 ini Start Never
[ 3] Rechecker RUN - rechecker_mm_i38 v2.3 ini Chlvl ANY
[ 4] VoiceTranscoder RUN - VoiceTranscoder. v2017RC3 ini ANY ANY
[ 5] ReSemiclip RUN - resemiclip_mm_i3 v2.3.9 ini Chlvl ANY
[ 6] WHBlocker RUN - whblocker_mm_i38 v1.5.692 ini Chlvl ANY
[ 7] AMX Mod X RUN - amxmodx_mm_i386. v1.8.3-R ini Start ANY
[ 8] ReSRDetector RUN - resrdetector_mm_ v0.1.0 ini Chlvl ANY
[ 9] ReAPI RUN - reapi_amxx_i386. v5.2.0.1 pl7 ANY Never
[10] ReAimDetector RUN - reaimdetector_am v0.2.2 pl7 ANY Never
[11] FakeMeta RUN - fakemeta_amxx_i3 v1.8.3-R pl7 ANY ANY
[12] MySQL RUN - mysql_amxx_i386. v1.8.3-R pl7 ANY ANY
[13] Ham Sandwich RUN - hamsandwich_amxx v1.8.3-R pl7 ANY ANY
[14] Engine RUN - engine_amxx_i386 v1.8.3-R pl7 ANY ANY
[15] CStrike RUN - cstrike_amxx_i38 v1.8.3-R pl7 ANY ANY
15 plugins, 15 running
- Список плагинов
-
name version author file status
[ 1] Admin Loader 3.3.0 neygomon | Radiu admin_loader.am running
[ 2] FreshBans 1.3.8b kanagava fresh_bans_138_ running
[ 3] DopBan 2.6.5e kanagava dop_ban2.amxx running
[ 4] Flags by TOP 1.1.1 serfreeman1337 flags_by_top.am running
[ 5] [ReAPI] IDEAL VIP by W 1.4.8 Wikiname (Remake reapi_ideal_vip running
[ 6] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 7] Advanced Client Checke 0.3.4 Mistrick cmdchecker.amxx running
[ 8] RC BaseChanger freesrv AMXX rc_basechanger. running
[ 9] ReChecker Logging freesrv AMXX rc_logging.amxx running
[ 10] Gag Me 2.3.2 Radius gag_me.amxx running
[ 11] [SWPlug] Server Menu 1.0 Trendy menuserver.amxx running
[ 12] Mode 2x2 2.x.4 s1lent & neugomo mode_full_reapi running
[ 13] Lite Admin ESP 1.0 neygomon admin_esp.amxx running
[ 14] Admin Votes 1.8.3-Re AMXX Dev Team adminvote.amxx running
[ 15] CSStatsX SQL 0.7.4 serfreeman1337 csstatsx_sql.am running
[ 16] unknown unknown unknown flash.amxx running
[ 17] Marsho ScreenFade 0.0.4 csmarsho screenfade.amxx running
[ 18] Admin Free Look 1.3.2 Radius admin_free_look running
[ 19] Best Damage Bonus 1.0.2 Vaqtincha | Radi best_damage_bon running
[ 20] New Kick Menu 1.4.0 Radius newkickmenu.amx running
[ 21] MOTD ADMIN/VIP 1.0 marsho motd_plugin2.am running
[ 22] AES Bonus: Flags 0.1 Sonyx aes_bonus_flags running
[ 23] Night Mode 1.2.3 Radius night_mode.amxx running
[ 24] Parachute 1.4 [ReAPI Random1, cpCTRL re_parachute.am running
[ 25] Map Manager 2.5.61 Mistrick mapmanager.amxx running
[ 26] Lite Recoder 1.0.1 neygomon amx_demorec_3.a running
[ 27] Admin Check 1.51 OneEyed admin_check.amx running
[ 28] C4 Timer on roundtime 0.3.3a neygomon c4timer.amxx running
[ 29] Maps Menu 1.4.1 neugomon mapsmenu_by_ney running
[ 30] Menus Front-End 1.4 neugomon menufront_n.amx running
[ 31] Silly C4 1.1 Cheap_Suit sillyc4.amxx running
[ 32] Players Menu 1.7 neugomon players_menu.am running
[ 33] Adverts 1.0 pUzzlik adverts_message running
[ 34] Weapon Restrict 1.7 s1lent weapon_rest.amx running
[ 35] Say me and Say hp 1.4 neygomon sayme.amxx running
[ 36] AES: StatsX 0.5.9 [REA serfreeman1337/s aes_statsx_cstr running
[ 37] Stats Configuration 1.8.3-Re AMXX Dev Team statscfg.amxx running
[ 38] FM ResetScore 0.1 neygomon fm_rs.amxx running
[ 39] AFK Control 1.4.1 [Rnd neygomon afk_control.amx running
[ 40] Ping Control 1.31 neygomon Ping_Control.am running
[ 41] Kills Counter 1.0 Safety1st killscounter.am running
[ 42] Lite VoteBan 1.4 neygomon lite_voteban.am running
[ 43] Damager Advanced 1.1.1 Radius (based on damager_advance running
[ 44] WeaponState Remember 0.0.4 Vaqtincha weaponstate_rem running
[ 45] Steam Bonus 1.1 ill+F@nToM steam_bonus_a2. running
[ 46] Block 'Fire in the hol 0.1 Safety1st block_fire_in_t running
[ 47] Chat Manager 1.1.1-11 Mistrick chatmanager.amx running
[ 48] Advanced Experience Sy 0.5.9 [REA serfreeman1337/s aes_main.amxx running
[ 49] AES: CStrike Addon 0.5.9 [REA serfreeman1337/s aes_exp_cstrike debug
[ 50] AES: Informer 0.5.9 [REA serfreeman1337/s aes_informer.am running
[ 51] AES: Admin Tools 0.5.9 [REA serfreeman1337/s aes_exp_editor. running
[ 52] AES: Bonus System 0.5.9 Vega serfreeman1337/s aes_bonus_syste running
[ 53] AES: Bonus CSTRIKE 0.5.9 [REA serfreeman1337/s aes_bonus_cstri running
53 plugins, 53 running
- Исходный код
-
/*
* AES: CStrike Addon v. 0.5
* by serfreeman1337 http://1337.uz/
*/
#include <amxmodx>
#include <reapi>
#include <aes_v>
#define PLUGIN "AES: CStrike Addon"
#define VERSION "0.5.9 [REAPI]"
#define AUTHOR "serfreeman1337/sonyx"
#define LASTUPDATE "12, March (03), 2018"
#if AMXX_VERSION_NUM < 183
#include <colorchat>
#define print_team_default DontChange
#define print_team_grey Grey
#define print_team_red Red
#define print_team_blue Blue
#define MAX_NAME_LENGTH 32
#define MAX_PLAYERS 32
#define client_disconnected client_disconnect
new MaxClients
#endif
/* - CVARS - */
enum _:cvars_num {
CVAR_XP_KILL,
CVAR_XP_HS,
CVAR_XP_C4_PLANT,
CVAR_XP_C4_EXPLODE,
CVAR_XP_C4_DEFUSED,
CVAR_XP_FFA,
CVAR_XP_HOST_GOT,
CVAR_XP_HOST_RESCUE,
CVAR_XP_HOST_KILL,
CVAR_XP_VIP_ESCAPED,
CVAR_XP_VIP_KILLED,
CVAR_XP_GOAL_MIN_PLAYERS,
CVAR_XP_DEATH,
CVAR_ANEW_FRAGS,
CVAR_ANEW_HS,
CVAR_ANEW_KNIFE,
CVAR_ANEW_HE,
CVAR_ANEW_REST,
CVAR_LEVEL_BONUS,
CVAR_RANK,
CVAR_BONUS_ENABLE
}
new cvar[cvars_num]
/* - ADD BONUS - */
enum _:
{
STREAK_KILLS,
STREAK_HS,
STREAK_KNIFE,
STREAK_HE,
STREAK_OPT
}
enum _:Arrays{
Array:FRAG_ARRAY,
Array:HS_ARRAY,
Array:KNIFE_ARRAY,
Array:HE_ARRAY
}
new Array: g_BonusCvars[Arrays];
new frArrSize,hsArrSize,kfArrSize,heArrSize;
new bool:is_by_stats;
new g_Planter;
new g_Players[MAX_PLAYERS + 1][STREAK_OPT];
native get_user_stats(index, stats[8], bodyhits[8]);
native get_user_stats2(index, stats[4]);
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
cvar[CVAR_XP_KILL] = register_cvar("aes_xp_frag","1");
cvar[CVAR_XP_HS] = register_cvar("aes_xp_hs","2");
cvar[CVAR_XP_C4_PLANT] = register_cvar("aes_xp_c4_plant","1");
cvar[CVAR_XP_C4_EXPLODE] = register_cvar("aes_xp_c4_explode","3");
cvar[CVAR_XP_C4_DEFUSED] = register_cvar("aes_xp_c4_defused","4");
cvar[CVAR_XP_HOST_GOT] = register_cvar("aes_xp_hostage_got","1");
cvar[CVAR_XP_HOST_RESCUE] = register_cvar("aes_xp_hostage_rescue","1");
cvar[CVAR_XP_HOST_KILL] = register_cvar("aes_xp_hostage_kill","0");
cvar[CVAR_XP_VIP_ESCAPED] = register_cvar("aes_xp_vip_escaped","4");
cvar[CVAR_XP_VIP_KILLED] = register_cvar("aes_xp_vip_killed","4");
cvar[CVAR_XP_GOAL_MIN_PLAYERS] = register_cvar("aes_xp_goal_min_players","4");
cvar[CVAR_XP_FFA] = register_cvar("aes_xp_ffa","0");
cvar[CVAR_ANEW_FRAGS] = register_cvar("aes_anew_frags","10 1 20 2 30 3 40 5");
cvar[CVAR_ANEW_HS] = register_cvar("aes_anew_hs","7 1 14 2 20 3 30 4");
cvar[CVAR_ANEW_KNIFE] = register_cvar("aes_anew_knife","1 1 2 1 3 1 4 1");
cvar[CVAR_ANEW_HE] = register_cvar("aes_anew_he","4 1 5 1 6 1 7 2");
cvar[CVAR_ANEW_REST] = register_cvar("aes_anew_reset","1");
cvar[CVAR_LEVEL_BONUS] = register_cvar("aes_bonus_levelup","3");
cvar[CVAR_XP_DEATH] = register_cvar("aes_xp_death","0");
#if AMXX_VERSION_NUM < 183
MaxClients = get_maxplayers();
#endif
}
public plugin_cfg()
{
cvar[CVAR_RANK] = get_cvar_pointer("aes_track_mode");
if((cvar[CVAR_RANK] = get_cvar_pointer("aes_track_mode")) == 0)
set_fail_state("cvar ^"aes_track_mode^" not found");
RegisterHookChain(RG_CGrenade_ExplodeBomb, "CGrenade_ExplodeBomb", true);
RegisterHookChain(RG_PlantBomb, "PlantBomb", true);
RegisterHookChain(RG_CGrenade_DefuseBombEnd, "CGrenade_DefuseBombEnd", true);
RegisterHookChain(RG_CBasePlayer_AddAccount, "CBasePlayer_AddAccount", true);
RegisterHookChain(RG_CSGameRules_DeathNotice, "CSGameRules_DeathNotice", true);
cvar[CVAR_BONUS_ENABLE] = get_cvar_pointer("aes_bonus_enable");
if(!cvar[CVAR_BONUS_ENABLE])
return;
g_BonusCvars[FRAG_ARRAY] = ArrayCreate(2);
g_BonusCvars[HS_ARRAY] = ArrayCreate(2);
g_BonusCvars[KNIFE_ARRAY] = ArrayCreate(2);
g_BonusCvars[HE_ARRAY] = ArrayCreate(2);
new levelString[512];
get_pcvar_string(cvar[CVAR_ANEW_FRAGS],levelString,charsmax(levelString));
frArrSize = parse_aes_bonus_values(g_BonusCvars[FRAG_ARRAY],levelString);
get_pcvar_string(cvar[CVAR_ANEW_HS],levelString,charsmax(levelString));
hsArrSize = parse_aes_bonus_values(g_BonusCvars[HS_ARRAY],levelString);
get_pcvar_string(cvar[CVAR_ANEW_KNIFE],levelString,charsmax(levelString));
kfArrSize = parse_aes_bonus_values(g_BonusCvars[KNIFE_ARRAY],levelString);
get_pcvar_string(cvar[CVAR_ANEW_HE],levelString,charsmax(levelString));
heArrSize = parse_aes_bonus_values(g_BonusCvars[HE_ARRAY],levelString);
if(get_pcvar_num(cvar[CVAR_RANK])== -1)
{
RegisterHookChain(RG_CBasePlayer_Spawn, "CBasePlayer_Spawn", true);
is_by_stats = true;
}
}
//
// Расчет опыта по статистике игрока из CSX
//
public CBasePlayer_Spawn(const id)
{
if(!is_user_alive(id))
return;
new stats[8],bprelated[4],bh[8];
get_user_stats(id,stats,bh);
get_user_stats2(id,bprelated);
new Float:exp = get_exp_for_stats(stats,bprelated);
aes_set_player_exp(id,exp,true,true);
}
//
// native Float:aes_search_exp_in_stats(stats[8],stats2[4])
//
public plugin_natives()
{
register_native("aes_get_exp_for_stats_f","_aes_get_exp_for_stats_f");
register_native("aes_get_exp_for_stats","_aes_get_exp_for_stats");
}
public Float:_aes_get_exp_for_stats_f(plugin_id,params)
{
/*if(!is_by_stats)
return -1.0;*/
if(params != 2)
{
log_error(AMX_ERR_NATIVE,"bad arguments num, expected 2, passed %d",params);
return 0.0;
}
new stats[8],bprelated[4];
get_array(1,stats,sizeof stats);
get_array(2,bprelated,sizeof bprelated);
return get_exp_for_stats(stats,bprelated);
}
public _aes_get_exp_for_stats(plugin_id,params)
{
if(!is_by_stats)
return -1;
if(params != 2)
{
log_error(AMX_ERR_NATIVE,"bad arguments num, expected 2, passed %d",params);
return 0;
}
new stats[8],bprelated[4];
get_array(1,stats,sizeof stats);
get_array(2,bprelated,sizeof bprelated);
return floatround(get_exp_for_stats(stats,bprelated));
}
Float:get_exp_for_stats(stats[8],bprelated[4])
{
stats[0] = stats[0] - stats[2];
new Float:exp = (float(stats[0]) * get_pcvar_float(cvar[CVAR_XP_KILL])) + (float(stats[2]) * get_pcvar_float(cvar[CVAR_XP_HS]));
exp += (float(bprelated[2]) * get_pcvar_float(cvar[CVAR_XP_C4_PLANT])) + (float(bprelated[3]) * get_pcvar_float(cvar[CVAR_XP_C4_EXPLODE]));
exp += float(bprelated[1]) * get_pcvar_float(cvar[CVAR_XP_C4_DEFUSED]);
return exp;
}
public client_disconnected(id)
if(cvar[CVAR_BONUS_ENABLE])
arrayset(g_Players[id],0,STREAK_OPT);
public CSGameRules_DeathNotice(const victim, const killer, pevInflictor)
{
if(!(0 < killer <= MaxClients) || killer == victim || !is_user_connected(victim) || !is_user_connected(killer))
return;
if(!get_pcvar_num(cvar[CVAR_XP_FFA]) && (get_member(killer, m_iTeam) == get_member(victim, m_iTeam)))
return;
if(get_member(victim, m_bHeadshotKilled))
aes_add_player_exp_f(killer,get_pcvar_float(cvar[CVAR_XP_HS]));
else
aes_add_player_exp_f(killer,get_pcvar_float(cvar[CVAR_XP_KILL]));
aes_add_player_exp_f(victim,get_pcvar_float(cvar[CVAR_XP_DEATH]));
// бонусы не включены или временно не работают
if(!cvar[CVAR_BONUS_ENABLE] || !get_pcvar_num(cvar[CVAR_BONUS_ENABLE]))
return;
g_Players[killer][STREAK_KILLS]++;
new bonusPoints = 0;
bonusPoints += get_current_player_bonuses(killer,frArrSize,0,g_BonusCvars[FRAG_ARRAY]);
if(get_member(victim, m_bHeadshotKilled))
{
g_Players[killer][STREAK_HS]++;
bonusPoints += get_current_player_bonuses(killer,hsArrSize,1,g_BonusCvars[HS_ARRAY]);
}
if(killer == pevInflictor && WeaponIdType:get_member(get_member(killer, m_pActiveItem), m_iId) == WEAPON_KNIFE)
{
g_Players[killer][STREAK_KNIFE]++;
bonusPoints += get_current_player_bonuses(killer,kfArrSize,2,g_BonusCvars[KNIFE_ARRAY]);
}
else if(FClassnameIs(pevInflictor, "grenade"))
{
g_Players[killer][STREAK_HE]++;
bonusPoints += get_current_player_bonuses(killer,heArrSize,3,g_BonusCvars[HE_ARRAY]);
}
if(get_pcvar_num(cvar[CVAR_ANEW_REST]) == 1)
arrayset(g_Players[victim],0,STREAK_OPT);
if(bonusPoints)
{
client_print_color(killer,print_team_default,"%L %L",killer,"AES_TAG",killer,"AES_ANEW_GAIN",bonusPoints);
aes_add_player_bonus_f(killer,bonusPoints);
}
}
// бонусы при получении нового звания
public aes_player_levelup(id)
{
if(!cvar[CVAR_BONUS_ENABLE] || !get_pcvar_float(cvar[CVAR_LEVEL_BONUS]))
return;
aes_add_player_bonus_f(id,get_pcvar_num(cvar[CVAR_LEVEL_BONUS]));
}
public CGrenade_ExplodeBomb(const this, tracehandle, const bitsDamageType)
{
addExp(g_Planter,CVAR_XP_C4_EXPLODE);
}
public PlantBomb(id, Float:vecStart[3], Float:vecVelocity[3])
{
g_Planter = id;
addExp(id,CVAR_XP_C4_PLANT);
}
public CGrenade_DefuseBombEnd(const this, const id, bool:bDefused)
{
if(bDefused)
addExp(id,CVAR_XP_C4_DEFUSED);
}
public CBasePlayer_AddAccount(const id, amount, RewardType:type, bool:bTrackChange)
{
switch(type)
{
case RT_HOSTAGE_TOOK:addExp(id,CVAR_XP_HOST_GOT);
case RT_HOSTAGE_RESCUED:addExp(id,CVAR_XP_HOST_RESCUE);
case RT_HOSTAGE_KILLED:addExp(id,CVAR_XP_HOST_KILL);
case RT_VIP_KILLED:addExp(id,CVAR_XP_VIP_KILLED);
case RT_VIP_RESCUED_MYSELF:addExp(id,CVAR_XP_VIP_ESCAPED);
}
}
// проверка на кол-во бонусных очков игрока
// cmpr - какой параметр проверяем
// Array:which - по какому массиву
public get_current_player_bonuses(id,size,cmpr,Array:which)
{
new bonusPoints,rt[2],i;
for(i = 0 ; i < size ; ++i)
{
ArrayGetArray(which,i,rt);
if(g_Players[id][cmpr] == rt[0])
bonusPoints += rt[1];
}
return bonusPoints;
}
// парсер значений бонусов в массив
public parse_aes_bonus_values(Array:which,levelString[])
{
new stPos,ePos,rawPoint[20],rawVals[2],stState;
// значение не задано
if(!strlen(levelString))
return 0;
do {
// ищем пробел
ePos = strfind(levelString[stPos]," ");
// узнаем значение с позиции stPos и длинной ePos
formatex(rawPoint,ePos,levelString[stPos]);
rawVals[stState] = str_to_num(rawPoint);
stPos += ePos + 1;
// указатель 2ой пары
stState++;
// два значения были найдены
// записываем их в массив и сбрасываем указатель
if(stState == 2)
{
ArrayPushArray(which,rawVals);
stState = 0;
}
} while(ePos != -1)
// возвращает кол-во 2ых пар
return ArraySize(which);
}
addExp(id, rule)
{
if(get_playersnum() >= get_pcvar_num(cvar[CVAR_XP_GOAL_MIN_PLAYERS]))
aes_add_player_exp_f(id,get_pcvar_float(cvar[rule]));
}
Опыт не засчитывается вообще (кроме как если добавляешь через админский квар, как и бонусы). Не знаю, когда это началось. Игроки недавно сообщили, полез сразу в error log и там были логи с требованиям сделать дебаг данного плагина. После вобщем эту ошибку и показало
В этой теме было размещено решение! Перейти к решению.