• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction anti power abust /t command.

Blood BlvD Ot

Member
Joined
Jun 12, 2010
Messages
243
Reaction score
7
I find that when in a pvp situation, Tutors may abuse their /t command.
So i just simply added something small to this and thought maybe other ot owners had the same problem so :D here ya go ^^

Code:
-- Blood Blvd Ot                           --
-- Daniel Couillard                        --
-- [email protected] for questions :) --
function onSay(cid, words, param, channel)
	local tid = cid
	if(param ~= '') then
		tid = getPlayerByNameWildcard(param)
		if(not tid or (isPlayerGhost(tid) and getPlayerGhostAccess(tid) > getPlayerGhostAccess(cid))) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.")
			return true
		end
	end

	local pos = getPlayerTown(tid)
	local tmp = getTownName(pos)
	if(not tmp) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Home town does not exists.")
		return true
	end

	pos = getTownTemplePosition(pos)
	if(not pos or isInArray({pos.x, pos.y}, 0)) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong temple position for town " .. tmp .. ".")
		return true
	end

	pos = getClosestFreeTile(tid, pos)
	if(not pos or isInArray({pos.x, pos.y}, 0)) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Destination not reachable.")
		return true
	end

 	if (hasCondition(cid, CONDITION_INFIGHT) == TRUE) then
    doPlayerSendCancel(cid, "Sorry,you have a battle sign")
   return TRUE
 end

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

	return true
end
 
in tfs, gms and up are the only ones that can use it, unless u change the access requirement ^^
 
...

Or maybe change the access of /t in talkactions.xml??? xd


In that case this modification wouldnt be needed. But like i said for the people that have tutors with /t and have the problem with them abusing it in sticky situations.
 
Back
Top