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

Exhaustion for teleport command

dualshock3

New Member
Joined
May 14, 2010
Messages
89
Reaction score
3
how can i add exhaustion to my teleport command, here it is my lua if needed:
Code:
 local teleport = {
	['temple'] = {x=100, y=678, z=7},
	['depot'] = {x=64, y=674, z=7},
}

function onSay(cid, words, param, channel)
	local s = teleport[param:lower()]
        if s then
	if getCreatureCondition(cid, CONDITION_INFIGHT)== false then
	doTeleportThing(cid, s)
	doSendMagicEffect(s, CONST_ME_TELEPORT)
		else
			doPlayerSendCancel(cid, 'You are currently in a fight.')
		end
	else
		doPlayerSendCancel(cid, 'Destination doesn\'t exist.')
	end
	return true
end
 
Lua:
local teleport = {
	['temple'] = {x=100, y=678, z=7},
	['depot'] = {x=64, y=674, z=7},
}

local storage = 1000
local time = 30

function onSay(cid, words, param, channel)

	if exhaustion.check(cid, storage) then      
        	return doPlayerSendCancel(cid, "You have to wait "..time.." minutes before you can teleport again.")
    	end
	local s = teleport[param:lower()]
        if s then
	if getCreatureCondition(cid, CONDITION_INFIGHT)== false then
	doTeleportThing(cid, s)
	doSendMagicEffect(s, CONST_ME_TELEPORT)
	exhaustion.set(cid, storage, time*60)
		else
			doPlayerSendCancel(cid, 'You are currently in a fight.')
		end
	else
		doPlayerSendCancel(cid, 'Destination doesn\'t exist.')
	end
	return true
end

Tested and works on tfs 0.3.6, if it works or doesn't work on your server let me know.
Ps: Don't test it with a god char, they don't have exhaust.
 
Last edited:
Lua:
local teleport = {
	['temple'] = {x=100, y=678, z=7},
	['depot'] = {x=64, y=674, z=7},
}
 
local storage = 1000
local time = 30
 
function onSay(cid, words, param, channel)
 
	if exhaustion.check(cid, storage) then      
        	return doPlayerSendCancel(cid, "You have to wait "..time.." seconds before you can teleport again.")
    	end
	local s = teleport[param:lower()]
        if s then
	if getCreatureCondition(cid, CONDITION_INFIGHT)== false then
	doTeleportThing(cid, s)
	doSendMagicEffect(s, CONST_ME_TELEPORT)
	exhaustion.set(cid, storage, time)
		else
			doPlayerSendCancel(cid, 'You are currently in a fight.')
		end
	else
		doPlayerSendCancel(cid, 'Destination doesn\'t exist.')
	end
	return true
end

Now it's seconds (I removed the *60).
 
can you help me with this, i want to add house location to this lua
Code:
local teleport = {
	['temple'] = {x=100, y=678, z=7},
	['depot'] = {x=64, y=674, z=7},
}
 
local storage = 1000
local time = 30
 
function onSay(cid, words, param, channel)
 
	if exhaustion.check(cid, storage)== true 
then
doSendMagicEffect(getPlayerPosition(cid), 2)
        end
if exhaustion.check(cid, storage) then
return doPlayerSendCancel(cid, "You are currently exhausted, you must wait "..time.." seconds before you can teleport again.")
        end
	local s = teleport[param:lower()]
        if s then
	if getCreatureCondition(cid, CONDITION_INFIGHT)== false then
	doTeleportThing(cid, s)
	doSendMagicEffect(s, CONST_ME_TELEPORT)
	exhaustion.set(cid, storage, time*1)
		else
			doPlayerSendCancel(cid, 'You are currently in a fight.')
		end
	else
		doPlayerSendCancel(cid, 'Destination doesn\'t exist.')
	end
	return true
end
 
Back
Top