I see the command to get a character to follow another player but how do you tell him to stop following
set "chartofollow" to "null" (without the quotes).
Not that NsMn is wrong in any case, but to just help out a tiny bit more:
cEgo.FollowCharacter(null);