Dhud hp

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
14
Реакции
4
Неверный раздел
Ошибка
|
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5241 (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:09:07
Built from: https://github.com/alliedmodders/amxmodx/commit/2110037
Build ID: 5241:2110037
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.4.0.669-dev-myarena
Build date: 15:37:57 Apr 8 2019 (1822)
Build from: https://github.com/dreamstalker/rehlds/commit/f6822e3
ReGamedll
ReGameDLL version: 5.7.0.310-dev
Build date: 05:50:50 May 24 2018
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/8e3b6f4
Версия 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] Revoice RUN - revoice_mm_i386.so v0.1.0.32 ini Start Never
[ 3] Rechecker RUN - rechecker_mm_i386.so v2.5 ini Chlvl ANY
[ 4] WHBlocker RUN - whblocker_mm_i386.so v1.5.696 ini Chlvl ANY
[ 5] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 6] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5241 ini Start ANY
[ 7] ProcessCmds RUN - processcmds_mm_i386.so v1.1.5 ini Start Never
[ 8] hackdetector RUN - hackdetector_amxx_i386.so v0.15.328.lite pl6 ANY ANY
[ 9] MySQL RUN - mysql_amxx_i386.so v1.9.0.5241 pl6 ANY ANY
[10] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5241 pl6 ANY ANY
[11] Engine RUN - engine_amxx_i386.so v1.9.0.5241 pl6 ANY ANY
[12] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5241 pl6 ANY ANY
[13] ReAPI RUN - reapi_amxx_i386.so v5.8.0.166-dev pl6 ANY Never
[14] CSX RUN - csx_amxx_i386.so v1.9.0.5241 pl6 ANY ANY
[15] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5241 pl6 ANY ANY
[16] Fun RUN - fun_amxx_i386.so v1.9.0.5241 pl6 ANY ANY
16 plugins, 16 running
Список плагинов
|
Автор плагина
|
Версия плагина
|
Исходный код
/*	Formatright © 2010, ConnorMcLeod

This plugin is free software;
you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this plugin; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <engine>

#define VERSION "0.0.1"
#define PLUGIN "Spectator Hud Informations"

#define MAX_PLAYERS 32
#define FIRST_PERSON_VIEW 4

new const g_iWeaponIdToAmmoId[] = {
0, 9, 0, 2, 12, 5, 14, 6, 4, 13, 10, 7, 6, 4, 4, 4, 6, 10, 1, 10, 3, 5, 4, 10, 2, 11, 8, 4, 2, 0, 7}

new g_iHealth[MAX_PLAYERS+1]
new g_iArmor[MAX_PLAYERS+1]
new g_iMoney[MAX_PLAYERS+1]
new g_iCurWeapon[MAX_PLAYERS+1]
new g_iAmmo[MAX_PLAYERS+1]
new g_iBpAmmo[MAX_PLAYERS+1][15]

new g_dhud_color

public plugin_init()
{
register_plugin(PLUGIN, VERSION, "ConnorMcLeod")

register_cvar("amx_spec_hud_color", "250 250 250")

register_event("Money", "Event_Money", "b")
register_event("CurWeapon", "Event_CurWeapon", "b", "1=1")
register_event("Health", "Event_Health", "b")
register_event("Battery", "Event_Battery", "b")
register_event("AmmoX", "Event_AmmoX", "b", "1<15")

new szColor[12], szRed[4], szGreen[4], szBlue[4], r, g, b
get_cvar_string("amx_spec_hud_color", szColor, charsmax(szColor))
parse(szColor, szRed, charsmax(szRed), szGreen, charsmax(szGreen), szBlue, charsmax(szBlue))
r = clamp( str_to_num(szRed), 0, 255)
g = clamp( str_to_num(szGreen), 0, 255)
b = clamp( str_to_num(szBlue), 0, 255)
g_dhud_color = b + ( g << 8 ) + ( r << 16 )

new iEnt = create_entity("info_target")
if( iEnt )
{
entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 0.1)
entity_set_string(iEnt, EV_SZ_classname, "_hud_spec")
register_think("_hud_spec", "UpdateSpecHud")
}
else
{
set_task(0.1, "UpdateSpecHud", .flags="b")
}
}

public UpdateSpecHud( iEnt )
{
if( iEnt )
{
entity_set_float(iEnt, EV_FL_nextthink, get_gametime() + 0.1)
}
static iAlivePlayers[32], iDeadPlayers[32], iAliveCount, iDeadCount, iAlivePlayer, iDeadPlayer, i
static iAmmo
static bool:bRetrievedValues, szMessage1[128], szMessage2[128], iLen1, iLen2
get_players(iAlivePlayers, iAliveCount, "a")
if( !iAliveCount )
{
return
}
get_players(iDeadPlayers, iDeadCount, "bch")
if( !iDeadCount )
{
return
}

for(--iAliveCount; iAliveCount>=0; iAliveCount--)
{
bRetrievedValues = false
iAlivePlayer = iAlivePlayers[iAliveCount]
for(i=0; i<iDeadCount; i++)
{
iDeadPlayer = iDeadPlayers[i]
if( entity_get_int(iDeadPlayer, EV_INT_iuser2) == iAlivePlayer && entity_get_int(iDeadPlayer, EV_INT_iuser1) == FIRST_PERSON_VIEW )
{
if( !bRetrievedValues )
{
iLen1 = 31+ formatex(szMessage1, charsmax(szMessage1), "%3d HP^t^t^t%3d AP", g_iHealth[iAlivePlayer], g_iArmor[iAlivePlayer])
iAmmo = g_iAmmo[iAlivePlayer]
if( iAmmo != -1 )
{
iLen2 = 31 + formatex(
szMessage2, charsmax(szMessage2),
"$ %5d^n%3d|%3d",
g_iMoney[iAlivePlayer], iAmmo, g_iBpAmmo[iAlivePlayer][ g_iWeaponIdToAmmoId[ g_iCurWeapon[iAlivePlayer] ] ]
)
}
else
{
iLen2 = 31 + formatex(szMessage2, charsmax(szMessage2), "$ %5d^n", g_iMoney[iAlivePlayer])
}
bRetrievedValues = true
}

__show__dhudmessage(iDeadPlayer, szMessage1, iLen1, _:0.01, _:0.98)
__show__dhudmessage(iDeadPlayer, szMessage2, iLen2, _:0.92, _:0.93)

iDeadPlayers[i--] = iDeadPlayers[--iDeadCount]
if( !iDeadCount )
{
return
}
}
}
}
}

public Event_Money( id )
{
g_iMoney[id] = read_data(1)
}

public Event_CurWeapon(id)
{
g_iCurWeapon[id] = read_data(2)
g_iAmmo[id] = read_data(3)
}

public Event_AmmoX(id)
{
g_iBpAmmo[id][read_data(1)] = read_data(2)
}

public Event_Health(id)
{
g_iHealth[id] = read_data(1)
}

public Event_Battery(id)
{
g_iArmor[id] = read_data(1)
}

// code extracted from Director Hud Message include file
// http://forums.alliedmods.net/showthread.php?t=149210
__show__dhudmessage(id, const szMessage[], iLen, x, y)
{
message_begin( MSG_ONE_UNRELIABLE , SVC_DIRECTOR, .player=id )
{
write_byte( iLen )
write_byte( DRC_CMD_MESSAGE )
write_byte( 0 )
write_long( g_dhud_color )
write_long( x )
write_long( y )
write_long( 0x38D1B717 )
write_long( 0x38D1B717 )
write_long( 0x3DF5C28F )
write_long( 0 )
write_string( szMessage )
}
message_end()
}
Всем привет, не подскажите что нужно сделать чтобы показывало хп живому человеку, а не только за наблюдателя
 

RockTheStreet

Саппорт года
Сообщения
1,743
Реакции
344
Помог
40 раз(а)
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
Статус
В этой теме нельзя размещать новые ответы.

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

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