What's new

Wszyscy NPC u?ywaj?cy komendy /send crashuj?

Status
Not open for further replies.

iphone733

User
Joined
May 4, 2009
Messages
23
Reaction score
0
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:
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
Prosz? o pomoc,
Pozdrawiam.
 

Piotre00

Advanced User
Joined
Aug 28, 2008
Messages
178
Reaction score
17
Odp: Wszyscy NPC u?ywaj?cy komendy /send crashuj?

Na samej g?rze skryptu dodaj
Code:
local exppos = { x = 142, y = 213, z = 7 }
local thunderpos = { x = 314, y =288, z = 7 }
(pododawaj reszte pos?w wg. wzoru)

Nast?pnie zamie?:
Code:
selfSay('/send ' .. creatureGetName(cid) .. ', 142 213 7')

na

Code:
doTeleportThing(cid,exppos)

zamie?
Code:
selfSay('/send ' .. creatureGetName(cid) .. ', 314 288 7')

na

Code:
doTeleportThing(cid,thunderpos)

Dalej chyba sobie poradzisz :)
 
Status
Not open for further replies.
Top