flashbang надо поставить проверку чтоб не ослепляло людей (выживших) , а только чтоб действовало на зомби ,mod biohazard
Код:
#include <amxmodx>
#include <amxmisc>
#include <biohazard>
#define PLUGIN "Dark Flashbangs"
#define VERSION "0.2"
#define AUTHOR "SAMURAI & Alka"
#define MAX_NAME_LENGTH 32
#define byteAr 0
#define byteBg 0
#define byteCb 0
#define byteDalpha 255
new g_nMsgScreenFade
new pNumEnable
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("ScreenFade","dkFlashEvent","be","4=255","5=255","6=255","7>199");
g_nMsgScreenFade = get_user_msgid("ScreenFade");
pNumEnable = register_cvar("amx_darkflashbangs","1");
register_concmd("amx_darkflashbangs","admin_command",ADMIN_RCON,"Use amx_darkflashbangs <0 | 1> <Disabled|Enabled>");
}
public admin_command(id,level,cid)
{
if(!cmd_access(id,level,cid,2))
{
console_print(id,"You don't have acces on that command")
return PLUGIN_HANDLED;
}
if (read_argc() < 1)
{
console_print(id,"Use: amx_darkflashbangs <0|1> <Disabled|Enabled>")
return PLUGIN_HANDLED;
}
new sArg[MAX_NAME_LENGTH]
read_argv(1, sArg, MAX_NAME_LENGTH -1 )
set_cvar_num("amx_darkflashbangs",str_to_num(sArg))
if ( equal(sArg,"0") )
{
console_print(id,"DarkFlashbangs is now off")
}
else if( equal(sArg,"1") )
{
console_print(id,"DarkFlashbangs is now off")
}
return PLUGIN_HANDLED;
}
public dkFlashEvent(id)
{
if(!is_user_connected(id) && !get_pcvar_num(pNumEnable))
return PLUGIN_HANDLED
emit_sound(id,CHAN_AUTO, "weapons/flashbang-1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
server_cmd("mp_footsteps 0")
message_begin( MSG_ONE,g_nMsgScreenFade,{0,0,0},id )
write_short(read_data(1))
write_short(read_data(2))
write_short(read_data(3))
write_byte(byteAr)
write_byte(byteBg)
write_byte(byteCb)
write_byte(read_data(7))
message_end()
emit_sound(id,CHAN_AUTO, "weapons/flashbang-2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
set_task(5.0,"stopFoot")
return PLUGIN_HANDLED;
}
public stopFoot()
{
server_cmd("mp_footsteps 1")
}
Отредактировал: iShot, - 30.5.2016, 14:10
Причина: Выдано устное предупреждение!