I tried to add new talkaction script using the normal methods like a talkaction line to put in talkaction.xml and a talkaction script which is a lua file
i downloaded a map which does not contain talakction.xml , it has actually but empty and seems it works like this local talk = TalkAction("/n") and it must be added in same lua script , i tried to configure this addtp script but not working without any console errors
tfs 1.3
10.100
i downloaded a map which does not contain talakction.xml , it has actually but empty and seems it works like this local talk = TalkAction("/n") and it must be added in same lua script , i tried to configure this addtp script but not working without any console errors
tfs 1.3
10.100
Code:
local talk = TalkAction("/addtp")
function comparePosition(pos1, pos2)
return (pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z) and true or false
end
local position = false
function onSay(cid, words, param, channel)
local pos,c = getCreatureLookPosition(cid),position
if param == "clear" then
position = false
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Clear.")
end
if not(position) or not(comparePosition(position,pos)) then
if position == false then
position = pos
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format("The teleporter's position was set. [X: %i, Y: %i, Z: %i]",pos.x, pos.y, pos.z)) and doSendMagicEffect(pos, 14)
end
position = false
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, string.format("The teleporter was set up. From:[X: %i, Y: %i, Z: %i] To:[X: %i, Y: %i, Z: %i]",c.x, c.y, c.z, pos.x, pos.y, pos.z)) and doSendMagicEffect(pos, 14) and doCreateTeleport(1387, pos, c)
end
return doPlayerSendCancel(cid,"The teleport position can't be the position where the teleporter is.")
end
talk:separator(" ")
talk:register()