/*
	Grenade Trail 1.0
	Author: Jim
*/

#include <amxmodx>
#include <csx>

#define PLUGIN "Grenade Trail"
#define VERSION "1.0"
#define AUTHOR "Jim"

new g_trail 

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
}

public plugin_precache()
{
	g_trail = precache_model("sprites/smoke.spr")
}

public grenade_throw(id, gid, wid)
{
	new temp[2], weapon = get_user_weapon(id, temp[0], temp[1])
	if(weapon == CSW_SMOKEGRENADE)
	{
        message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
	write_byte(TE_BEAMFOLLOW)
	write_short(gid)
	write_short(g_trail)
	write_byte(10)
	write_byte(5)
	write_byte(0)
	write_byte(255)
	write_byte(0)
	write_byte(192)
	message_end()
        }
}
