Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
Столкнулась с проблемой, как сделать включение и отключение по команде.
Вложения
-
1.1 KB Просмотры: 4
#include <amxmodx>
#include <hamsandwich>
#define PLUGIN "Blue Fade"
#define VERSION "0.1"
#define AUTHOR "Stimul"
new bool:g_bShowFade[33];
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_clcmd("say /fade", "ClCmdToggle");
register_event("Fade", "eFade", "b", "2!0", "3=0", "4!0");
}
public client_putinserver(pClient)
{
new sInfo[4]; get_user_info(pClient, "_dmg", sInfo, charsmax(sInfo));
if(sInfo[0] && equal(sInfo, "on")) g_bShowFade[pClient] = true;
else g_bShowFade[pClient] = false;
}
public eFade(victim, attacker, corpse)
{
if(!is_user_connected(victim) || !g_bShowFade[victim] || !is_user_connected(attacker) || victim == attacker)
return HAM_IGNORED;
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, attacker)
write_short(1<<10)
write_short(1<<10)
write_short(0x0000)
write_byte(0)
write_byte(0)
write_byte(200)
write_byte(75)
message_end()
return HAM_IGNORED;
}
public ClCmdToggle(pClient)
{
if(g_bShowFade[pClient])
{
client_cmd(pClient, "setinfo _dmg off");
g_bShowFade[pClient] = false;
}
else
{
client_cmd(pClient, "setinfo _dmg on");
g_bShowFade[pClient] = true;
}
return PLUGIN_HANDLED;
}
#include <amxmodx>
#include <hamsandwich>
#define PLUGIN "Blue Fade"
#define VERSION "0.1"
#define AUTHOR "Stimul"
static g_bShowFade[33];
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_clcmd("say /fade", "ClCmdToggle");
RegisterHam(Ham_Killed, "player", "Ham_Killed_Player_Post", true);
}
public client_putinserver(pClient)
{
new sInfo[4]; get_user_info(pClient, "_dmg", sInfo, charsmax(sInfo));
if(sInfo[0] && equal(sInfo, "on"))
g_bShowFade[pClient] = 1;
else
g_bShowFade[pClient] = 0;
}
public Ham_Killed_Player_Post(id, killer)
{
if(id == killer || !is_user_alive(killer) || !g_bShowFade[killer])
return;
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, killer)
write_short(1<<10)
write_short(1<<10)
write_short(0x0000)
write_byte(0)
write_byte(0)
write_byte(200)
write_byte(75)
message_end()
}
public ClCmdToggle(pClient)
{
if(g_bShowFade[pClient])
{
client_cmd(pClient, "setinfo _dmg off");
g_bShowFade[pClient] = 0;
}
else
{
client_cmd(pClient, "setinfo _dmg on");
g_bShowFade[pClient] = 1;
}
return PLUGIN_HANDLED;
}