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 and arguments != “”) then
for k, v in pairs( player.GetAll() ) do
if (string.find(v:Nick(),arguments)) then
if v:Team() == TEAM_POLICE then
Notify(v, 1, 4, “You have been promoted to Police Chief.”)