#include <amxmodx>
#include <zombie_plague_advance>
#define PLUGIN "ZP Round Fog"
#define VERSION "1.0.0"
#define AUTHOR "yokomo"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
}
public plugin_cfg()
{
set_task(0.6, "event_round_start")
}
public event_round_start()
{
CreateFog(0, .clear = true);
}
public client_putinserver(id)
{
CreateFog(id, .clear = true);
}
public zp_round_started(gamemode)
{
switch(gamemode)
{
// Make sure density must between 0.0001 and 0.25
// Max RGB color is 255
case MODE_ASSASSIN: CreateFog(0, 255, 255, 255, 0.0005);
}
}
// Stock create fog by Arkshine
stock CreateFog (const index = 0, const red = 127, const green = 127, const blue = 127, const Float:density_f = 0.001, bool:clear = false)
{
static msgFog;
if (msgFog || (msgFog = get_user_msgid("Fog")))
{
new density = _:floatclamp(density_f, 0.0001, 0.25) * _:!clear;
message_begin(index ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, msgFog, .player = index);
write_byte(clamp(red, 0, 255));
write_byte(clamp(green, 0, 255));
write_byte(clamp(blue , 0, 255));
write_byte((density & 0xFF));
write_byte((density >> 8) & 0xFF);
write_byte((density >> 16) & 0xFF);
write_byte((density >> 24) & 0xFF);
message_end();
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/