• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Help my TalkAction

Haate

John Ever Stone
Joined
Apr 2, 2010
Messages
113
Reaction score
1
Location
Ełk
Code:
function onSay(cid, words, param, channel)
local t = {}
if(param ~= '') then
 t = string.explode(param, ",")
end

local n = 5
if(not n) then
 n = 5
end

local pid = cid
if(t[2]) then
 pid = getPlayerByNameWildcard(t[2])
 if(not pid or (isPlayerGhost(pid) and getPlayerAccess(pid) > getPlayerAccess(cid))) then
  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " not found.")
  return true
 end
end

local pos = getClosestFreeTile(pid, getPosByDir(getCreaturePosition(pid), getCreatureLookDirection(pid), n), false, false)
if(not pos or isInArray({pos.x, pos.y}, 0)) then
 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Destination not reachable.")
 return true
end

function onSay(cid, words, param)
local nextPos = getNextXPosByDir(getCreaturePosition(pid), getPlayerLookDir(pid), 5)
if(getTilePzInfo(nextPos) == false and getTileHouseInfo(nextPos) == false) then
	doTeleportThing(cid, nextPos)
else
	doPlayerSendCancel(cid,"You cannot teleport to protection zone or house.")
end

return true

end

local tmp = getCreaturePosition(pid)
if(doTeleportThing(pid, pos, true) and not isPlayerGhost(pid)) then
 doSendMagicEffect(tmp, CONST_ME_POFF)
 doSendMagicEffect(pos, CONST_ME_TELEPORT)
 
end

end

Code:
<talkaction words="!letsgo" event="script" value="teleported.lua" />



Help me!
I walk to protection zone;/// - help me!
I walk through walls ;/;/ - help me!

And
I don't walk to house. - it's good
I don't walk into walls, stones... - it's good
 
Last edited:
Code:
function onSay(cid, words, param, channel)
	local pos, dir = getThingPos(cid), getPlayerLookDir(cid)
	for i = 1, 5 do
		local cur = {x=pos.x+(dir==1 and i or dir==3 and -i or 0), y=pos.y+(dir==0 and -i or dir==2 and i or 0), z=pos.z}
		if queryTileAddThing(cid, cur) ~= 1 or getTilePzInfo(cur) or getTileHouseInfo(cur) then
			return doPlayerSendCancel(cid, 'Destination not reachable.')
		elseif i == 5 then
			doTeleportThing(cid, cur)
			doSendMagicEffect(pos, CONST_ME_POFF)
			doSendMagicEffect(cur, CONST_ME_TELEPORT)
		end
	end
	return true
end
 
Back
Top