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

Tuchol

falania.com
Joined
Nov 21, 2008
Messages
387
Best answers
0
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:

chojrak

Banned User
Joined
Oct 25, 2008
Messages
5,832
Best answers
2
Reaction score
158
I've written the same for McSlaves ;p
 
OP
Tuchol

Tuchol

falania.com
Joined
Nov 21, 2008
Messages
387
Best answers
0
Reaction score
13
Location
Uzbekistan
for tfs 0.3.6
do in lib file 200-data.lua and paste
PHP:
dofile(getDataDir() .. "lib/exhaustion.lua")
 

Elox

http://elox.se/
Joined
Jul 5, 2008
Messages
624
Best answers
0
Reaction score
2
Location
Sweden, Fagersta
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.
 

magesty

New Member
Joined
Jan 10, 2008
Messages
109
Best answers
0
Reaction score
0
200-data.lua No EXIST MEN ;:S HELP
 
Top