czas flasha można ustawić cvarem (jako mnożnik czasu)
mp_flashbang_extend 1.0
dodatkowo minimalny poziom przeźroczystości to 230
#include <amxmodx> #include <amxmisc> #include <fakemeta> #define PLUGIN "Flash Extended" #define VERSION "1.1" #define AUTHOR "R3X" new gcvarFlashDelay; new gcvarFlashExtend; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_forward(FM_SetModel, "fwSetModel", 1); register_message(get_user_msgid("ScreenFade"), "msgScreenFade"); gcvarFlashDelay = register_cvar("mp_flashbang_delay", "1.0"); gcvarFlashExtend = register_cvar("mp_flashbang_extend", "1.2"); } public fwSetModel(ent, const szModel[]) { static szClass[32]; pev(ent, pev_classname, szClass, 31); if(equal(szClass, "grenade") && equal(szModel, "models/w_flashbang.mdl")) { new Float:fDelay = get_gametime() + get_pcvar_float(gcvarFlashDelay); set_pev(ent, pev_dmgtime, fDelay); set_pev(ent, pev_nextthink, fDelay); } } public msgScreenFade(msg_type, msg_id, id) { if(!is_user_connected(id)) return PLUGIN_CONTINUE; if(get_msg_arg_int(4) == 255 && get_msg_arg_int(5) == 255 && get_msg_arg_int(6) == 255) { new duration = get_msg_arg_int(1); new holdtime = get_msg_arg_int(2); duration = floatround( float(duration) * get_pcvar_float(gcvarFlashExtend) ); holdtime = floatround( float(holdtime) * get_pcvar_float(gcvarFlashExtend) ); set_msg_arg_int(1, ARG_SHORT, duration); set_msg_arg_int(2, ARG_SHORT, holdtime); if(get_msg_arg_int(7) < 255) { set_msg_arg_int(7, ARG_BYTE, 230); } } return PLUGIN_CONTINUE; }