Promoting Problem

Hello.

I developed this chat command for DarkRP which allows the Mayor to promote a civil protection to the civil protection chief, it’s causing some problems because it allows you to promote more than one person, how would I eliminate this problem.

[lua] local function cmdPromotePlayer(client, arguments)
if (client:Team() == TEAM_MAYOR) then
if (arguments[1] and arguments[1] != “”) then
for k, v in pairs( player.GetAll() ) do
if (string.find(v:Nick(),arguments[1])) then
if v:Team() == TEAM_POLICE then
v:ChangeTeam(TEAM_CHIEF, true);
Notify(v, 1, 4, “You have been promoted to Police Chief.”)
break
end;
end;
end;
end;
end;
return “”
end;

AddChatCommand("/promote", cmdPromotePlayer);[/lua]

Make an if statement to check if there chief team doesn’t have any players. (team.NumPlayers)