What's new

[8.10] Addony

Status
Not open for further replies.

Mateusz7125

Advanced User
Joined
Apr 13, 2008
Messages
192
Reaction score
6
Witam, mam kolejny problem z moim Devland Premium Edition 8.10, a mianowicie nie dzia?aj? mi addony. Nie wiem, co jest tego przyczyn?, ale kiedy pisze do addonera;
>Hi
Odpisuje: Helli 'nick' co? tam co? tam
>first summoner addon (ze wszystkimi taka sama reakcja)
Odpisuje: Potrzebuje to i to no i to a dam ci ten addon...
>pisze Yes

I nic, nic si? nie dzieje... Npc nie odpisuje ,ani ja addona nie dostaje chocia? mam itemy addonowe itp. Mo?e ten silnik nie ma 'doPlayerAddAddon' ??
Prosz? o pomoc

Oto kawa?ek addons.lua (sam pocz?tek)

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

addon_need_premium = 'Sorry, you need a premium aaccount to get addons.'
addon_have_already = 'Sorry, you already have this addon.'
addon_have_not_items = 'Sorry, you don\'t have these items.'
addon_give = 'Here you are.'
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, 'addons') then
selfSay('I can give you Noserman, Citizen, Hunter, Knight, Mage, Nobleman, Summoner, Warrior, Barbarian, Druid, Wizard, Oriental, Pirate, Assassin, Beggar and Shaman addons.')
elseif msgcontains(msg, 'help') then
selfSay('To buy the first addon say \'first NAME addon\', for the second addon say \'second NAME addon\'.')
------------------------------------------------ addon ------------------------------------------------
elseif msgcontains(msg, 'first citizen addon') then
if isPremium(cid) then
if getPlayerItemCount(cid,5878) >= 100 then
selfSay('Did you bring me 100 minotaur leathers?')
talk_state = 1
else
selfSay('I need 100 minotaur leather, to give you the first citizen addon. Come back when you have them.')
talk_state = 0
end
else
selfSay(addon_need_premium)
talk_state = 0
end
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 1 then
talk_state = 0
if getPlayerItemCount(cid,5878) >= 100 then
addon = getPlayerStorageValue(cid,10001)
if addon == -1 then
if doPlayerTakeItem(cid,5878,100) == 0 then
selfSay(addon_give)
doPlayerAddAddon(cid, 128, 1)
doPlayerAddAddon(cid, 136, 1)
setPlayerStorageValue(cid,10001,1)
end
else
selfSay(addon_have_already)
end
else
selfSay(addon_have_not_items)
end

W konsoli nic nie wyskakuje ?aden b??d... Prosz? o szybk? pomoc, dam reputa ;)

Edit: /•-#Reflesh#-•\

Edit: /•-#Reflesh#-•\
 
Status
Not open for further replies.
Top