Hello,
I have bugs i two subtopics , how can I fix it? Help needed.I give Rep ++ for Help.
Witam,
Mam błędy w zakładkach Higscores i Guilds nie wiem co jest tego powodem , skrypty wydają się być wporządku , próbowałęm innych wersji skryptów i nadal to samo, jakieś rady? Oczywiście dam Rep++:
1.Higscores :
2.Guilds :
NPC buying vials custom script [Need Help]
Here's NPC who buys vials script:
I have error's in console , can anyone help me ?
I have bugs i two subtopics , how can I fix it? Help needed.I give Rep ++ for Help.
Witam,
Mam błędy w zakładkach Higscores i Guilds nie wiem co jest tego powodem , skrypty wydają się być wporządku , próbowałęm innych wersji skryptów i nadal to samo, jakieś rady? Oczywiście dam Rep++:
1.Higscores :
Code:
Fatal error: Uncaught exception 'E_OTS_NotLoaded' in C:\xampp\htdocs\pot\OTS_Account.php:768 Stack trace: #0 C:\xampp\htdocs\highscores.php(93): OTS_Account->isBanned() #1 C:\xampp\htdocs\index.php(154): include('C:\xampp\htdocs...') #2 {main} thrown in C:\xampp\htdocs\pot\OTS_Account.php on line 768
Code:
Fatal error: Method OTS_Player::__toString() must not throw an exception in C:\xampp\htdocs\guilds.php on line 2024
NPC buying vials custom script [Need Help]
Here's NPC who buys vials script:
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
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
-- OTServ event handling functions end
function creatureSayCallback(cid, type, msg)
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
if(npcHandler.focus ~= cid) then
return false
end
player_gold = getPlayerItemCount(cid,2148)
player_plat = getPlayerItemCount(cid,2152)*100
player_crys = getPlayerItemCount(cid,2160)*10000
player_money = player_gold + player_plat + player_crys
if msgcontains(msg, 'job') or msgcontains(msg, 'help') then
selfSay('I can give you a "lottery ticket" for empty vials.')
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'lottery ticket') then
if isPremium(cid) then
selfSay('Do you want to exchange great or divine empty potions?')
talk_state = 1
elseif msgcontains(msg, 'great') and talk_state == 1 then
if getPlayerItemCount(cid,7635) >= 50 then
selfSay('Did you bring me 50 empty great potions for a lottery ticket?')
talk_state = 2
else
selfSay('I need 50 empty great potions, to give you the lottery ticket. Come back when you have them.')
talk_state = 0
end
elseif msgcontains(msg, 'divine') and talk_state == 1 then
if getPlayerItemCount(cid, 7634) >= 200 then
selfSay('Did you bring me 200 empty divine potions for a lottery ticket?')
talk_state = 3
else
selfSay('I need 200 empty great potions, to give you the lottery ticket. Come back when you have them.')
talk_state = 0
end
else
selfSay('Ok, then.')
talk_state = 0
end
else
selfSay('I will deal only with premium characters.')
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 2 then
talk_state = 0
if getPlayerItemCount(cid,7635) >= 200 then
if doPlayerRemoveItem(cid,2006,200) then
doPlayerAddItem(cid,5957,1)
end
end
elseif msgcontains(msg, 'yes') and talk_state == 3 then
talk_state = 0
if getPlayerItemCount(cid,7634) >= 200 then
if doPlayerRemoveItem(cid,7634,200) then
doPlayerAddItem(cid,5957,1)
end
end
------------------------------------------------ confirm no ------------------------------------------------
elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 34) then
selfSay('Ok than.')
talk_state = 0
end
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
I have error's in console , can anyone help me ?
Code:
[05/07/2009 01:25:50] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/ticket.lua
[05/07/2009 01:25:50] data/npc/scripts/ticket.lua:55: 'end' expected (to close 'function' at line 12) near 'elseif'