Участник
Пользователь
- Сообщения
- 272
- Реакции
- 14
Hi,
Can someone edit this code so that this icon flashes when it is displayed? (flashing icon)
And that this icon should also be shown to the spectator of the player (the player who killed with the headshoot and the spectator of that player).
Can someone edit this code so that this icon flashes when it is displayed? (flashing icon)
And that this icon should also be shown to the spectator of the player (the player who killed with the headshoot and the spectator of that player).
Код:
#include <amxmodx>
#include <reapi>
new const PLUGIN_NAME[] = "Icon headshot after killed";
new const PLUGIN_VERSION[] = "1.0";
new const PLUGIN_AUTHOR[] = "6u3oH";
new const ICON_NAME[] = "d_headshot"; // icon name
new const ICON_COLOR[] = { 128, 0, 255 }; // icon color { R, G, B }
const Float: ICON_SHOW_TIME = 2.5; // icon show time (seconds)
enum any:
{
STATUS_ICON_HIDE,
STATUS_ICON_SHOW,
STATUS_ICON_FLASH,
};
new g_iMsgStatusIconIndex;
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
RegisterHookChain(RG_CBasePlayer_Killed, "@CBasePlayer_Killed_Post", true);
g_iMsgStatusIconIndex = get_user_msgid("StatusIcon");
}
public client_disconnected(pPlayer)
{
remove_task(pPlayer);
}
@CBasePlayer_Killed_Post(pVictim, pKiller, iGib)
{
if(!is_user_connected(pKiller) || !get_member(pVictim, m_bHeadshotKilled))
return;
set_msg_status_icon(pKiller,
STATUS_ICON_SHOW,
ICON_NAME,
ICON_COLOR[0],
ICON_COLOR[1],
ICON_COLOR[2]
);
remove_task(pKiller);
set_task(ICON_SHOW_TIME, "@func_StatusIcon_Hide", pKiller);
}
@func_StatusIcon_Hide(pPlayer)
{
set_msg_status_icon(pPlayer,
STATUS_ICON_HIDE,
ICON_NAME,
0,
0,
0
);
}
stock set_msg_status_icon(pPlayer, iStatus, const sSpriteName[], iRed, iGreen, iBlue)
{
message_begin(MSG_ONE_UNRELIABLE, g_iMsgStatusIconIndex, .player = pPlayer);
write_byte(iStatus);
write_string(sSpriteName);
write_byte(iRed);
write_byte(iGreen);
write_byte(iBlue);
message_end();
}
Вложения
-
1.7 KB Просмотры: 5