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

An teleport spell for tfs 0.3.5pl1 ?

breadmaker

New Member
Joined
Jul 16, 2010
Messages
160
Reaction score
3
Hello.
Anyone got/can make for me spell like:
- If you write : " teleport "nick" you are teleport to player "nick
- You must have 100 level to use this.
- You must have 100% mana to use this.
- You cannot be in PZ and Other Player (nick) cant be in PZ & House Tile & No logout zone & no-pvp zone.

And if it possible, the exhaust/cooldown of spell = 30 minutes.

REP++ ofc. :P
 
Didn't test tho.
Code:
function onSay(cid, words, param, channel)
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to type target name.")
		return true
	end

	if(getPlayerLevel(cid) < 100) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need atleast 100 experience level to cast this spell.")
		return true
	end

	if(getCreatureMana(cid) < getCreatureMaxMana(cid)) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have enough mana points to cast this spell.")
		return true
	end

	if(exhaustion.get(cid, 1337)) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are exhausted.")
		return true
	end

	local player = getPlayerByName(param)
	if(player) then
		if(player == cid) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Ey, don't cheat! :P")
			return true
		end

		if(getTileInfo(getCreaturePosition(cid)).protection) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't cast this spell while you're in protection zone.")
			return true
		end

		local dest = getCreaturePosition(player)
		if(getTileInfo(dest).protection) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't cast this spell while target is in protection zone.")
		elseif(getTileInfo(dest).nologout) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't cast this spell while target is on no logout tile.")
		elseif(getTileInfo(dest).house) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't cast this spell while target is inside house.")
		else
			doTeleportThing(cid, dest)
			doSendAnimatedText(dest, "Caught!", TEXTCOLOR_BLUE)
			exhaustion.set(cid, 1337, 30 * 60)
			doCreatureAddMana(cid, -getCreatureMana(cid))
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with that name is not online.")
	end
	return true
end
 
LUA:
function onSay(cid, words, param, channel)
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to type target name.")
		return true
	end

	if(getPlayerLevel(cid) < 100) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need atleast 100 experience level to cast this spell.")
		return true
	end

        if getPlayerMana(cid) < (getPlayerMaxMana(cid) / 2) then
                doPlayerSendCancel(cid,"You need to have at least half your mana full"
                   return true
        end

	if(exhaustion.get(cid, 1337)) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are exhausted.")
		return true
	end

	local player = getPlayerByName(param)
	if(player) then
		if(player == cid) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Ey, don't cheat! :P")
			return true
		end

		if(getTileInfo(getCreaturePosition(cid)).protection) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't cast this spell while you're in protection zone.")
			return true
		end

		local dest = getCreaturePosition(player)
		if(getTileInfo(dest).protection) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't cast this spell while target is in protection zone.")
		elseif(getTileInfo(dest).nologout) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't cast this spell while target is on no logout tile.")
		elseif(getTileInfo(dest).house) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't cast this spell while target is inside house.")
		else
			doTeleportThing(cid, dest)
			doSendAnimatedText(dest, "Caught!", TEXTCOLOR_BLUE)
			exhaustion.set(cid, 1337, 30 * 60)
			doCreatureAddMana(cid, -getCreatureMana(cid))
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with that name is not online.")
	end
	return true
end
 
Code:
function onSay(cid, words, param, channel)
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to type target name.")
		return true
	end

	if(getPlayerLevel(cid) < 100) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need atleast 100 experience level to cast this spell.")
		return true
	end

	if(getCreatureMana(cid) < getCreatureMaxMana(cid)) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have enough mana points to cast this spell.")
		return true
	end

	if(exhaustion.get(cid, 1337)) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are exhausted.")
		return true
	end

	local player = getPlayerByName(param)
	if(player) then
		if(player == cid) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Ey, don't cheat! :P")
			return true
		end

		if(getTileInfo(getCreaturePosition(cid)).protection) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't cast this spell while you're in protection zone.")
			return true
		end

		if(getCreatureMana(player) < getCreatureMaxMana(player) / 2) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your target needs atleast 50% of his/her mana points.")
			return true
		end

		local dest = getCreaturePosition(player)
		if(getTileInfo(dest).protection) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't cast this spell while target is in protection zone.")
		elseif(getTileInfo(dest).nologout) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't cast this spell while target is on no logout tile.")
		elseif(getTileInfo(dest).house) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't cast this spell while target is inside house.")
		else
			doTeleportThing(cid, dest)
			doSendAnimatedText(dest, "Caught!", TEXTCOLOR_BLUE)
			exhaustion.set(cid, 1337, 30 * 60)
			doCreatureAddMana(cid, -getCreatureMana(cid))
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with that name is not online.")
	end
	return true
end

@Edit:
Fix'd :p
 
Last edited:
Back
Top