Problemy.

Status
Zamknięty.

Nikus12

Active User
Zarejestrowany
Dołączył
Kwiecień 25, 2009
Posty
67
Liczba reakcji
3
Witam.!!

Pierwszy problem jest nast?puj?cy, gdy zrobi? raida wed?ug poradnik?w/opis?w w konsoli wyskakuje ci?gle ten sam b??d

"[Error - Raids::parseRaidNode] interval2 tag missing or divided by 0 for raid piraty

Plik Raid wygl?da tak:
<raids>
<raid name="piraty" file="piraty.xml" interval="40" chance="35" margin="0" />
</raids>

Drugi problem polega na tym ?eby kto? m?g? przerobi? NPC od soft?w, gdy? pobiera kase i zabiera softy, lecz nie daje z powrotem nowych?!. plik:

Kod:
function getPlayerMoney(cid) 
gold = getPlayerItemCount(cid,2148) 
plat = getPlayerItemCount(cid,2152)*100 
crys = getPlayerItemCount(cid,2160)*10000 
money = gold + plat + crys 
return money 
end 
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) 
if(not npcHandler:isFocused(cid)) then
return false 
end 
local softItem = 'Sorry, you dont have money or soft boots.' -- Co powie npc jesli nie bedziesz mial wymaganych przez niego itemow 
local softGive = 'Here you are my boss.' -- Co powie npc gdy Ci da nowe buty
if msgcontains(msg, 'offer') then
			npcHandler:say('I can rapair if u have full used boots or renew if u have some minutes left',cid)
		elseif msgcontains(msg, 'help') then
			npcHandler:say('I can rapair if u have full used boots or renew if u have some minutes left ',cid)
------------------------------------------------------------------------------------------------
elseif msgcontains(msg, 'soft boots') or msgcontains(msg, 'repair') or msgcontains(msg, 'repair boots') then 
if getPlayerItemCount(cid,10021) >= 1 and getPlayerMoney(cid,2148)  >= 20000 then
npcHandler:say('Do you want me to repair your soft boots for 20k?', cid) 
talkState = 1 
else 
npcHandler:say((softItem), cid) 
end 
elseif msgcontains(msg, 'yes') and talkState == 1 then 
if getPlayerItemCount(cid,10021) >= 1  and getPlayerMoney(cid,2148) >= 20000  then 
if doPlayerTakeItem(cid,10021,1) == 0 and doPlayerRemoveMoney(cid,20000) then 
npcHandler:say((softGive), cid) 
doPlayerAddItem(cid,6132, 1) 
end 
else 
npcHandler:say((softItem), cid) 
end 
talkState = 0 
elseif msgcontains(msg, 'renew')  then 
if getPlayerItemCount(cid,6132) >= 1 and getPlayerMoney(cid,2148)  >= 20000 then
npcHandler:say('Do you want me to renew your soft boots for 20k?', cid) 
talkState = 2 
else 
npcHandler:say((softItem), cid) 
end 
elseif msgcontains(msg, 'yes') and talkState == 2 then 
if getPlayerItemCount(cid,6132) >= 1  and getPlayerMoney(cid,2148)  >= 20000 then 
if doPlayerTakeItem(cid,6132,1) == 0 and doPlayerRemoveMoney(cid,20000) then 
npcHandler:say((softGive), cid) 
doPlayerAddItem(cid,6132, 1) 
end 
else 
npcHandler:say((softItem), cid) 
end 
talkState = 0 
elseif msgcontains(msg, 'no') and talkState >= 1 and talkState <= 2 then
        npcHandler:say('Ok than.', cid)
        talkState = 0
    end
    return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

M?g? by Mi kto? wyja?ni? na czym to polega i poprawi? b??d.

Pozdrawiam
 
Odp: Problemy.

1.
PHP:
<raid name="piraty" file="piraty.xml" interval2="40" margin="35" enabled="yes" />
2.
PHP:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
local teksty = {'I repair soft boots!', 'Want to repair soft boots?'}
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 onThink()
npcHandler:onThink()
if #npcHandler.focuses < 1 and math.random(1,480) == 1 then
 doCreatureSay(getNpcCid(), teksty[math.random(1,#teksty)], 3)
end
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, 'soft') or msgcontains(msg, 'soft boots')) then
		selfSay('Do you want to repair your worn soft boots for 10000 gold coins?', cid)
		talkState[talkUser] = 1
	elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
		if(getPlayerItemCount(cid, 6530) >= 1) then
			if(doPlayerRemoveMoney(cid, 10000)) then
				local item = getPlayerItemById(cid, true, 6530)
				doTransformItem(item.uid, 6132)
				selfSay('Here you are.', cid)
			else
				selfSay('Sorry, you don\'t have enough gold.', cid)
			end
		elseif(getPlayerItemCount(cid, 10021) >= 1) then
			if(doPlayerRemoveMoney(cid, 10000)) then
				local item = getPlayerItemById(cid, true, 10021)
				doTransformItem(item.uid, 6132)
				selfSay('Here you are.', cid)
			else
				selfSay('Sorry, you don\'t have enough gold.', cid)
			end
		else
			selfSay('Sorry, you don\'t have the item.', cid)
		end
		talkState[talkUser] = 0
	elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser])) then
		talkState[talkUser] = 0
		selfSay('Ok then.', cid)
	end
	return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Odp: Problemy.

Dzia?a poprawnie, dzi?ki. ++

Notka moderatorska:
Zamykam
 
Ostatnio edytowane przez moderatora:
Status
Zamknięty.
Back
Do góry