Well on my server I have that night/day timer. I decided to make a night vision thing for this mod I use. It fades the screen to the green color, but when you get hit/damaged the screen goes back to normal even though it still says its on.
Can this be fixed?
Code:
public nightvisiontoglle(id)
{
if(!is_user_alive(id))
{
return PLUGIN_HANDLED
}
if(nightvision[id] == 0)
{
message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},id);
write_short(~0);
write_short(~0);
write_short(1<<2);
write_byte(0);
write_byte(255);
write_byte(0);
write_byte(50);
message_end();
client_print(id, print_chat, "[ZombieMod] Night Vision On.")
nightvision[id] = 1
return PLUGIN_HANDLED
}
else
{
message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},id);
write_short(~0);
write_short(~0);
write_short(1<<2);
write_byte(0);
write_byte(0);
write_byte(0);
write_byte(0);
message_end();
client_print(id, print_chat, "[ZombieMod] Night Vision Off.")
nightvision[id] = 0
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}