- Ошибка
-
The add-on has a defect when it comes to displaying the sprites, when starting each round the sprites have errors, there are times when it only shows the grenades, the vest and there are rounds in which it shows everything correctly. If it could be fixed so that the plugin displays the sprites correctly each round, I'm testing it on a server with a maximum of 10 players, 5 on each side.
- ОС
- Linux
- Amx Mod X
-
AMX Mod X 1.10.0.5467 (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 21 2023 20:27:33
Built from: https://github.com/alliedmodders/amxmodx/commit/27f451a
Build ID: 5467:27f451a
Core mode: JIT+ASM32
- Билд
-
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.13.0.788-dev
Build date: 07:36:33 Jul 12 2023 (3378)
Build from: https://github.com/dreamstalker/rehlds/commit/f955b07
- ReGamedll
-
ReGameDLL version: 5.26.0.668-dev
Build date: 19:02:48 Dec 31 2023
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/d3c0ec8
- Версия Metamod
-
Metamod-r v1.3.0.131, API (5:13)
Metamod-r build: 18:51:02 Jul 11 2022
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/adc9414
- Список метамодулей
-
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] HitBox Fix RUN - hitbox_fix_mm_i386.so v1.1.4 ini Start ANY
[ 2] AMX Mod X RUN - amxmodx_mm_i386.so v1.10.0.5467 ini Start ANY
[ 3] Reunion RUN - reunion_mm_i386.so v0.1.92d ini Start Never
[ 4] Revoice RUN - revoice_mm_i386.so v0.1.0.34 ini Start Never
[ 5] ReSemiclip RUN - resemiclip_mm_i386.so v2.4.3 ini Chlvl ANY
[ 6] Print Center Fix RUN - printcenterfix_mm_i386.so v2.0.1 ini ANY ANY
[ 7] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl2 ANY Never
[ 8] FakeMeta RUN - fakemeta_amxx_i386.so v1.10.0.5467 pl2 ANY ANY
[ 9] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.10.0.5467 pl2 ANY ANY
[10] Engine RUN - engine_amxx_i386.so v1.10.0.5467 pl2 ANY ANY
[11] ReAPI RUN - reapi_amxx_i386.so v5.24.0.300-dev pl2 ANY Never
[12] CStrike RUN - cstrike_amxx_i386.so v1.10.0.5467 pl2 ANY ANY
[13] Fun RUN - fun_amxx_i386.so v1.10.0.5467 pl2 ANY ANY
[14] GeoIP RUN - geoip_amxx_i386.so v1.10.0.5467 pl2 ANY ANY
[15] MySQL RUN - mysql_amxx_i386.so v1.10.0.5467 pl2 ANY ANY
[16] CSX RUN - csx_amxx_i386.so v1.10.0.5467 pl2 ANY ANY
16 plugins, 16 running
- Список плагинов
-
Currently loaded plugins:
id name version author url file status
[ 1] 0 ReAimDetector API 0.2.2 ReHLDS Team unknown reaimdetect running
[ 2] 1 unknown unknown unknown unknown accuracy.am running
[ 3] 2 Admin Base 1.10.0.546 AMXX Dev Team admin.amxx running
[ 4] 3 Admin Commands 1.10.0.546 AMXX Dev Team admincmd.am running
[ 5] 4 Menus Front-End 1.10.0.546 AMXX Dev Team menufront.a running
[ 6] 5 Commands Menu 1.10.0.546 AMXX Dev Team cmdmenu.amx running
[ 7] 6 Players Menu 1.10.0.546 AMXX Dev Team plmenu.amxx running
[ 8] 7 Maps Menu 1.10.0.546 AMXX Dev Team mapsmenu.am running
[ 9] 8 Plugin Menu 1.10.0.546 AMXX Dev Team pluginmenu. running
[ 10] 9 Admin Chat 1.10.0.546 AMXX Dev Team adminchat.a running
[ 11] 10 Anti Flood 1.10.0.546 AMXX Dev Team antiflood.a running
[ 12] 11 Admin Votes 1.10.0.546 AMXX Dev Team adminvote.a running
[ 13] 12 Restrict Weapons 1.10.0.546 AMXX Dev Team restmenu.am running
[ 14] 13 Show Teammates Armamen 1.2 DaniwA/EFFEX lit showequips. running
14 plugins, 14 running
- Автор плагина
- DaniwA/EFFEX little touch
- Версия плагина
- 1.2
- Исходный код
-
#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <hamsandwich>
#include <cstrike>
#define PLUGIN "Show Teammates Armament"
#define VERSION "1.2"
#define AUTHOR "DaniwA/EFFEX little touch"
#if !defined client_disconnected
#define client_disconnected client_disconnect
#endif
#if !defined MAX_PLAYERS
#define MAX_PLAYERS 32
#endif
#define isPlayerTeammate(%1,%2) (get_user_team(%1) == get_user_team(%2))
#define invisibilityColors(%1) ((%1[0] + %1[1] + %1[2]) == 0)
#define NUMBER_OF_SPRITES 5
#define NUMBER_OF_WEAPTYPES 7
#define NUMBER_OF_ALL_SPRITES 16
#define MIN_LOOP_NUMBER 20
enum (+= MAX_PLAYERS)
{
TASK_DISPLAY = 4562,
TASK_HIDE_ENTS
}
enum
{
tenthousand,
thousand,
hundred,
ten,
one,
cashsymbol,
arrowsymbol,
primaryweapon,
secondaryweapon,
hegrenade,
flashbang,
smokegrenade,
c4,
defuse,
armorvesth,
armorkev
}
new const g_szMoneySprites[][] =
{
"sprites/10000.spr",
"sprites/1000.spr",
"sprites/100.spr",
"sprites/10.spr",
"sprites/1.spr"
}
new const g_szSpritesClass[] = "spr_equips"
new const g_szWeaponsSprites[] = "sprites/weap.spr"
new const g_szUtilitiesSprites[] = "sprites/weap2.spr"
new const g_szArrowSprite[] = "sprites/arrow.spr"
new const g_szCashSymbolSprite[] = "sprites/cash.spr"
new g_iMaxPlayers
new g_fFreezeTime
new bool:g_bShouldSplitLoop
new pCvarShowWeapons, pCvarShowMoney, pCvarShowUtilities
new pCvarShowArrow, pCvarShowArmorType, pCvarShowArrowAlways
new pCvarShowArrowAlwaysMode, pCvarSpriteScale
new pCvarSpriteWeaponColor, pCvarSpriteMoneyColor, pCvarSpriteGrenadesColor
new pCvarSpriteKevlarHelmetColor, pCvarSpriteKevlarColor, pCvarSpriteArrowColor
new pCvarSpriteBombColor, pCvarSpriteDefuseColor
new g_iShowWeapon, g_iShowMoney, g_iShowUlt
new g_iShowArrow, g_iShowArmor, g_iShowArrowAways
new g_iShowArrowAwaysMode
new bool:g_bHideSprites[MAX_PLAYERS + 1]
new bool:g_bIsSpriteAvaliable[MAX_PLAYERS + 1][NUMBER_OF_ALL_SPRITES]
new g_iUserPersonalCashSymbol[MAX_PLAYERS + 1]
new g_iUserPersonalArrowSprite[MAX_PLAYERS + 1]
new g_iUserPersonalMoneySprite[MAX_PLAYERS + 1][NUMBER_OF_SPRITES]
new g_iUserPersonalWeaponSprite[MAX_PLAYERS + 1][NUMBER_OF_WEAPTYPES]
new const Float:g_iPistols[6] =
{
1.0,
10.0,
11.0,
16.0,
17.0,
26.0
}
new const Float:g_iRifles[18] =
{
3.0,
5.0,
7.0,
8.0,
12.0,
13.0,
14.0,
15.0,
18.0,
19.0,
20.0,
21.0,
22.0,
23.0,
24.0,
27.0,
28.0,
30.0
}
public plugin_precache()
{
for(new i;i < sizeof g_szMoneySprites;i++)
{
precache_model(g_szMoneySprites[i])
}
precache_model(g_szWeaponsSprites)
precache_model(g_szUtilitiesSprites)
precache_model(g_szCashSymbolSprite)
precache_model(g_szArrowSprite)
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("showequips_version", VERSION, FCVAR_SERVER|FCVAR_SPONLY)
pCvarShowWeapons = register_cvar("se_show_weapons", "1")
pCvarShowMoney = register_cvar("se_show_money", "1")
pCvarShowUtilities = register_cvar("se_show_grenades", "1")
pCvarShowArrow = register_cvar("se_show_arrow", "1")
pCvarShowArmorType = register_cvar("se_show_armortype", "1")
pCvarShowArrowAlways = register_cvar("se_show_arrow_only", "0")
pCvarShowArrowAlwaysMode = register_cvar("se_show_arrow_only_mode", "1") // 0 = both teams | 1 = teammates only | 2 = enemies only
pCvarSpriteScale = register_cvar("se_sprites_scale", "0.25")
pCvarSpriteWeaponColor = register_cvar("se_sprite_color_weapons", "255255000") // default yellow
pCvarSpriteMoneyColor = register_cvar("se_sprite_color_money", "000255000") // default green
pCvarSpriteGrenadesColor = register_cvar("se_sprite_color_grenades", "255255255") // default white
pCvarSpriteKevlarHelmetColor = register_cvar("se_sprite_color_vesthelm", "080000200") // default purple
pCvarSpriteKevlarColor = register_cvar("se_sprite_color_kevlar", "200000200") // default pink
pCvarSpriteArrowColor = register_cvar("se_sprite_color_arrow", "255255000") // default yellow
pCvarSpriteBombColor = register_cvar("se_sprite_color_c4", "220080000") // default orange
pCvarSpriteDefuseColor = register_cvar("se_sprite_color_defusekit", "000255000") // default green
g_fFreezeTime = get_cvar_pointer("mp_freezetime")
register_event("DeathMsg", "event_DeathMsg", "a")
register_event("HLTV", "event_newRound", "a", "1=0", "2=0")
register_forward(FM_AddToFullPack, "forward_AddToFullPack", 1)
for(new id = 1;id <= (g_iMaxPlayers = get_maxplayers());id++)
{
createUserSprites(id)
}
}
public event_newRound()
{
remove_task(TASK_DISPLAY)
remove_task(TASK_HIDE_ENTS)
g_iShowWeapon = get_pcvar_num(pCvarShowWeapons)
g_iShowMoney = get_pcvar_num(pCvarShowMoney)
g_iShowUlt = get_pcvar_num(pCvarShowUtilities)
g_iShowArrow = get_pcvar_num(pCvarShowArrow)
g_iShowArmor = get_pcvar_num(pCvarShowArmorType)
g_iShowArrowAways = get_pcvar_num(pCvarShowArrowAlways)
g_iShowArrowAwaysMode = get_pcvar_num(pCvarShowArrowAlwaysMode)
hidePlayersEnts()
new Float:fFreezeTime = get_pcvar_float(g_fFreezeTime)
if(!fFreezeTime)
return
set_task(fFreezeTime, "hidePlayersEnts", TASK_HIDE_ENTS)
set_task(1.0, "displayPlayersInfo", TASK_DISPLAY, .flags = "a", .repeat = floatround(fFreezeTime))
}
public event_DeathMsg()
{
if(task_exists(TASK_DISPLAY))
{
g_bHideSprites[read_data(2)] = true
}
}
public client_disconnected(id)
{
if(task_exists(TASK_DISPLAY))
{
g_bHideSprites[id] = true
}
}
public hidePlayersEnts()
{
remove_task(TASK_DISPLAY)
for(new id;id <= g_iMaxPlayers;id++)
{
g_bHideSprites[id] = true
}
g_bShouldSplitLoop = false
}
public forward_AddToFullPack(es_handle, e, iEnt, iHost, hostflags, player, pSet)
{
if(pev_valid(iEnt) && is_user_connected(iHost))
{
static szEntityClass[MAX_PLAYERS]
pev(iEnt, pev_classname, szEntityClass, charsmax(szEntityClass))
if(equal(szEntityClass, g_szSpritesClass))
{
static iOwner, Float:fOrigin[3]
if((iOwner = pev(iEnt, pev_owner)) && is_user_alive(iOwner))
{
if((!g_bHideSprites[iOwner] || (pev(iEnt, pev_groundentity)) && (!g_iShowArrowAwaysMode
|| ((g_iShowArrowAwaysMode == 1) && isPlayerTeammate(iOwner, iHost))
|| ((g_iShowArrowAwaysMode == 2) && !isPlayerTeammate(iOwner, iHost)))))
{
static iRGB[3], Float:fHeight
iRGB[0] = pev(iEnt, pev_euser1)
iRGB[1] = pev(iEnt, pev_euser2)
iRGB[2] = pev(iEnt, pev_euser3)
pev(iEnt, pev_health, fHeight)
set_es(es_handle, ES_AimEnt, 0)
set_es(es_handle, ES_RenderFx, kRenderFxNone)
set_es(es_handle, ES_RenderColor, iRGB)
set_es(es_handle, ES_RenderMode, invisibilityColors(iRGB) ? kRenderTransAlpha : kRenderTransAdd)
set_es(es_handle, ES_RenderAmt, invisibilityColors(iRGB) ? 0 : 255)
pev(iOwner, pev_origin, fOrigin)
fOrigin[2] += (fHeight + ((pev(iOwner, pev_flags) & FL_DUCKING) ? 9.0 : 0.0))
set_es(es_handle, ES_Origin, fOrigin)
}
}
}
}
}
public displayPlayersInfo()
{
static iPlayers[MAX_PLAYERS]
new iPlayerNum = 0, iPlayer, iLoopNum
if(g_bShouldSplitLoop)
{
iLoopNum = (MIN_LOOP_NUMBER + 1)
g_bShouldSplitLoop = false
}
get_players(iPlayers, iPlayerNum, "a")
for(new iUserMoney[6], iMoney[2], CsArmorType:iUserArmor;iLoopNum < iPlayerNum;iLoopNum++)
{
g_bHideSprites[(iPlayer = iPlayers[iLoopNum])] = false
if(g_iShowMoney)
{
for(new x; x < NUMBER_OF_SPRITES; x++)
{
num_to_str(cs_get_user_money(iPlayer), iUserMoney, charsmax(iUserMoney))
iMoney[0] = iUserMoney[x]
iMoney[1] = 0
drawSprite(g_iUserPersonalMoneySprite[iPlayer][((NUMBER_OF_SPRITES - 1) - x)], iPlayer, g_szMoneySprites[x], iUserMoney[x] ? floatstr(iMoney) : 1.0, 34.0, x, .bShouldHide = !iUserMoney[x])
}
drawSprite(g_iUserPersonalCashSymbol[iPlayer], iPlayer, g_szCashSymbolSprite, 1.0, 34.0, cashsymbol)
}
if(g_iShowArrow)
{
drawSprite(g_iUserPersonalArrowSprite[iPlayer], iPlayer, g_szArrowSprite, 1.0, 34.0, arrowsymbol, g_iShowArrowAways)
}
if(g_iShowWeapon)
{
for(new iPistols, bool:skipPistols;iPistols < sizeof g_iPistols; iPistols++)
{
if(user_has_weapon(iPlayer, floatround(g_iPistols[iPistols])))
{
drawSprite(g_iUserPersonalWeaponSprite[iPlayer][0], iPlayer, g_szWeaponsSprites, g_iPistols[iPistols], 47.0, primaryweapon)
skipPistols = true
}
if(!skipPistols) drawSprite(g_iUserPersonalWeaponSprite[iPlayer][0], iPlayer, g_szWeaponsSprites, g_iPistols[iPistols], 47.0, primaryweapon, .bShouldHide = true)
}
for(new iRifles, bool:skipRifles;iRifles < sizeof g_iRifles;iRifles++)
{
if(user_has_weapon(iPlayer, floatround(g_iRifles[iRifles])))
{
drawSprite(g_iUserPersonalWeaponSprite[iPlayer][1], iPlayer, g_szWeaponsSprites, g_iRifles[iRifles], 47.0, secondaryweapon)
skipRifles = true
}
if(!skipRifles) drawSprite(g_iUserPersonalWeaponSprite[iPlayer][1], iPlayer, g_szWeaponsSprites, g_iRifles[iRifles], 47.0, secondaryweapon, .bShouldHide = true)
}
}
if(g_iShowUlt)
{
if(user_has_weapon(iPlayer, CSW_HEGRENADE))
{
drawSprite(g_iUserPersonalWeaponSprite[iPlayer][2], iPlayer, g_szWeaponsSprites, 4.0, 47.0, hegrenade)
}
else drawSprite(g_iUserPersonalWeaponSprite[iPlayer][2], iPlayer, g_szWeaponsSprites, 4.0, 47.0, hegrenade, .bShouldHide = true)
if(user_has_weapon(iPlayer, CSW_FLASHBANG))
{
drawSprite(g_iUserPersonalWeaponSprite[iPlayer][3], iPlayer, g_szWeaponsSprites, 25.0, 47.0, flashbang)
}
else drawSprite(g_iUserPersonalWeaponSprite[iPlayer][3], iPlayer, g_szWeaponsSprites, 25.0, 47.0, flashbang, .bShouldHide = true)
if(user_has_weapon(iPlayer, CSW_SMOKEGRENADE))
{
drawSprite(g_iUserPersonalWeaponSprite[iPlayer][4], iPlayer, g_szWeaponsSprites, 9.0, 47.0, smokegrenade)
}
else drawSprite(g_iUserPersonalWeaponSprite[iPlayer][4], iPlayer, g_szWeaponsSprites, 9.0, 47.0, smokegrenade, .bShouldHide = true)
}
if(user_has_weapon(iPlayer, CSW_C4))
{
drawSprite(g_iUserPersonalWeaponSprite[iPlayer][6], iPlayer, g_szUtilitiesSprites, 3.0, 48.0, c4)
}
else
{
if(get_user_team(iPlayer) == 1) drawSprite(g_iUserPersonalWeaponSprite[iPlayer][6], iPlayer, g_szUtilitiesSprites, 3.0, 48.0, c4, .bShouldHide = true)
}
if(cs_get_user_defuse(iPlayer))
{
drawSprite(g_iUserPersonalWeaponSprite[iPlayer][6], iPlayer, g_szUtilitiesSprites, 4.0, 48.0, defuse)
}
else
{
if(get_user_team(iPlayer) == 2) drawSprite(g_iUserPersonalWeaponSprite[iPlayer][6], iPlayer, g_szUtilitiesSprites, 4.0, 48.0, defuse, .bShouldHide = true)
}
if(g_iShowArmor)
{
cs_get_user_armor(iPlayer, iUserArmor)
switch(iUserArmor)
{
case CS_ARMOR_VESTHELM: drawSprite(g_iUserPersonalWeaponSprite[iPlayer][5], iPlayer, g_szUtilitiesSprites, 2.0, 48.0, armorvesth)
case CS_ARMOR_KEVLAR: drawSprite(g_iUserPersonalWeaponSprite[iPlayer][5], iPlayer, g_szUtilitiesSprites, 1.0, 48.0, armorkev)
default:
{
drawSprite(g_iUserPersonalWeaponSprite[iPlayer][5], iPlayer, g_szUtilitiesSprites, 2.0, 48.0, armorvesth, .bShouldHide = true)
drawSprite(g_iUserPersonalWeaponSprite[iPlayer][5], iPlayer, g_szUtilitiesSprites, 1.0, 48.0, armorkev, .bShouldHide = true)
}
}
}
if((iPlayerNum > MIN_LOOP_NUMBER) && (iLoopNum == MIN_LOOP_NUMBER) && !g_bShouldSplitLoop)
{
g_bShouldSplitLoop = true
break
}
if(iLoopNum == g_iMaxPlayers)
{
iLoopNum = 0
}
}
}
createUserSprites(iPlayer)
{
for(new i;i < NUMBER_OF_SPRITES;i++)
{
g_iUserPersonalMoneySprite[iPlayer][i] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "env_sprite"))
}
for(new j;j < NUMBER_OF_WEAPTYPES;j++)
{
g_iUserPersonalWeaponSprite[iPlayer][j] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "env_sprite"))
}
g_iUserPersonalCashSymbol[iPlayer] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "env_sprite"))
g_iUserPersonalArrowSprite[iPlayer] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "env_sprite"))
}
drawSprite(iEntity, iPlayer, const szSpriteModel[], Float:fFrame, Float:fSpriteOffset, iSpriteType = 0, iArrow = 0, bool:bShouldHide = false)
{
if(!pev_valid(iEntity))
return
new iCvar
switch(iSpriteType)
{
case cashsymbol, tenthousand, thousand, hundred, ten, one: iCvar = pCvarSpriteMoneyColor
case primaryweapon, secondaryweapon: iCvar = pCvarSpriteWeaponColor
case hegrenade, flashbang, smokegrenade: iCvar = pCvarSpriteGrenadesColor
case arrowsymbol: iCvar = pCvarSpriteArrowColor
case c4: iCvar = pCvarSpriteBombColor
case defuse: iCvar = pCvarSpriteDefuseColor
case armorvesth: iCvar = pCvarSpriteKevlarHelmetColor
case armorkev: iCvar = pCvarSpriteKevlarColor
}
new iRGB[3]
if(!bShouldHide)
{
convertCvarToRGB(get_pcvar_num(iCvar), iRGB)
}
if(!g_bIsSpriteAvaliable[iPlayer][iSpriteType])
{
set_pev(iEntity, pev_framerate, 1.0)
set_pev(iEntity, pev_movetype, MOVETYPE_FOLLOW)
set_pev(iEntity, pev_classname, g_szSpritesClass)
engfunc(EngFunc_SetModel, iEntity, szSpriteModel)
set_rendering(iEntity, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 0)
set_pev(iEntity, pev_health, fSpriteOffset)
set_pev(iEntity, pev_owner, iPlayer)
set_pev(iEntity, pev_aiment, iPlayer)
g_bIsSpriteAvaliable[iPlayer][iSpriteType] = true
}
set_pev(iEntity, pev_scale, get_pcvar_float(pCvarSpriteScale))
set_pev(iEntity, pev_frame, fFrame)
set_pev(iEntity, pev_groundentity, iArrow)
set_pev(iEntity, pev_euser1, iRGB[0])
set_pev(iEntity, pev_euser2, iRGB[1])
set_pev(iEntity, pev_euser3, iRGB[2])
}
convertCvarToRGB(pCvar, iColor[3])
{
iColor[0] = (pCvar / 1000000)
pCvar %= 1000000
iColor[1] = (pCvar / 1000)
iColor[2] = (pCvar % 1000)
}
The add-on has a defect when it comes to displaying the sprites, when starting each round the sprites have errors, there are times when it only shows the grenades, the vest and there are rounds in which it shows everything correctly. If it could be fixed so that the plugin displays the sprites correctly each round, I'm testing it on a server with a maximum of 10 players, 5 on each side.
Последнее редактирование: