Witam,
Jak w temacie mam problem z NPC - gdy chce przenie?? si? gdzie? przy pomocy tego NPC wywala crash serwera. Dodam jeszcze ?e komenda /send wymaga 3 accessu - taki access maj? NPC.
Komenda dzia?a bo gdy gmem wpisze /send nick, 160 54 7 - to normalnie mnie przenosi...
Przyk?adowy NPC:
Prosz? o pomoc,
Pozdrawiam.
Jak w temacie mam problem z NPC - gdy chce przenie?? si? gdzie? przy pomocy tego NPC wywala crash serwera. Dodam jeszcze ?e komenda /send wymaga 3 accessu - taki access maj? NPC.
Komenda dzia?a bo gdy gmem wpisze /send nick, 160 54 7 - to normalnie mnie przenosi...
Przyk?adowy NPC:
Code:
focus = 0
talk_start = 0
target = 0
following = false
attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Dowidzenia.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not
string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if ((string.find(msg, '(%a*)hi(%a*)')
or string.find(msg, '(%a*)siema(%a*)')
or string.find(msg, '(%a*)czesc(%a*)')
or string.find(msg, '(%a*)cze(%a*)')
or string.find(msg, '(%a*)yo(%a*)')
or string.find(msg, '(%a*)elo(%a*)'))
and (focus == 0)) and getDistanceToCreature(cid) < 4 then
rsay = math.random(1,4)
if rsay == 1 then says = 'Waazzuup'
elseif rsay == 2 then says = 'Siema'
elseif rsay == 3 then says = 'Czesc'
elseif rsay == 4 then says = 'Witam'
end
if isPremium(cid) then
selfSay('Siemka ' .. creatureGetName(cid) .. '! Zabiore cie na expguard, evul, rookish, ice land, etero, tunder po 200 gps. Gdzie chcesz plynac?')
focus = cid
talk_start = os.clock()
else
selfSay('Nie posiadasz pacc, aby dowiedziec sie wiecej odwiedz strone nanoots.no-ip.org!')
focus = 0
talk_start = 0
end
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Spadaj do kolejki ' .. creatureGetName(cid) .. ' .')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'expguard') then
if pay(cid,200) then
selfSay('Jazda!')
selfSay('/send ' .. creatureGetName(cid) .. ', 142 213 7')
focus = 0
talk_start = 0
else
selfSay('Nie masz tyle pieniedzy.')
end
elseif msgcontains(msg, 'exp') then
if pay(cid,200) then
selfSay('Jazda!')
selfSay('/send ' .. creatureGetName(cid) .. ', 142 213 7')
focus = 0
talk_start = 0
else
selfSay('Nie masz tyle pieniedzy.')
end
elseif msgcontains(msg, 'tunder') then
if pay(cid,200) then
selfSay('Jazda!')
selfSay('/send ' .. creatureGetName(cid) .. ', 314 288 7')
focus = 0
talk_start = 0
else
selfSay('Nie masz tyle pieniedzy.')
end
elseif msgcontains(msg, 'etero') then
if pay(cid,500) then
selfSay('Jazda!')
selfSay('/send ' .. creatureGetName(cid) .. ', 254 514 7')
focus = 0
talk_start = 0
else
selfSay('Nie masz tyle piniedzy.')
end
elseif msgcontains(msg, 'evul') then
if pay(cid,200) then
selfSay('Jazda!')
selfSay('/send ' .. creatureGetName(cid) .. ', 595 71 7')
focus = 0
talk_start = 0
else
selfSay('Nie masz tyle pieniedzy.')
end
elseif msgcontains(msg, 'rookish') then
if pay(cid,200) then
selfSay('Jazda!')
selfSay('/send ' .. creatureGetName(cid) .. ', 858 323 7')
focus = 0
talk_start = 0
else
selfSay('Nie masz tyle pieniedzy.')
end
elseif msgcontains(msg, 'ice land') then
if pay(cid,200) then
selfSay('Jazda!')
selfSay('/send ' .. creatureGetName(cid) .. ', 291 71 7')
focus = 0
talk_start = 0
else
selfSay('Nie masz tyle pieniedzy.')
end
elseif msgcontains(msg, 'rook') then
if pay(cid,200) then
selfSay('Jazda!')
selfSay('/send ' .. creatureGetName(cid) .. ', 858 323 7')
focus = 0
talk_start = 0
else
selfSay('Nie masz tyle pieniedzy.')
end
elseif msgcontains(msg, 'ice') then
if pay(cid,200) then
selfSay('Jazda!')
selfSay('/send ' .. creatureGetName(cid) .. ', 288 70 7')
focus = 0
talk_start = 0
else
selfSay('Nie masz tyle pieniedzy.')
end
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Dowidzenia ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Nastepny prosze.')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Dowiedzenia.')
focus = 0
end
end
end
Pozdrawiam.