Jean Elcard
The Flavournator
@Xienwolf: Not bad for someone, who says of himself NOT to be proficient at Python. 
The code looks good to me and should work nicely. The only thing, that bothers me is, that you are using your description string for the random number as a list index later on. You'll have to save the number to a variable first.
Ok, here is the slightly modified code I would use:

The code looks good to me and should work nicely. The only thing, that bothers me is, that you are using your description string for the random number as a list index later on. You'll have to save the number to a variable first.
Ok, here is the slightly modified code I would use:
Code:
listPlayers = []
pPlayer = gc.getPlayer(pUnit.getOwner())
for iPlayer in range(gc.getMAX_PLAYERS()):
pOtherPlayer = gc.getPlayer(iPlayer)
eOtherTeam = TeamTypes(pOtherPlayer.getTeam())
if (pOtherPlayer.isAlive()):
if pPlayer.isHasMet(eOtherTeam):
listPlayers.append(pOtherPlayer)
iGift = CyGame().getSorenRandNum(len(listPlayers) * 2, "Gift")
if iGift <= len(listPlayers):
pCity = listPlayers[iGift].getCapitalCity()
else:
pCity = pPlayer.getCapitalCity()
newUnit = listPlayers[Gift].initUnit(gc.getInfoTypeForString('UNIT_MIT0'), pCity.getX(), pCity.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)