I'll save you the effort (I'm so generous). Taken straight from my tempentity plugin (not finished yet).
Code:
//Creates a beam TE between two points.
createBeamPoints(id)
{
message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
//The type of temp entity.
write_byte(TE_BEAMPOINTS);
//Start position.
write_coord(floatround(vector_source[0]));
write_coord(floatround(vector_source[1]));
write_coord(floatround(vector_source[2]));
//End position
write_coord(floatround(vector_destination[0]));
write_coord(floatround(vector_destination[1]));
write_coord(floatround(vector_destination[2]));
//Beam sprite.
write_short(sprite_dot);
//Sprite start frame. Usually fine to just leave this at 1.
write_byte(1);
//Frame rate per 1/10 second.
write_byte(1);
//Lifetime of the TE, in tenths of a second.
write_byte(100);
//Width of the beam.
write_byte(20);
//Noise amplitude. No idea wtf this is. Best to leave it at 0.
write_byte(0);
//Color of the beam. RGB.
write_byte(0);
write_byte(255);
write_byte(255);
//Brightness of the beam.
write_byte(255);
//"scroll-speed". No clue again. Left at 0.
write_byte(0);
//We're done.
message_end();
}