PHP Code:
public doAction(id)
{
if ( get_user_team(id) != 1 && get_user_team(id) != 2 )
{
set_task(2.0, "doAction",id)
}
client_cmd(id,"say I'm a terrorist or CT")
}

PHP Code:
public doAction(id)
{
if(get_user_team(id) == 1)
{
client_cmd(id,"say I'm a terrorist");
}
if(get_user_team(id == 2)
{
client_cmd(id, "say I'm a CT");
}
}
then call it where you want.
if you want it to loop every x amounts of seconds
PHP Code:
set_task(Time, "Function", id, _,_,_,b); //The b flag is the loop tag.
If No loop
set_task(Time, "Function", id);