if(gTeam = 1)//change "gTeam" to what your variable for faction is. { //Do your task here. return 1; }