Hay i'm using TFS 0.3 from erp0t and it got a Free Premium System.
The Npc is checking if Player got Premium or not.
And if i write Hi he tellin' me i'm without Premium Account.
Anyone can change the Script for me so it doesn't need Premium Account?
Thanks!
[15/01/2009 03:08:18] Lua Script Error: [Npc interface]
[15/01/2009 03:08:18] data/npc/scripts/addons.lua:onCreatureSay
[15/01/2009 03:08:18] data/npc/scripts/addons.lua:30: bad argument #1 to 'maxn' (table expected, got nil)
[15/01/2009 03:08:18] stack traceback:
[15/01/2009 03:08:18] [C]: in function 'maxn'
[15/01/2009 03:08:18] data/npc/scripts/addons.lua:30: in function 'callback'
[15/01/2009 03:08:18] data/npc/lib/npcsystem/keywordhandler.lua:40: in function 'processMessage'
[15/01/2009 03:08:18] data/npc/lib/npcsystem/keywordhandler.lua:168: in function 'processNodeMessage'
[15/01/2009 03:08:18] data/npc/lib/npcsystem/keywordhandler.lua:128: in function 'processMessage'
[15/01/2009 03:08:18] data/npc/lib/npcsystem/npchandler.lua:371: in function 'onCreatureSay'
[15/01/2009 03:08:18] data/npc/scripts/addons.lua:8: in function <data/npc/scripts/addons.lua:8>
20:02 Leduzin [57]: first yalaharian addon
20:02 Varkhal: Did you bring me 1 vampiric crest for first yalaharian addon?
20:02 Leduzin [57]: yes
20:02 Varkhal: Here you are.
---------------
20:03 Leduzin [57]: second yalaharian addon
20:03 Varkhal: You already have this addon!
Wrong ERROR!! i only got the first addon
but i know whats wrong please edit it in your script
change to 10042
btw thanks for the nice script
if(getPlayerPremiumDays(cid) == 0) and (parameters.premium == true) then
npcHandler:say('Sorry, but this addon is only for premium players!', cid)
npcHandler:resetNpc()
return true
end
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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 buyAddons(cid, message, keywords, parameters, node)
--TODO: buyAddons function in modules.lua
if(not npcHandler:isFocused(cid)) then
return false
end
local addon = parameters.addon
local cost = parameters.cost
local premium = (parameters.premium ~= nil and parameters.premium)
if isPlayerPremiumCallback == nil or (isPlayerPremiumCallback(cid) and premium) then
if doPlayerRemoveMoney(cid, cost) == TRUE then
doPlayerAddAddons(cid, addon)
npcHandler:say('There, you are now able to use all addons!', cid)
else
npcHandler:say('Sorry, you do not have enough money.', cid)
end
else
npcHandler:say('I only serve customers with premium accounts.', cid)
end
keywordHandler:moveUp(1)
return true
end
local node1 = keywordHandler:addKeyword({'first addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the first addons set for 5000 gold coins?'})
node1:addChildKeyword({'yes'}, buyAddons, {addon = 1, cost = 5000, premium = false})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Too expensive, eh?'})
local node2 = keywordHandler:addKeyword({'second addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to buy the second addons set for 10000 gold coins?'})
node2:addChildKeyword({'yes'}, buyAddons, {addon = 2, cost = 10000, premium = false})
node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Too expensive, eh?'})
keywordHandler:addKeyword({'addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell the first addons set for 5000 gold coins and the second addons set for 10000 gold coins.'})
npcHandler:addModule(FocusModule:new())
Lua Script Error: [Npc interface]
data/npc/scripts/addoner.lua:onCreatureSay
data/npc/scripts/addoner.lua:33: attempt to call global 'getItemNameById' (a nil value)
stack traceback:
data/npc/scripts/addoner.lua:33: in function 'callback'
data/npc/lib/npcsystem/keywordhandler.lua:40: in function 'processMessage'
data/npc/lib/npcsystem/keywordhandler.lua:168: in function 'processNodeMessage'
data/npc/lib/npcsystem/keywordhandler.lua:128: in function 'processMessage'
data/npc/lib/npcsystem/npchandler.lua:371: in function 'onCreatureSay'
data/npc/scripts/addoner.lua:8: in function <data/npc/scripts/addoner.lua:8>