Or, maybe, someone can help me with this script:
Code: Select all
def FindPlayer(playerName):
matches = 0
p_good = ""
try:
for p in bf2.playerManager.getPlayers():
if p.getName().lower().find(playerName.lower()) != -1:
p_good = p
matches += 1
mm.debug("Player name is %s" % p_good.getName().lower())
# If actual player's name perfectly fits finish it up
[color=Red] if p.getName().lower().equals(playerName.lower()):
p_good = p
matches = 1
mm.debug("Exact name is found and it's %s" % p_good.getName().lower())
break[/color]
if matches > 1:
return "more"
if matches == 0:
return "none"
else:
return p_good
except:
mm.debug("Exception in FindPlayer()")
return "none"