• 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!

Solved GM Commands

Cornex

Web Developer
Senator
Joined
Jun 15, 2008
Messages
3,443
Solutions
6
Reaction score
1,170
Location
Sweden
Hey. The "/a" command works good yesterday. Today it wont work and i don't know what i've been doing lol.

In that fact that i'm not an pro at script i hope for help here :)
I got this console error when i try use it:


PHP:
[27/12/2012 14:13:37] [Error - TalkAction Interface] 
[27/12/2012 14:13:37] data/talkactions/scripts/teleporttiles.lua:onSay
[27/12/2012 14:13:38] Description: 
[27/12/2012 14:13:38] (luaDoTeleportThing) Thing not found

Repp ofc :) thanks

i forgott to share the script. It is the original one. For 3884


PHP:
function onSay(cid, words, param, channel)
	local t = {}
	if(param ~= '') then
		t = string.explode(param, ",")
	end

	local n = tonumber(t[1])
	if(not n) then
		n = 1
	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

	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

	return true
end
 
Last edited:
talk action code:

Code:
<talkaction log="yes" words="/a" access="3" event="script" value="teleporttiles.lua"/>


talk action script "teleporttiles"

Code:
function onSay(cid, words, param, channel)
	local t = {}
	if(param ~= '') then
		t = string.explode(param, ",")
	end

	local n = tonumber(t[1])
	if(not n) then
		n = 1
	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

	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

	return true
end
 
Last edited:
I solve it anyway lol. It was an mod that fuck it up. Thanks anyway and i will rep you for try help me :)
 
Back
Top