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

TalkAction Anti trap for protection level players tfs 0.3.4pl2 and 0.3.5

Tuchol

falania.com
Joined
Nov 21, 2008
Messages
387
Reaction score
13
Location
Uzbekistan
Anti trap for protection level players tfs 0.3.4pl2 and 0.3.5 and 0.3.6

Anti trap for protection level players for tfs 0.3.4pl2 and 0.3.5

credits
Tuchol - 90% script
vDk - 10% : D

talkactions/scripts/tp.lua
PHP:
local config = {
        exhaustionInSeconds = 420,
        storage = 36531
}
function onSay(cid, words, param)
local player = getPlayerByName(param)
if(isPlayer(player) == TRUE) then
if(exhaustion.check(cid, config.storage) == TRUE) then
                doPlayerSendCancel(cid, "You can teleport players only 1 time per " .. config.exhaustionInSeconds .. " seconds.")
                return TRUE
        end
 if (getPlayerLevel(cid) > 50) then
  if (getPlayerLevel(player) <= 50) then
   if(doPlayerAddSoul(cid, -100) == TRUE) then
    exhaustion.set(cid, config.storage, config.exhaustionInSeconds)
    doTeleportThing(player, getTownTemplePosition(getPlayerTown(player)))
   else
    doPlayerSendCancel(cid,"You dont have 100 soul points.")
   end
  else
   doPlayerSendCancel(cid,"This player have lvl higher than 50.")
  end
 else
  doPlayerSendCancel(cid,"Your level is too low.")
 end
else
 doPlayerSendCancel(cid,"this players doesn exist, or is offline.")
end
return TRUE
end

in talkactions/talkactions add
PHP:
	<talkaction log="no" words="!tp" access="0" event="script" value="tp.lua"/>

lib/data.lua at the end add
PHP:
dofile(getDataDir() .. "lib/exhaustion.lua")
 
Last edited:
for tfs 0.3.6
do in lib file 200-data.lua and paste
PHP:
dofile(getDataDir() .. "lib/exhaustion.lua")
 
for tfs 0.3.6
do in lib file 200-data.lua and paste
PHP:
dofile(getDataDir() .. "lib/exhaustion.lua")

Is that even needed?
There is no data.lua anymore, it will load exhaustion.lua automatically.
Works fine for me at least.

Thanks for the release.
 
Back
Top