Kod:
function onSay(cid, words, param)
local position = getCreaturePosition(cid)
local pid,pos = 0,0
local margin = {}
	if(param == "") then
		doPlayerSendTextMessage(cid, 22, 'Command param required.')
		return true
	end
	pid = getPlayerByNameWildcard(param)
	if(not pid or (isPlayerGhost(pid) and getPlayerAccess(pid) > getPlayerAccess(cid))) then
		doPlayerSendTextMessage(cid, 22, 'Player '..param..' not found.')
		return true
	end
	pos = getCreaturePosition(pid)
	margin = getMargin(position, pos)
	if(margin.x == 0 and margin.y == 0) then
		doPlayerSendTextMessage(cid, 22, param..' is on '..margin.dir3..' ['..margin.z..' levels]  level.')
	elseif(margin.x == 0) then
		doPlayerSendTextMessage(cid, 22, param..' is on '..margin.dir2..' ['..margin.y..' squares] on '..margin.dir3..' ['..margin.z..' levels] level.')
	elseif(margin.y == 0) then
		doPlayerSendTextMessage(cid, 22, param..' is on '..margin.dir1..' ['..margin.x..' squares] on '..margin.dir3..' ['..margin.z..' levels] level.')
	else
		doPlayerSendTextMessage(cid, 22, param..' is on '..margin.dir2..' ['..margin.y..' squares] - '..margin.dir1..' ['..margin.x..' squares] on '..margin.dir3..' ['..margin.z..' levels] level.')
	end
return true
end

function getMargin(position, pos)
	local margin = {x = 0, y = 0, z = 0, dir1 = "West", dir2="North", dir3="higher"}
		margin.x = position.x - pos.x
		margin.y = position.y - pos.y
		margin.z = position.z - pos.z
		if(margin.x < 0) then
			margin.x = -margin.x
			margin.dir1 = "East"
		end
		if(margin.y < 0) then
			margin.y = -margin.y
			margin.dir2 = "South"
		end
		if(margin.z < 0) then
			margin.z = -margin.z
			margin.dir3 = "lower"
		elseif(margin.z == 0) then
			margin.dir3 = "same"
		end
	return margin
end
Kod:
<talkaction words="!search" hide="yes" event="script" value="searching.lua"/>
Szukamy gracza za pomocą komendy
Kod:
!search gracz
Tutaj mały screen


W wersji 0.2 planuję zrobić określanie najbliższego miasta.

Pozdrawiam,
Tairens