--by vDk
local config = {
exhaustionInSeconds = 440,
storage = 36532
}
function onSay(cid, words, param)
local player = getPlayerByName(param)
if(param == '') then
doPlayerSendTextMessage(cid, 22, "Command requires param.")
return true
end
if(isPlayer(player) == FALSE) then
doPlayerSendTextMessage(cid, 22, "This players is offline, or doesnt exist.")
return TRUE
end
if(getPlayerLevel(player) >= 50) then
doPlayerSendTextMessage(cid, 22, "This player have lvl higher than 50.")
return TRUE
end
if(getPlayerLevel(cid) < 50) then
doPlayerSendTextMessage(cid, 22, "Your level is too low to teleport other players.")
return TRUE
end
if(getPlayerSoul(cid) < 100) then
doPlayerSendTextMessage(cid, 22, "You don't have 100 soul points.")
return TRUE
end
local pos = getPlayerPosition(player)
if(getTilePzInfo(pos) == TRUE) then
doPlayerSendTextMessage(cid, 22, "You can't teleport this player because he is in PZ zone.")
return TRUE
end
if(exhaustion.check(cid, config.storage) == TRUE) then
doPlayerSendTextMessage(cid, 22, "You can teleport players only one time per " .. config.exhaustionInSeconds .. " seconds.")
return TRUE
end
if(isPlayer(player) == TRUE) then
exhaustion.set(cid, config.storage, config.exhaustionInSeconds)
doTeleportThing(player, getTownTemplePosition(getPlayerTown(player)))
doPlayerSendTextMessage(player, 22, 'You have been teleported to temple by '.. getPlayerName(cid) ..'.')
doPlayerSendTextMessage(cid, 22, 'You succesfully teleported '.. getPlayerName(player) ..' to temple.')
doPlayerAddSoul(cid, -100)
return TRUE
end
return TRUE
end