local cost = 10000
local towns = {1, 2, 3}
function onLogin(cid)
if getPlayerLevel(cid) <= 50 then
if getPlayerItemCount(cid, 2173) [COLOR="red"]<= 1[/COLOR] then
if getPlayerMoney(cid) >= cost then
local aol = doCreateItemEx(cid, 2173, 1)
for i = 1, #towns do
if getPlayerDepotItems(cid, towns[i]).itemid ~= 2173 then
if doPlayerAddItemEx(cid, aol, true) ~= RETURNVALUE_NOERROR then
doPlayerSendCancel(cid, "Sorry, you do not have enough space for your AOL.")
break
end
else
doPlayerSendCancel(cid, "Sorry, you already have an AOL.")
end
end
else
doPlayerSendCancel(cid, "Sorry, you don't have enough money for an AOL.")
end
else
doPlayerSendCancel(cid, "Sorry, you already have an AOL.")
end
end
return true
end