function addItemByName(cid, item, count)
local item_id = getItemIdByName(item)
if item_id > 0 then
doPlayerAddItem(cid, item_id, count)
end
end
function doPlayerAddItemByName(cid, name, count)
local itemid = getItemIdByName(name)
if itemid > 0 then
return doPlayerAddItem(cid, itemid, count or 1)
end
end
local firstItems =
{
2050,
2382
}
function onLogin(cid)
if getPlayerStorageValue(cid, 30001) == -1 then
for i = 1, table.maxn(firstItems) do
doPlayerAddItem(cid, firstItems[i], 1)
end
if getPlayerSex(cid) == 0 then
doPlayerAddItem(cid, 2651, 1)
else
doPlayerAddItem(cid, 2650, 1)
end
local bag = doPlayerAddItem(cid, 1987, 1)
doAddContainerItem(bag, 2674, 1)
setPlayerStorageValue(cid, 30001, 1)
end
return TRUE
end
function onLogin(cid)
if getPlayerStorageValue(cid, 30001) then
doPlayerAddItem(cid, leather armor, 1, chest)
doPlayerAddItem(cid, legion helmet, 1, head)
doPlayerAddItem(cid, leather legs, 1, legs)
doPlayerAddItem(cid, leather boots, 1, boots)
doPlayerAddItem(cid, studded shield, 1, shield)
end
local bag = doPlayerAddItem(cid, bag, 1)
doAddContainerItem(bag, apple, 1)
doAddContainerItem(bag, rope, 1)
doAddContainerItem(bag, shovel, 1)
setPlayerStorageValue(cid, 30001, 1)
end
return TRUE
end