mohamed gomgom
Scripter
Server is currently offline on otservlist.org
But it's online and more than 6 players logged in
But it's online and more than 6 players logged in
Attachments
-
debug.JPG52.9 KB · Views: 28 · VirusTotal
HI guys, I'll update my server for 0.3.4 because 0.3.2 crash ever, but I have one problem with first items, when I login in char I receive first itens forever, look my script:
local commonItems = {
-- ITEMS ALL VOC RECEIVE
{itemid=2457, count=1}, -- steel helmet
{itemid=2463, count=1}, -- plate armor
{itemid=2647, count=1}, -- plate legs
{itemid=2152, count=5}, -- 50 platinum coins
{itemid=2120, count=1}, -- rope
{itemid=5710, count=1} -- shovel
}
local firstItems = {
{ -- SORC ITEMS
{itemid=2190, count=1}, -- wand of vortex
{itemid=7457, count=1}, -- spell book
{itemid=2200, count=1} -- aol
},
{ -- DRUID ITEMS
{itemid=2182, count=1}, -- snakebite rod
{itemid=7457, count=1}, -- spellbook
{itemid=2200, count=1} -- aol
},
{ -- PALADIN ITEMS
{itemid=2456, count=1}, -- bow
{itemid=7457, count=1}, -- spell book
{itemid=2544, count=100}, -- 100 arrows
{itemid=2200, count=1}, -- aol
{itemid=1294, count=20}
},
{ -- KNIGHT ITEMS
{itemid=2413, count=1}, -- clerical mace
{itemid=2518, count=1}, -- beholder shield
{itemid=2200, count=1} -- aol
}
}
for _, items in ipairs(firstItems) do
for _, item in ipairs(commonItems) do
table.insert(items, item)
end
end
function onLogin(cid)
if getPlayerGroupId(cid) < 2 then
if getPlayerStorageValue(cid, 90808) <= 0 then
doPlayerAddItem(cid, 1988, 1)
local giveItems = firstItems[getPlayerVocation(cid)]
if giveItems ~= nil then
for _, v in ipairs(giveItems) do
doPlayerAddItem(cid, v.itemid, v.count or 1)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You received your first items depending on your vocation.")
end
setPlayerStorageValue(cid, 90808, 1)
end
end
return TRUE
end
Your database sql is readonly, click propeteries in your file example: database.sql and uncheck options "Read Only"I've problem with :
Code:sqlite3_step(): SQLITE ERROR: attempt to write a readonly database sqlite3_step(): SQLITE ERROR: attempt to write a readonly database sqlite3_step(): SQLITE ERROR: attempt to write a readonly database > ERROR: Failed to save account: 1!
Anti-newbie protection ;]
Your database sql is readonly, click propeteries in your file example: database.sql and uncheck options "Read Only"
Sorry for double post...
[16/05/2009 20:55:56] mysql_real_query(): INSERT INTO `server_motd` (`id`, `world_id`, `text`) VALUES (1, 0, 'Welcome to ~"Not Interesting"~!'); - MYSQL ERROR: Duplicate entry '1-0' for key 1 (1062)
.. comes only by the first player who login.2.
Quote:
[16/05/2009 20:55:56] mysql_real_query(): INSERT INTO `server_motd` (`id`, `world_id`, `text`) VALUES (1, 0, 'Welcome to ~"Not Interesting"~!'); - MYSQL ERROR: Duplicate entry '1-0' for key 1 (1062)
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if msgcontains(msg, 'demon oak') then
if getPlayerStorageValue(cid, 15006) == 4 and getPlayerStorageValue(cid, 15005) == -1 then
selfSay('You found the demon oak ? For kill it\'s you need a {Hallowed Axe}. You want get this ?', cid)
talkState[talkUser] = 1
elseif getPlayerStorageValue(cid, 15005) == -1 and getPlayerStorageValue(cid, 15006) <= 4 then
selfSay('This a old demon , but we don\'t know where it\'s live.', cid)
elseif getPlayerStorageValue(cid, 15005) == 3 then
selfSay('Go defeat demon oak. When you do this report me.', cid)
talkState[talkUser] = 0
elseif getPlayerStorageValue(cid, 15005) == 7 then
selfSay('I can\'t believe, you really defeat the demon oak. Now is possible you get you reward. Search near cemitery.', cid)
setPlayerStorageValue(cid,15005,8)
talkState[talkUser] = 0
end
elseif msgcontains(msg, 'hallowed axe') then
if getPlayerStorageValue(cid, 15005) == -1 then
selfSay('I can forge this but i need {1000 gold coins} and a {axe}. You interessed ?', cid)
talkState[talkUser] = 1
elseif getPlayerStorageValue(cid, 15005) == 1 then
selfSay('Great. You have 1000 gold coins to give me ?.', cid)
talkState[talkUser] = 2
elseif getPlayerStorageValue(cid, 15005) == 2 then
selfSay('Great. Now you have a {axe} to me ?.', cid)
talkState[talkUser] = 3
end
elseif talkState[talkUser] == 1 then
if msgcontains(msg, 'yes') then
selfSay('Great. You have 1000 gold coins to give me ?.', cid)
setPlayerStorageValue(cid,15005,1)
talkState[talkUser] = 2
else
selfSay('Ok.', cid)
end
elseif talkState[talkUser] == 2 then
if msgcontains(msg, 'yes') then
if(doPlayerRemoveMoney(cid, 1000) == TRUE) then
selfSay('Great. Now you have a {axe} to me ?.', cid)
setPlayerStorageValue(cid,15005,2)
talkState[talkUser] = 3
else
selfSay('Ok.', cid)
end
end
elseif talkState[talkUser] == 3 then
if msgcontains(msg, 'yes') then
if doPlayerRemoveItem(cid,2386,1) == 1 then
selfSay('Great. Now go and defeat a Demon Oak. Later report me.', cid)
doPlayerAddItem(cid,8293,1)
setPlayerStorageValue(cid,15005,3)
talkState[talkUser] = 3
else
selfSay('Ok.', cid)
end
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
todoPlayerRemoveItem(cid,xxxx,1) == 1
doPlayerRemoveItem(cid,xxxx,1) == true
[16/05/2009 15:07:11] mysql_real_query(): INSERT INTO `server_motd` (`id`, `world_id`, `text`) VALUES (7, 0, 'Bienvenidos a Owner Server, Disfrutenlo. !help para comandos'); - MYSQL ERROR: Duplicate entry '7-0' for key 'id' (1062)
[16/05/2009 15:07:15] [Warning - Groups::getGroup] Group 0 not found.
[16/05/2009 15:07:15] [Warning - Groups::getGroup] Group 0 not found.