What's new

Skrypt na Teleport problem !

Status
Not open for further replies.

t06

User
Joined
Jun 30, 2008
Messages
33
Reaction score
1
Ot?? mam problem z Tym skryptem:
Code:
-- by Piotr00
-- mozesz kopiowac ten skrypt jesli skopiujesz tez stopke
function odleglosc(pos1,pos2)
local ile = {0,0}
if (pos1.x >= pos2.x) then
local ile = {(pos1.x - pos2.x),0}
else
local ile = {(pos2.x - pos1.x),0}
end
if (pos1.y >= pos2.y) then
local ile = {ile[1],(pos1.y - pos2.y)}
else
local ile = {ile[1],(pos2.y - pos1.y)}
end
if ((ile[1] + ile[2]) <= 90) then
return true
else
return false
end
end
-- CONFIG
local lev = 80
-- END
function onSay(cid, words, param)
local player = getPlayerByName(param)
local playerpos = getPlayerPosition(cid)
local player2pos = getPlayerPosition(player)
local maxmana = getPlayerMaxMana(cid)
	if isPremium(cid) == TRUE then
		if (getPlayerLevel(cid) >= lev or getPlayerAccess(cid) >= 3) then
			if (getPlayerMana(cid) == maxmana) then
				if (isPlayer(player) == 1) then
					if((getTilePzInfo(player2pos) == FALSE and getCreatureCondition(cid,CONDITION_INFIGHT) == FALSE)) then
						if (odleglosc(playerpos,player2pos) == true) then
							doTeleportThing(cid,getPlayerPosition(player))
							doPlayerSendTextMessage(cid, 19,"Teleportowales sie do \""..param.."\" poprawnie. Straciles "..maxmana.." many.")
							doPlayerAddMana(cid,-maxmana)
						else
						doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Jestescie za daleko od siebie")
						end
					else
					doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Nie mozesz byc w walce, gracz nie moze byc w pz.")
					end
				else
				doPlayerSendCancel(cid,"Nie odnaleziono gracza.")
				end
			else
			doPlayerSendCancel(cid,"Nie masz pelnej many.")
			end
		else
		doPlayerSendCancel(cid,"Musisz miec powyzej '.. lev ..' lvl")
		end
	end
return true
end
W silniku wywala mi taki b??d :
Code:
[Error - TalkAction interface ]
data/talkactions/scripts/tp.lua:onSay
Description:
<luaGetThingPosition> Thing not found
Pomo?e mi kto? :) ???
 
Z

Zbizu

Guest
Odp: Skrypt na Teleport problem !

do locali dodaj
local tp = getThingfromPos(player2pos)

a zamiast "doTeleportThing(cid,getPlayerPosition(player))" daj to:
doTeleportThing(cid,tp)

albo player albo thing ;p nie b?j si? u?ywa? thing. masz tam ifIsPlayer.

Pozdrawiam.
 

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: Skrypt na Teleport problem !

Nie. U?yj getThingFromPos. From z du?ej litery.
 
Status
Not open for further replies.
Top