// if target player is currently admin, demote and replace him
if(fyou==admin){
targetFaction.promoteNewLeader();
msg("<i>You have demoted %s<i> from the position of faction admin.",fyou.describeTo(fme,true));
fyou.msg("<i>You have been demoted from the position of faction admin by %s<i>.",senderIsConsole?"a server admin":fme.describeTo(fyou,true));
return;
}
// promote target player, and demote existing admin if one exists
if(admin!=null)
admin.setRole(Role.MODERATOR);
fyou.setRole(Role.ADMIN);
msg("<i>You have promoted %s<i> to the position of faction admin.",fyou.describeTo(fme,true));
// Inform all players
for(FPlayerfplayer:FPlayers.i.getOnline()){
fplayer.msg("%s<i> gave %s<i> the leadership of %s<i>.",senderIsConsole?"A server admin":fme.describeTo(fplayer,true),fyou.describeTo(fplayer),targetFaction.describeTo(fplayer));