Wezza
lua nOOb
- Joined
- May 31, 2008
- Messages
- 2,278
- Reaction score
- 31
The script shows no errors at the console, however it adds no items to the player.
Its a bit custom, let me explain how it is supposed to work.
On player first login, he is unable to move and supposed to receive his first items, server sends him a "not possible msg", the server automatically
pop up a message regarding info about the OT. Now the server push the new player 1 SQM to North, then another 1 SQM to North automatically, and pop-up a new Message which explains further more about the OT itself.
so now what is working?
Everything, except for the Items, the new player receives nothing.
Its a bit custom, let me explain how it is supposed to work.
On player first login, he is unable to move and supposed to receive his first items, server sends him a "not possible msg", the server automatically
pop up a message regarding info about the OT. Now the server push the new player 1 SQM to North, then another 1 SQM to North automatically, and pop-up a new Message which explains further more about the OT itself.
so now what is working?
Everything, except for the Items, the new player receives nothing.
Code:
local function secondMovePlayer(q)
local cid = q.cid
if isPlayer(cid) == TRUE then
doMoveCreature(cid, NORTH)
doCreatureSetNoMove(cid, FALSE)
doShowTextDialog(cid, 8931, "xxx")
end
end
local function moveNewPlayer(p)
local cid = p.cid
if isPlayer(cid) == TRUE then
doMoveCreature(cid, NORTH)
addEvent(secondMovePlayer, 900, {cid = cid})
end
end
function onLogin(cid)
if getPlayerGroupId(cid) < 2 then
local hasReceivedFirstItems = getPlayerStorageValue(cid, 908081)
if hasReceivedFirstItems ~= 1 then
if not comparePos(getPlayerPosition(cid), {x=831,y=702,z=7}) then
doTeleportThing(cid, {x=831,y=702,z=7}, false)
end
setPlayerStorageValue(cid, _STORAGES.CHARGES.manapotion, 100)
setPlayerStorageValue(cid, _STORAGES.CHARGES.reflection, 3)
setPlayerStorageValue(cid, _STORAGES.CHARGES.namescroll, 0)
setPlayerStorageValue(cid, _STORAGES.CHARGES.deathavenger, 0)
setPlayerStorageValue(cid, 908081, 1)
--[[ local giveItems = firstItems[getPlayerVocation(cid)]
if giveItems ~= nil then
for _, v in ipairs(giveItems) do
if getPlayerItemCount(cid, v.itemid) >= v.count then
break
doPlayerAddItem(cid, v.itemid, v.count)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You received your first items depending on your vocation.")
end
for _, v in ipairs(commonItems) do
if getPlayerItemCount(cid, v.itemid) >= v.count then
break
doPlayerAddItem(cid, v.itemid, v.count)
end
]]
doShowTextDialog(cid, 2110, "xxx")
doCreatureSetNoMove(cid, TRUE)
addEvent(moveNewPlayer, 10100, {cid = cid})
elseif getCreatureNoMove(cid) == TRUE then
doCreatureSetNoMove(cid, FALSE)
end
end
return true
end