ID:2429560
 
var list/mobs = new
// A global variable that can be accessed anywhere within the code
// new initializes it, so you don't have to.

mob/Login()
mobs |= src
// Add the mob logging in to the global list.
..()
// Magic

mob/Logout()
mobs -= src
// Removes the mob logging out from the global list.
..()
// Magic

mob/verb/GenderBasedTeamSay(msg as text)
for(var/mob/m in mobs)
// Loop through every /mob inside of global.mobs
if(m.gender != gender){continue}
// If their gender isn't the same, continue to the next iteration of the for()
// If it is the same, the code will continue to run as normal
m << "[name] says [html_encode(msg)]"
// Output the value of msg to m
// html_encode is useful :^)