Hello. I want to do that players could choose if they want to see the blue screen fade effect or not.
I need two commands /effecton and /effectoff with which could be turn on or off the screen fade. Turned off should be default option.
And if it is possible, I need option remind in order to when player recconects he would not have to turn on this effect again.
Can anyone help me?
PHP Code:
#include <amxmodx>
#include <fun>
#define PLUGIN "Kill Green Fade"
#define VERSION "1.0"
#define AUTHOR "AMXX Community"
#define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers )
new g_iMaxPlayers, msgScreenFade, amx_kill_fade_amount, amx_kill_health
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
amx_kill_fade_amount = register_cvar("amx_kill_fade_amount", "150")
amx_kill_health = register_cvar("amx_kill_health", "0")
register_event("DeathMsg", "death_event", "a", "1>0")
msgScreenFade = get_user_msgid("ScreenFade")
g_iMaxPlayers = get_maxplayers()
}
public death_event()
{
new iKiller = read_data(1)
if(IsPlayer(iKiller) && is_user_alive(iKiller))
{
fadegreen(iKiller, get_pcvar_num(amx_kill_fade_amount))
set_user_health(iKiller, get_user_health(iKiller) + get_pcvar_num(amx_kill_health))
}
}
stock fadegreen(id, ammount)
{
//FADE OUT FROM GREEN
if (ammount > 255)
ammount = 255
message_begin(MSG_ONE_UNRELIABLE, msgScreenFade, {0,0,0}, id)
write_short(ammount * 100) //Durration
write_short(0) //Hold
write_short(0) //Type
write_byte(0) //R
write_byte(0) //G
write_byte(255) //B
write_byte(ammount) //B
message_end()
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1063\\ f0\\ fs16 \n\\ par }
*/