Someone can base it off of this... I started making this a long time ago for fastfrag. Let's just say I didn't have the time or will to finish it...
Note: many things do not work correctly as this was one of the earlier to mid versions... But the dev will get the idea. (SQL queries do not work IIRC)