Некорректно работает "player model changer"

Сообщения
4
Реакции
0
Ошибка
Ошибок в логах нет
ОС
Windows
Amx Mod X
AMX Mod X 1.10.0.5248 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Jan 30 2019 07:05:11
Built from: https://github.com/alliedmodders/amxmodx/commit/fd643273
Build ID: 5248:fd643273
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.6.3.7/Stdio (cstrike)
ReHLDS version: 3.4.0.668-dev
Build date: 09:47:42 Sep 29 2018 (1631)
Build from: https://github.com/dreamstalker/rehlds/commit/89be216
ReGamedll
ReGameDLL version: 5.7.0.322-dev
Build date: 11:41:14 Jan 13 2019
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/7398bb7
Версия Metamod
Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 15:47:38 Aug 24 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/0cf2f70
Список метамодулей
[ 1] Reunion       RUN   -    reunion_mm.dll        v0.1.0.92       ini  Start Never
[ 2] ReAuthCheck RUN - reauthcheck_mm.dll v0.1.6 ini Start Never
[ 3] Rechecker RUN - rechecker_mm.dll v2.5 ini Chlvl ANY
[ 4] Revoice RUN - revoice_mm.dll v0.1.0.32 ini Start Never
[ 5] AMX Mod X RUN - amxmodx_mm.dll v1.10.0.5248 ini Start ANY
[ 6] WHBlocker RUN - whblocker_mm.dll v1.5.696 ini Chlvl ANY
[ 7] ReSemiclip RUN - resemiclip_mm.dll v2.3.9 ini Chlvl ANY
[ 8] MySQL RUN - mysql_amxx.dll v1.9.0.5232 pl5 ANY ANY
[ 9] SQLite RUN - sqlite_amxx.dll v1.9.0.5232 pl5 ANY ANY
[10] Fun RUN - fun_amxx.dll v1.9.0.5232 pl5 ANY ANY
[11] Engine RUN - engine_amxx.dll v1.9.0.5232 pl5 ANY ANY
[12] FakeMeta RUN - fakemeta_amxx.dll v1.9.0.5232 pl5 ANY ANY
[13] GeoIP RUN - geoip_amxx.dll v1.9.0.5232 pl5 ANY ANY
[14] CStrike RUN - cstrike_amxx.dll v1.9.0.5232 pl5 ANY ANY
[15] CSX RUN - csx_amxx.dll v1.9.0.5232 pl5 ANY ANY
[16] Ham Sandwich RUN - hamsandwich_amxx.dll v1.9.0.5232 pl5 ANY ANY
[17] Orpheu RUN - orpheu_amxx.dll v2.6.3 pl5 ANY ANY
[18] okapi RUN - okapi_amxx.dll v1.0 pl5 ANY ANY
[19] ReAPI RUN - reapi_amxx.dll v5.6.0.160-dev pl5 ANY Never
Список плагинов
[  1] AMXBans: Core           Gm 1.6      Larte Team        amxbans_core.am  running
[ 2] AMXBans: Main Gm 1.6 Larte Team amxbans_main.am running
[ 3] AMXBans: Screens Gm 1.6 Larte Team amxbans_ssban.a running
[ 4] Admin Base 1.9.0.5232 AMXX Dev Team admin.amxx stopped
[ 5] Admin Commands 1.9.0.5232 AMXX Dev Team admincmd.amxx running
[ 6] Admin Help 1.9.0.5232 AMXX Dev Team adminhelp.amxx running
[ 7] Slots Reservation 1.9.0.5232 AMXX Dev Team adminslots.amxx running
[ 8] Menus Front-End 1.9.0.5232 AMXX Dev Team menufront.amxx running
[ 9] Commands Menu 1.9.0.5232 AMXX Dev Team cmdmenu.amxx running
[ 10] Players Menu 1.9.0.5232 AMXX Dev Team plmenu.amxx running
[ 11] Plugin Menu 1.9.0.5232 AMXX Dev Team pluginmenu.amxx running
[ 12] Admin Chat 1.9.0.5232 AMXX Dev Team adminchat.amxx running
[ 13] Anti Flood 1.9.0.5232 AMXX Dev Team antiflood.amxx running
[ 14] Scrolling Message 1.9.0.5232 AMXX Dev Team scrollmsg.amxx running
[ 15] Info. Messages 1.9.0.5232 AMXX Dev Team imessage.amxx running
[ 16] Admin Votes 1.9.0.5232 AMXX Dev Team adminvote.amxx running
[ 17] NextMap 1.9.0.5232 AMXX Dev Team nextmap.amxx stopped
[ 18] Nextmap Chooser 1.9.0.5232 AMXX Dev Team mapchooser.amxx stopped
[ 19] TimeLeft 1.9.0.5232 AMXX Dev Team timeleft.amxx running
[ 20] Pause Plugins 1.9.0.5232 AMXX Dev Team pausecfg.amxx running
[ 21] Stats Configuration 1.9.0.5232 AMXX Dev Team statscfg.amxx running
[ 22] Simple Online Logger 10.04.18 mx?! simple_online_l running
[ 23] Trial Access 10.04.18 mx?! trial_access.am running
[ 24] GameName Changer 1.0 neugomon gamename_change running
[ 25] Mode 2x2 2.2 s1lent mode.amxx running
[ 26] Weapon Model + Sound R 1.2 GHW_Chronic new_weapons.amx running
[ 27] Parachute 15.07.15 KRoT@L/JTP10181 parachute_rbs.a running
[ 28] Admin Gag 1.8 AndrewZ amxgag.amxx running
[ 29] Flash Remote Control 12.0 OT flashbang_remot running
[ 30] dhud advert 1.0 DUKKHAZ0R dhud_advert_rou running
[ 31] Instant AutoTeamBalanc 1.2.0 ConnorMcLeod instant_autotea running
[ 32] motd 1.1 unknown motd_v1.amxx running
[ 33] Menu 1.0 WaT_1 menu1.amxx running
[ 34] Top Awards 0.11h Safety1st top_awards.amxx running
[ 35] Mega Stats 1.0 maeStro mega_stats_v20. running
[ 36] StatsX 1.8.1.3746 AMXX Dev Team [U mega_stats_gui. running
[ 37] IDEAL VIP by Ba/lePa 2.9 Ba/lePa IDEAL_VIP.amxx running
[ 38] Map Manager 2.5.60 Mistrick mapmanager.amxx running
[ 39] Map Manager: Sub Plugi 0.1 Mistrick mapmanager_subp running
[ 40] Ultimate Gore 1.6 JTP10181 amx_gore_ultima running
[ 41] [183] Demo Recorder RB 18.02.08 SKAJIbnEJIb demorecorder_rb running
[ 42] Players Count in Team 3.0.5 kramesa+Seroff players_count_s running
[ 43] HUD Killer Info 0.2 Subb98 hud_killer_info running
[ 44] Bomb Plant Money Bonus 1.0 Locks amx_plant_bonus running
[ 45] Steam Bonus 1.3d Gudaus steam_bonus.amx running
[ 46] Maps Menu 1.9.0.5232 AMXX Dev Team mapsmenu.amxx running
[ 47] Multi-Lingual System 1.9.0.5232 AMXX Dev Team multilingual.am running
[ 48] HLSS Blocker 0.1 Ian Cammarata hlss_blocker.am running
[ 49] Teleport Menu 1.9.0.5232 AMXX Dev Team telemenu.amxx running
[ 50] Lite VoteBan 1.4 neygomon lite_voteban.am running
[ 51] Ping Control 1.31 vanywa lox ebani Ping_Control.am running
[ 52] Time Bonus 1.1 SKOBAR1K time_bonus.amxx running
[ 53] Autoresponder/Advertis 0.5 MaximusBrood ad_manager.amxx running
[ 54] 'Fire in the hole' blo 1.0 xPaw hidefireintheho running
[ 55] Reset Score and Sound 1.0 FarCher NewResetScore.a running
[ 56] Restrict Weapons 1.9.0.5241 AMXX Dev Team restmenu.amxx running
[ 57] HudTextArgs Blocker 1.1 joaquimandrade hud_text_blocke running
[ 58] 3.0 Sho0ter colored_transli running
[ 59] Colored Translit Confi 3.0 Sho0ter colored_transli running
[ 60] unknown unknown unknown steamprefix.amx running
[ 61] CT Addon: VIP Prefix 1.0 Sho0ter prefix.amxx running
[ 62] Winter Environment 1.0 zombie-panic sneg.amxx running
[ 63] Spect Bot 1.2 SKAJIbnEJIb & Bo SpectBot.amxx running
[ 64] Nice Live 1.0 sector restartround.am running
[ 65] Stats Auto Reset 1.0 Leo_[BH] stats_auto_rese running
[ 66] Lie Flat 1.1 Nomexous lie_flat_fixed. running
[ 67] Steam Check [MOTD] 1.0 Seroff steam.amxx running
[ 68] GHW Auto Message Displ 3.1b GHW_Chronic/Safe GHW_Message_Dis running
[ 69] [ReAPI] AWPoff 1.3 PAffAEJIkA :3 awp_off.amxx running
Автор плагина
maeStro
Версия плагина
1.0
Исходный код
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <csx>

#define DefaultConfigFile "addons/amxmodx/configs/player_models_changer.cfg"

enum AccessType
{
type_other,
type_admin,
type_vip,
type_girl,
type_top,
type_steam
};

native get_user_type(id);

new AccessType:g_iPlayerType[33];
new g_iModelsAccess[AccessType];
new g_szModelsPack[AccessType][CsTeams][64];

new Trie:g_tPlayerModels;

public plugin_natives()
{
register_native("get_user_type", "native_get_user_type", 0);
}

public AccessType:native_get_user_type(plugin_id, argc)
{
new id = get_param(1);
return g_iPlayerType[id];
}

public plugin_precache()
{
g_tPlayerModels = TrieCreate();

ReadConfigFile();
}

public plugin_init()
{
register_plugin("model replaser", "1.0", "maeStro");
RegisterHam(Ham_Spawn, "player", "Ham_PlayerSpawn_Post", true);
}

public client_putinserver(id)
{
set_task(0.3, "client_putinserver_ex", id);
}

public client_putinserver_ex(id)
{
new iStats[8], iHits[8];
new iRank = get_user_stats(id, iStats, iHits);
new iFlags = get_user_flags(id);

new szData[192];
formatex(szData, charsmax(szData), "* Вы на %i месте", iRank)
set_task(2.0, "ShowConnectMessage", id, szData, sizeof(szData));

if(iRank && iRank <= 10 && iFlags && !(iFlags & g_iModelsAccess[type_top]))
{
if(iFlags & ADMIN_USER)
{
iFlags &= ~ADMIN_USER;
remove_user_flags(id, ADMIN_USER);
}
iFlags |= g_iModelsAccess[type_top];
set_user_flags(id, iFlags | g_iModelsAccess[type_top]);
formatex(szData, charsmax(szData), "Вы награждены за активную игру (%i место)", iRank);
set_task(10.0, "ShowConnectMessage", id, szData, sizeof(szData));
g_iPlayerType[id] = type_top;
}
else if(is_user_steam(id) && iFlags && !(iFlags & g_iModelsAccess[type_steam]))
{
if(iFlags & ADMIN_USER)
{
iFlags &= ~ADMIN_USER;
remove_user_flags(id, ADMIN_USER);
}
iFlags |= g_iModelsAccess[type_steam];
set_user_flags(id, iFlags | g_iModelsAccess[type_steam]);
formatex(szData, charsmax(szData), "Вы награждены за наличие лицензионой копии игры");
set_task(10.0, "ShowConnectMessage", id, szData, sizeof(szData));
g_iPlayerType[id] = type_steam;
}

if(iFlags && !(iFlags & ADMIN_USER))
{
if(iFlags & g_iModelsAccess[type_girl] &&
!(iFlags & (g_iModelsAccess[type_steam] | g_iModelsAccess[type_top] | g_iModelsAccess[type_vip] | g_iModelsAccess[type_admin])))
{
g_iPlayerType[id] = type_girl;
}
else
if(is_user_steam(id) && iFlags & g_iModelsAccess[type_vip] &&
!(iFlags & (g_iModelsAccess[type_top] | g_iModelsAccess[type_vip] )))
{
g_iPlayerType[id] = type_vip;
}
else
if(iFlags & g_iModelsAccess[type_top] &&
!(iFlags & (g_iModelsAccess[type_vip] | g_iModelsAccess[type_admin])))
{
g_iPlayerType[id] = type_top;
}
else
if(iFlags & g_iModelsAccess[type_steam] &&
!(iFlags & (g_iModelsAccess[type_top])))
{
g_iPlayerType[id] = type_steam;
}
else
{
g_iPlayerType[id] = type_admin;
}
}
else
{
g_iPlayerType[id] = type_other;
}
}

public ShowConnectMessage(szData[], id)
{
client_print(id, print_chat, "%s", szData);
}

public Ham_PlayerSpawn_Post(id)
{
static CsTeams:iTeam, szOriginalModel[128], szReplaceModel[128];
szOriginalModel[0] = szReplaceModel[0] = EOS;
if(is_user_alive(id) && !is_user_bot(id))
{
iTeam = cs_get_user_team(id);
cs_get_user_model(id, szOriginalModel, charsmax(szOriginalModel));
switch(g_iPlayerType[id])
{
case type_girl: copy(szReplaceModel, charsmax(szReplaceModel), g_szModelsPack[type_girl][iTeam]);
case type_steam: copy(szReplaceModel, charsmax(szReplaceModel), g_szModelsPack[type_steam][iTeam]);
case type_top: copy(szReplaceModel, charsmax(szReplaceModel), g_szModelsPack[type_top][iTeam]);
case type_vip: copy(szReplaceModel, charsmax(szReplaceModel), g_szModelsPack[type_vip][iTeam]);
case type_admin: copy(szReplaceModel, charsmax(szReplaceModel), g_szModelsPack[type_admin][iTeam]);
default: TrieGetString(g_tPlayerModels, szOriginalModel, szReplaceModel, charsmax(szReplaceModel));
}
if(szReplaceModel[0] != EOS)
{
if(!equal(szOriginalModel, szReplaceModel))
{
cs_set_user_model(id, szReplaceModel);
}
}
}
}

stock ReadConfigFile()
{
if(file_exists(DefaultConfigFile))
{
new szCurentPos[128], szData[128], AccessType:iCurentType;
new szString[512], iFile = fopen(DefaultConfigFile, "rt");
while(!feof(iFile))
{
fgets(iFile, szString, charsmax(szString));
trim(szString);
if(szString[0] == EOS || szString[0] == ';')
{
continue;
}

szCurentPos[0] = szData[0] = EOS;
parse(szString, szCurentPos, charsmax(szCurentPos), szData, charsmax(szData));
if(szString[0] == '!')
{
iCurentType = GetModelsType(szCurentPos[1]);
g_iModelsAccess[iCurentType] = read_flags(szData);
continue;
}

if(!file_exists(szData))
{
#if AMXX_VERSION_NUM < 183
formatex(szString, charsmax(szString), "Отсутствует модель ^"%s^"", szData);
set_fail_state(szString);
#else
set_fail_state("Отсутствует модель ^"%s^"", szData);
#endif
}

switch(AccessType:iCurentType)
{
case type_other:
{
if(TrieKeyExists(g_tPlayerModels, szCurentPos))
{
#if AMXX_VERSION_NUM < 183
formatex(szString, charsmax(szString), "Обнаружена повторный реплейсер модели ^"%s^"", szCurentPos);
set_fail_state(szString);
#else
set_fail_state("Обнаружена повторный реплейсер модели ^"%s^"", szCurentPos);
#endif
}

TrieSetString(g_tPlayerModels, szCurentPos, GetValidModelString(szData));
}
default: copy(g_szModelsPack[iCurentType][CsTeams:str_to_num(szCurentPos)], charsmax(g_szModelsPack[][]), GetValidModelString(szData));
}
precache_model(szData);
}
fclose(iFile);
}
}

stock GetValidModelString(const string[])
{
static szModel[128], iStringLen;
copy(szModel, charsmax(szModel), string);
if((iStringLen = strfind(szModel, ".mdl")) > -1)
{
szModel[iStringLen] = EOS;
}
iStringLen = strlen(string);
while ((--iStringLen >= 0) && (string[iStringLen] != '/') && (string[iStringLen] != '\')){}
formatex(szModel, charsmax(szModel), "%s", szModel[iStringLen + 1]);
return szModel;
}

stock AccessType:GetModelsType(model[])
{
static szModelType[32];
static Trie:tModels = Invalid_Trie
if(tModels == Invalid_Trie)
{
tModels = TrieCreate();

TrieSetCell(tModels, "admins", type_admin);
TrieSetCell(tModels, "vip", type_vip);
TrieSetCell(tModels, "girl", type_girl);
TrieSetCell(tModels, "top", type_top);
TrieSetCell(tModels, "steam", type_steam);
TrieSetCell(tModels, "other", type_other);
}

copy(szModelType, charsmax(szModelType), model);
strtolower(szModelType);

new AccessType:iId;
if(TrieGetCell(tModels, szModelType, iId))
{
return iId;
}
return type_other;
}

stock bool:is_user_steam(id)
{
static dp_pointer;
if(dp_pointer || (dp_pointer = get_cvar_pointer("dp_r_id_provider")))
{
server_cmd("dp_clientinfo %d", id);
server_exec();
return (get_pcvar_num(dp_pointer) == 2) ? true : false;
}
return false;
}
/*
#define fm_get_user_team(%0) get_pdata_int(%0, 114, 5)

stock const g_sChannel[][] =
{
"^1(Counter-Terrorist) ^3%s1^1 : %s2",
"^1(Terrorist) ^3%s1^1 : %s2",
"^1*DEAD*(Counter-Terrorist) ^3%s1^1 : %s2",
"^1*DEAD*(Terrorist) ^3%s1^1 : %s2",
"^1(Spectator) ^3%s1^1 : %s2",
"^1%s1 : %s2",
"^1*DEAD* ^3%s1^1 : %s2",
"^1*SPEC* ^3%s1^1 : %s2"
};

public to_chat(id, message[], bTeam)
{
new sName[32], iChannel;
get_user_name(id, sName, charsmax(sName));
new iAlive = is_user_alive(id);
new iTeam = fm_get_user_team(id);
iChannel = bAlive ? 5 : (iTeam != 3 ? 6 : 7);
for(new i=1; i <= MaxClients; i++)
{
if(!is_user_connected(i)) continue;
if(iAlive == is_user_alive(i) && (!bTeam || iTeam == fm_get_user_team(i)))
{
emessage_begin(MSG_ONE_UNRELIABLE, 76, .player = i);
ewrite_byte(id);
ewrite_string(g_sChannel[iChannel]);
ewrite_string(sName);
ewrite_string(message);
emessage_end();
}
}
return 1;
}
*/
После перехода на ReHLDS, плагин стал некорректно работать. После того как игрока перекидывало за другую команду, моделька его оставалась прежней.
Т.е. игрок играя за КТ, перебрасывался за команду Т, но моделька по прежнему оставалась кт.
Ставил разные балансировщики, так же оставлял стандартный. Если отключить плагин "player model changer", модели отображались исправна, после переброса игрока за другую команду.
В кодах не разбираюсь, помогите пожалуйста.
 
Сообщения
1,420
Реакции
2,511
Помог
58 раз(а)
Плагин выше немного хардкод, ибо нужно вписывать значения в исходник и компилировать заново. Предлагаю использовать плагин Custom Models от neygomon. Плагин имеет версию ReAPI и обычную.
 
Сообщения
4
Реакции
0
Плагин выше немного хардкод, ибо нужно вписывать значения в исходник и компилировать заново. Предлагаю использовать плагин Custom Models от neygomon. Плагин имеет версию ReAPI и обычную.
Немного не то. Мне нужно что бы работало через amxbans по флагам
 
Сообщения
1,420
Реакции
2,511
Помог
58 раз(а)
Sunny90rus, в чём проблема тогда? В конфиге и по флагам можно выдавать.
 

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу