Try this :
PHP Code:
new bool:g_bSeeTrails[33]
new bool:g_bHasTrail[33]
public plugin_init()
{
register_clcmd("say /seetrail", "ClCmd_ToggleTrails")
}
public ClCmd_ToggleTrails( id )
{
new players[32], num, player
get_players(players, num, "a")
if( (g_bSeeTrails[id] = !g_bSeeTrails[id]) )
{
for(--num; num>=0; num--)
{
player = players[num]
if( g_bHasTrail[player] )
{
Util_TE_BEAMFOLLOW(id, player, gl_sprite, 20, 5, 255, 0, 0, 100)
}
}
}
else
{
for(--num; num>=0; num--)
{
player = players[num]
if( g_bHasTrail[player] )
{
Util_TE_KILLBEAM(id, player)
}
}
}
}
set_trail(id, bool:bTrailStatus)
{
if( bTrailStatus == g_bHasTrail[id] )
{
return 0
}
g_bHasTrail[id] = bTrailStatus
new players[32], num, player
get_players(players, num, "ch")
for(--num; num>=0; num--)
{
player = players[i]
if( g_bSeeTrails[player] )
{
if( bTrailStatus )
{
Util_TE_BEAMFOLLOW(player, id, gl_sprite, 20, 5, 255, 0, 0, 100)
}
else
{
Util_TE_KILLBEAM(player, id)
}
}
}
}
Util_TE_BEAMFOLLOW(id, entity, sprite, life, width, red, green, blue, brightness)
{
message_begin(id ? MSG_ONE : MSG_ALL, SVC_TEMPENTITY, _, id);
write_byte(TE_BEAMFOLLOW);
write_short(entity);
write_short(sprite);
write_byte(life); // life in 0.1's
write_byte(width); // line width in 0.1's
write_byte(red);
write_byte(green);
write_byte(blue);
write_byte(brightness);
message_end();
}
Util_TE_KILLBEAM(id, entity)
{
message_begin(id ? MSG_ONE : MSG_ALL, SVC_TEMPENTITY, _, id);
write_byte(TE_KILLBEAM);
write_short(entity);
message_end();
}
__________________